Internal transitions

116 views
Skip to first unread message

Tom

unread,
Dec 22, 2011, 3:52:36 PM12/22/11
to Stateless .NET State Machine Framework
Using the terminology from Wikipedia (http://en.wikipedia.org/wiki/
UML_state_machine#Internal_transitions)
I need an option for a trigger in a certain state to only execute a
certain action, and to not result in a transition (internal
transition).
Reentry states allow this to some extension (They're self transitions
by wiki terminology), but they execute the entry and exit actions of
the state, which is not what I want.

I think about adding this feature as an extension, but I do not see a
way to add custom trigger behaviors.
Any thoughts?

Nicholas Blumhardt

unread,
Dec 23, 2011, 11:42:57 PM12/23/11
to dotnet-state-ma...@googlegroups.com
Have you looked at the overload of OnEntry() that provides the transition? You might be able to use it to only execute certain actions when not performing a self-transition:

.OnEntry(t => {
   if (t.Source != someState) {
     // etc.
   }
});

Hope this helps!
Nick

Tom

unread,
Dec 24, 2011, 4:26:03 AM12/24/11
to Stateless .NET State Machine Framework
Whoa, did not see that overload :P
Yes, I guess I'll be able to make do with this.
But with this the entry and exit actions are still executed. In my
case they don't do much, but in case they do it's an overhead.
Don't know if you still develop the library, but, well, something to
think about.

Anyways thanks, great library :)

On Dec 24, 6:42 am, Nicholas Blumhardt <nicholas.blumha...@gmail.com>
wrote:
> Have you looked at the overload of OnEntry() that provides the transition?
> You might be able to use it to only execute certain actions when not
> performing a self-transition:
>
> .OnEntry(t => {
>    if (t.Source != someState) {
>      // etc.
>    }
>
> });
>
> Hope this helps!
> Nick
>
Reply all
Reply to author
Forward
0 new messages