I am getting familiar with MSM boost library. I have found this really interesting questions about joining several orthogonal states.
Also, I have found in the boost documentation a way to reuse an sub state machine within a parent one and I have coded a couple of simple nested states machine.
However, I cannot wrap my head around how to mix this two things together.
My goal is to fork to several independent instances of the same sub state machine and wait till of them have finished before returning the control to the parent one.
However, the boost documentation says that it is not possible to fork to sub state machine directly.
Note (also valid for forks): At the moment, it is not possible to use a submachine as the target of an explicit entry. Please use entry pseudo states for an almost identical effect.
Example
Buying a ticket plane can be model as sub state machine, you request a price, then perform some evaluation and than you can purchase it (cancellation and no completion of order are also possible). But the same logic can be apply with several airline companies. Now, let's assume that we want to create a software that scan the market and book a certain amount of tickets from different providers. When we receive the order from the customer, we query the market and we decide to buy from 4 different airlines (the customer doesn't mind it). Now, the 4 sub state machine will work in parallel and the control will return back to parent state machine only when the last order is completed. (I know the example is not great, but I hope you got the idea).
Questions
Is it possible to fork and use several instance of the same state machine (or achieve the almost identical effect with pseudo states)? How do the state machine knows on which of the sub state machine an event is referring to?
If it is possible, could you please point me in to right direction? I know about this boost documentation example, but it doesn't really address my issue.
I am at the early stage of my project, so I can still move to a different state machine library if necessary (boost statechart is under evaluation as well).