osworkflow / docs / Configuration.html

<html><head><title>OSWorkflow Configuration</title></head><body>
<ul class="star">
<li>Up to <a href="Documentation.html">Documentation</a></li>
<li>Back to <a href="Persistence_Options.html">Persistence Options</a></li>
<li>Forward to <a href="Integration_with_Other_Modules.html">Integration with Other Modules</a></li>
</ul><p class="paragraph"></p>OSWorkflow tries to be as flexible as possible with regards to configuration. Only one file is required to be in the classpath: <span class="nobr"></img><a href="#osworkflow.xml">osworkflow.xml</a></span>. This file dictates the persistence method (JDBC, EJB, Ofbiz) as well the workflow factory class that is to be used for loading workflow definitions. The default factory is <b class="bold">com.opensymphony.workflow.loader.XMLWorkflowFactory</b>. This loads up a file in the classpath that in turn contains links to many different workflow definition files, all in XML (<span class="nobr"></img><a href="http://www.opensymphony.com/osworkflow/workflow_2_6.dtd">see Appendix A</a></span>). During test phase it's also useful to have your workflow definition files reloaded as they are changed. For this you can specify an optional property called <b class="bold">reload</b> (true|false) to your factory definition (default is false). If you would rather specify your workflow definitions in a different way, you are free to extend <span class="nobr"></img><a href="http://www.opensymphony.com/osworkflow/api/com/opensymphony/workflow/loader/AbstractWorkflowFactory.html">com.opensymphony.workflow.loader.AbstractWorkflowFactory</a></span> in any way that you like. <b class="bold">com.opensymphony.workflow.loader.JDBCWorkflowFactory</b> for example is an alternative factory, that allows you to store your workflow definitions in a JDBC database instead of putting them into the xml files. (<a href="JDBCWorkflowFactory.html">JDBCWorkflowFactory</a>)<p class="paragraph"></p>The most common configuration would be:
<h3 class="heading-1-1"><a name="osworkflow.xml"></a><a href="Configuration#osworkflow_xml.html" title="Permalink to osworkflow.xml"></img></a> osworkflow.xml:
<div class="wikicode"><pre>&#60;osworkflow&#62;
  &#60;persistence class=<span class="java&#45;quote">"com.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore"</span>&#62;
    &#60;arg name=<span class="java&#45;quote">"foo"</span> value=<span class="java&#45;quote">"bar"</span>/&#62;
  &#60;factory class=<span class="java&#45;quote">"com.opensymphony.workflow.loader.XMLWorkflowFactory"</span>&#62;
    &#60;property key=<span class="java&#45;quote">"resource"</span> value=<span class="java&#45;quote">"workflows.xml"</span> /&#62;
<h3 class="heading-1-1"><a name="workflows.xml"></a><a href="Configuration#workflows_xml.html" title="Permalink to workflows.xml"></img></a> workflows.xml:
</h3><p class="paragraph"></p><div class="wikicode"><pre>&#60;workflows&#62;
  &#60;workflow name=<span class="java&#45;quote">"example"</span> type=<span class="java&#45;quote">"resource"</span> location=<span class="java&#45;quote">"example.xml"</span>/&#62;
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.