No - no orthogonal states. If I had that I'd look for a data-driven
approach rather than coding each fsm as I have done
good luck!
Tim


On 4 January 2014 19:42, Nicholas Ustinov <[email protected]> wrote:

> Thank you for response and for sharing experience.
> Does your approach work good for orthogonal states of FSM (aka tag
> "parallel" in SCXML), when FSM can have several active states at one time?
>
>
> суббота, 4 января 2014 г., 22:20:48 UTC+4 пользователь Tim Pigden написал:
>
>> I tried to do hierarchical fsm using just nested akka fsms. It doesn't
>> work (they never said it did) because of the problem of passing messages
>> through to children asynchronously - you may have 2 messages come through
>> in rapid succession and you have to manually queue the second one while
>> you're firing up the new state.
>> Then I considered "why should akka fsm support hierarchies via multiple
>> actors". Surely the essence of the fsm is that it is only doing one thing
>> at a time because it's only in one state at a time. You can't transition to
>> a new state until you've finished with the old one. Actors are inherently
>> doing different things at the same time - so other than the fact that we
>> have a single tier fsm in Akka why start there as a means of abstraction of
>> the problem?
>> My solution was to create my own hierarchical fsm using immutable
>> structures - essentially a stack  (child changes, the stack changes,
>> percolating upwards). Once I'd made the effort I found it suited me very
>> nicely. All I need is to wrap it all in a single actor that processes
>> incoming messages and passes them down.
>>
>> I think my conclusion is that just because akka does a single tier fsm
>> nicely it doesn't mean that having multiple actors is a good model for a
>> complex fsm. And if it's not done with multiple actors why do it with the
>> akka fsm at all? With a bit of effort you could produce a dsl that was
>> pretty similar to Akka's in terms of those nice gotos and transitions but
>> in a single thread. The fsm is then only doing one thing at a time and the
>> wrapper actor is handling the queuing for you. I didn't go as far as a dsl
>> because I don't need to -my total model has 10 sub-fsms (including
>> sub-sub-fsms) and probably no more than 30 different states so it wasn't
>> worth too much api writing.
>>
>> Tim
>>
>>
>>
>> On Saturday, January 4, 2014 12:27:35 AM UTC, Nicholas Ustinov wrote:
>>>
>>> Hello!
>>>
>>> I found some useful discussions in this list about hierarchical FSMs, I
>>> mean
>>> https://groups.google.com/forum/?fromgroups#!searchin/
>>> akka-user/state$20machine/akka-user/Lqezg-y215g/TdiyWEklW7gJ
>>> https://groups.google.com/forum/?fromgroups#!searchin/
>>> akka-user/state$20machine/akka-user/Sfl3Xcul86I/8HW1CZJoHtcJ
>>> https://groups.google.com/forum/?fromgroups#!searchin/
>>> akka-user/first-day/akka-user/eX_3rZ-cNNw/kV9YNzsSnkUJ
>>>
>>> and some others.
>>>
>>> So I understand that akka's FSM realization doesn't have support of
>>> hierarchical and parallel FSMs. But it's very interesting, if you have some
>>> plans or thoughts for this?
>>> Especially for orthogonal states of FSMs.
>>> I think, for toy things or very simple abstractions current realization
>>> will be good enough, but for real-world domain modeling you will need
>>> support of smth like things, described in SCXML specification, i mean,
>>> support for full-blown Harel state machines.
>>> I ask because I need to implement some domain abstractions in this way
>>> and i'm looking for the cheapest way for implementing it.
>>>
>>> Thank you,
>>> Nicholas
>>>
>>  --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/akka-user/X-Awg4jlJk0/unsubscribe.
> To unsubscribe from this group and all its topics, 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/groups/opt_out.
>



-- 
Tim Pigden
Optrak Distribution Software Limited
+44 (0)1992 517100
http://www.linkedin.com/in/timpigden
http://optrak.com
Optrak Distribution Software Ltd is a limited company registered in England
and Wales.
Company Registration No. 2327613 Registered Offices: Suite 6,The Maltings,
Hoe Lane, Ware, SG12 9LR England
This email and any attachments to it may be confidential and are intended
solely for the use of the individual to whom it is addressed. Any views or
opinions expressed are solely those of the author and do not necessarily
represent those of Optrak Distribution Software Ltd. If you are not the
intended recipient of this email, you must neither take any action based
upon its contents, nor copy or show it to anyone. Please contact the sender
if you believe you have received this email in error.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: http://akka.io/faq/
>>>>>>>>>>      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/groups/opt_out.

Reply via email to