Source

osworkflow / docs / Creating_a_new_workflow.html

<html><head><title>OSWorkflow Creating a new workflow</title></head><body>
<ul class="star">
<li>Up to <a href="Documentation.html">Documentation</a></li>
<li>Back to <a href="Interface_choices.html">Interface choices</a></li>
<li>Forward to <a href="Executing_actions.html">Executing actions</a></li>
</ul><p class="paragraph"></p>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 <a href="Configuration.html">Configuration</a>. Then your code must know what the <b class="bold">initialStep</b> value should be for initializing an instance. Before you can initialize a workflow you must <b class="bold">create</b> it so that you have an ID that can be referenced from now on in the API. The following code example illustrates this:<p class="paragraph"></p>
<div class="wikicode"><pre>Workflow wf = <span class="java&#45;keyword">new</span> BasicWorkflow(username);
HashMap inputs = <span class="java&#45;keyword">new</span> HashMap();
inputs.put(<span class="java&#45;quote">"docTitle"</span>, request.getParameter(<span class="java&#45;quote">"title"</span>));
wf.initialize(<span class="java&#45;quote">"workflowName"</span>, 1, inputs);</pre></div><p class="paragraph"></p>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!</body></html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.