I just experienced this issue myself. It seems to me that there could be 
value in allowing the implementer of the FSM to decide which transitions 
are valuable and which are not. Akka does provide the distinction between 
goto(state) and stay() -- couldn't the first imply a transition where the 
second does not? Back in my college automata course, we implemented plenty 
of state machines with same-state transitions that were significant 
(consuming messages in the process): regular expressions like */(a)*b/*being a 
perfect example.

My work-around has been to implement two identical states that simply 
bounce between each other. While workable it looks quite clumsy, as in this 
FizzBuzz example: https://gist.github.com/JavadocMD/9859519

Is there any chance the Akka team could reconsider this implementation or 
are there compelling reasons to leave it as-is?

Thanks,
Tyler


On Monday, March 17, 2014 2:09:50 PM UTC-7, Patrik Nordwall wrote:
>
> Hi,
>
>
> On Mon, Mar 17, 2014 at 5:43 PM, brett <[email protected] <javascript:>
> > wrote:
>
>> Hi 
>>
>> I have a finite state machine modelled in Akka FSM that in certain 
>> circumstance transitions back to the same state after updating some values.
>>
>> I have found that the onTransition handler is called when i transition 
>> from one different state to another (e.g. A to B)  but this handler is not 
>> called when I transition from the same state (e.g. A to A).
>>
>> Is this expected behaviour of the Akka FSM?
>>
>
> Yes, that is expected. Staying in the same state is not a state transition.
> Cheers,
> Patrik
>  
>
>>
>> cheers
>>
>> Brett 
>>
>> p.s. I originally posted this question over on the play framework user 
>> list but i have been advised to post it here so apologise to those of you 
>> who see this question twice in your inbox.
>>  
>> -- 
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Patrik Nordwall
> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
> Twitter: @patriknw
>
>  

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to