1

I am using commons SCXML2 having States and tasks to control the Workflow Engine and initially the engine starts with a initial State and execute State and task in a flow. And our requirement is that we want to persist the State if the Workflow get exited. We are storing the State in the Database from which we want to resume the Workflow. Now i am unable to resume the Workflow with the given State. what i tried...

SimpleTransition initialTransition = new SimpleTransition();
initialTransition.setNext("first");    //jumping to First State         
exec.getStateMachine().setInitialTransition(initialTransition);

I am unable to find how to jump to given state and used the above code to do so but it does not help for me.

Phrogz
  • 296,393
  • 112
  • 651
  • 745
  • An alternative (but far less clean) option is to create an initial state with conditional transitions to all possible states that you might have recorded, and use the state in the database with your conditions to decide which transition to take. I do not know Apache Commons SCXML so I cannot help you with your specific code; in my own company we added a custom `initialexpr` attribute to our SCXML interpreter that allows us to specify a list of state(s) to enter at startup. – Phrogz Mar 19 '16 at 04:37
  • Thank You, Phrogz . I also continued with a similar approach. I added some transitions in the initial state. – Saishrinivas Mar 22 '16 at 04:52

0 Answers0