Open gischthefish opened 3 years ago
I also have stumbled around this point for some hours, but indeed you can send events from the inner sm to an outer sm.
Please see a working example in the test code in the lambda function "test process_event_sent_from_substate" here.
Important fact: you'll have to add the policy sml::process_queue
The example of issue #283 (Jump out from substate) only works when using
front::actions::process
, but not withsml::back::process.
#302 (Process events to/from sub/sibling machines) should have solved the problem when exiting sub-machines.front::actions::process
doesn't help, I need to be able to choose the event getting fired.Following the example of #283 using
sml::back::process
(not working):See the following compile error: error.txt
Furthermore issue #121 (Submachine terminate event should be actioned in outer state) seems not to be fixed yet. #302 (Process events to/from sub/sibling machines) should have fixed #121. But the event that terminates the sub-machine is not being propagated to the parent sm.
The following test should work:
Propagating the event that terminated the sub-machine to the parent is a very essential feature, without that sub-machines are quite useless as the parent does not know what the sub-machine was doing, i.e. the sub-machine needs some means to tell the parent the result of the "computation".
Specifications