0

I have the following boost::statechart state:

struct PendingWFInfo : bsc::state<PendingWFInfo, PseudoIdle> {
  bool success;
  PendingWFInfo(my_context ctx) : my_base(ctx) {
    std::cout << "[+] PendingWFInfo" << std::endl;
    success = context<RH_StateMachine>().startReplenishment();
    if (success) {
      std::cout
          << ".....................Start replenishment successfully called\n";
    } else {
      std::cout << ".....................Failed to call Start replenishment "
                   "service\n";
    }
  }
  ~PendingWFInfo() { std::cout << "[-] leaving PendingWFInfo state... \n"; }
  typedef boost::mpl::list<bsc::custom_reaction<InboundInfoReceived>,
                           bsc::transition<Error, CommunicationError>
                           > reactions;
  bsc::result react(const InboundInfoReceived &event) {
    if (context<RH_StateMachine>().getWireframeCapacity() > 0) {
      transit<UserConfirmationPending>();
    }
    else{
      transit<InboundImpossible>();
    }
  }
};

When i am in the current state and a InboundInfoReceived event is emitted, i get the following error /usr/include/boost/statechart/result.hpp:58: boost::statechart::detail::safe_reaction_result::~safe_reaction_result(): Assertion `reactionResult_ == consumed' failed.

The if statement is true but the transition gives me an assertion error.

juls
  • 1
  • More precisely i receive an assertion error in BOOST_ASSERT( reactionResult_ == consumed ); – juls May 05 '16 at 08:56
  • 1
    I found it, i must return the return value of a transit call: return transit(); – juls May 05 '16 at 09:47

0 Answers0