Dashboard > OSWorkflow > ... > Documentation > 5.2 Creating a new workflow
  OSWorkflow Log In View a printable version of the current page.  
  5.2 Creating a new workflow
Added by Cameron Braid, last edited by Hani Suleiman on Apr 20, 2004  (view change)
Labels: 
(None)

This is a very brief guide on how you can create a new workflow instance using the OSWorkflow Java APIs. First, the workflow definition file (in XML) must be created and defined using the 1.5 Loading Workflow Definitions. Then your code must know what the initialStep value should be for initializing an instance. Before you can initialize a workflow you must create it so that you have an ID that can be referenced from now on in the API. The following code example illustrates this:

Workflow wf = new BasicWorkflow(username);
HashMap inputs = new HashMap();
inputs.put("docTitle", request.getParameter("title"));
wf.initialize("workflowName", 1, inputs);

Note that usually, you would use a more appropriate Workflow implementation rather than BasicWorkflow. For example, EJBWorkflow or OfbizWorkflow. If you want to use a Workflow store that does not have a custom workflow context implementation (for example, JDBC, or Hibernate), then use BasicWorkflow. Contributions of WorkflowContexts for various stores are more than welcome!

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators