...
Once that happens you re-awaken the workflow and commence execution at some step. To implement this just call the goTo() method to cause the workflow to resume at the given step
Simple Example
There now follows a simple workflow example...
Wiki Markup |
---|
{snippet:id=workflow|lang=java|url=http://svn.apache.org/repos/asf/incubator/servicemix/trunk/servicemix-beanflow/src/test/java/org/apache/servicemix/beanflow/SimpleWorkflow.java} |
As you can see the step is defined by an enumeration Step and we have a regular Java method to implement each step. The step method can then return the step to go to next after the current method terminates. If you return null or use a void method then the workflow suspends.
Complete Example
The following example is a fairly large one, but it shows a variety of different concepts
...