OSWorkflow can be embedded in any application whether it's J2SE or JEE based by simply including the osworkflow.jar
file into the classpath of the application. In any case, you must have the osworkflow.xml
file, any referenced resources such as workflows.xml
, and the XML of the process in the classpath. In this case, the workflow descriptor name is holiday.xml
.
Imagine you have an application that interfaces with OSWorkflow, and you'd like to instantiate a new Workflow
. This is as easy as:
Workflow wf = new BasicWorkflow("johndoe"); Long id = Wf.initialize("holiday", 1, null);
The first line creates a new BasicWorkflow
with the current username as parameter. BasicWorkflow
objects are heavyweight and it is reasonable to have one instance per user to avoid the creation cost.
The second line executes the initialize()
method with the workflow name as the first parameter, the initial action number as the second parameter, and the actions...