Skip to content
Snippets Groups Projects
Commit f46ab3c3 authored by Giuseppe Avolio's avatar Giuseppe Avolio
Browse files

Added missing information to the original transition command

parent 244e1ee6
No related branches found
No related tags found
No related merge requests found
Pipeline #45520 passed with stage
in 8 minutes and 41 seconds
......@@ -626,6 +626,11 @@ struct DO_SUBTRANSITION {
FSM_STATE currState = FSM_STATE::ABSENT;
fsm.visit_current_states(boost::ref(currState));
// Always add the needed information to the original command
// This helps avoiding problems when the FSM calls call-back function in special cases
// like exceptions thrown during a transition
augmentTransitionCommand(*(evt.transitionCommand()), FSM_COMMAND::SUB_TRANSITION, currState, currState);
// Here we need to create the right command (from the generic transition to the proper one)
SubTransitionCmd trCmd(evt.transitionCommand()->serialize());
augmentTransitionCommand(trCmd, FSM_COMMAND::SUB_TRANSITION, currState, currState);
......@@ -663,6 +668,11 @@ struct DO_USERBROADCAST {
FSM_STATE currState = FSM_STATE::ABSENT;
fsm.visit_current_states(boost::ref(currState));
// Always add the needed information to the original command
// This helps avoiding problems when the FSM calls call-back function in special cases
// like exceptions thrown during a transition
augmentTransitionCommand(*(evt.transitionCommand()), FSM_COMMAND::USERBROADCAST, currState, currState);
// Here we need to create the right command (from the generic transition to the proper one)
UserBroadcastCmd trCmd(evt.transitionCommand()->serialize());
augmentTransitionCommand(trCmd, FSM_COMMAND::USERBROADCAST, currState, currState);
......@@ -687,6 +697,11 @@ struct DO_USERBROADCAST {
struct DO_RESYNCH {
template <typename EVT, typename FSM, typename SourceState, typename TargetState>
void operator()(const EVT& evt, FSM& fsm, SourceState& src, TargetState& tgt) {
// Always add the needed information to the original command
// This helps avoiding problems when the FSM calls call-back function in special cases
// like exceptions thrown during a transition
augmentTransitionCommand(*(evt.transitionCommand()), FSM_COMMAND::RESYNCH, src.state(), tgt.state());
// Here we need to create the right command (from the generic transition to the proper one)
ResynchCmd resCmd(evt.transitionCommand()->serialize());
augmentTransitionCommand(resCmd, FSM_COMMAND::RESYNCH, src.state(), tgt.state());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment