...
|
The ServiceMix OSWorkflow component provides workflow functionality to the ESB. You can specify one or more workflows and it's processing will start when a valid message is received.
|
{note:title=Availability} Note that this component is not yet available in the current smx release version. It is part of the actual trunk so maybe a developer snapshot will contain it. {note}
|
{tip:title=OSWorkflow HowTo} If you have no experience with the OSWorkflow itself, then it would be a good idea to have a look at the website [http://www.opensymphony.com/osworkflow/] and reading the documentation and tutorials there. {tip}
|
h2. Installation
|
h2. Maven Archetype
|
|
Installing the servicemix-osworkflow component can be done in several ways: * drop the installer zip in an hotdeploy directory monitored by ServiceMix * using [ant tasks|Ant Tasks]
|
You can use Maven servicemix-osworkflow-service-unit archetype to create a service unit:
|
|
Note that when using ant tasks, the component is not started, you will have to start it manually using ant tasks or a console. h2. Creation You can use Maven to create a service unit.
|
{code} mvn archetype:create \ -DarchetypeGroupId=org.apache.servicemix.tooling \ -DarchetypeArtifactId=servicemix-osworkflow-service-unit \
|
-DgroupId=com.mycompany.myproduct -DarchetypeVersion=2010.01 \
|
-DgroupId=your.group.id \ -DartifactId=your.artifact.id \
|
-DartifactId=mycomponent.artifact -Dversion=your-version
|
{code}
|
You can also use the helper tool {{smx-arch}} in the bin folder of your servicemix installation. Look at the help to see the needed parameters.
|
This will give you a simple workflow example to start with.
|
...
|
{code}
|
h2. Endpoint Configuration
|
|
h2. XBean deployment You can deploy Service Units containing a file named xbean.xml for activating endpoints. Note that you have to define the namespace with {code:xml} <beans xmlns:osworkflow="http://servicemix.apache.org/osworkflow/1.0"> ... </beans> {code} Any numbers of endpoints can be specified in the xbean.xml file. h2. Endpoints
|
The endpoint will receive messages from the NMR and will start then the processing of the workflow. You can send both, InOnly and InOut messages to this endpoint. Sending an InOnly message will start the workflow in a separate thread, while sending an InOut will result in sychronous processing of the workflow.
|
{code:lang=xml|title=OSWorkflow eEndpoint}
|
<osworkflow:endpoint service="test:workflow" endpoint="workflowEndpoint"
|
...
|
{code}
|
{info:title=OSWorkflow endpoint attributes|borderStyle=solidbgColor='lighblue'}
|
{info:title=OSWorkflow Endpoint Attributes|borderStyle=solidbgColor='lighblue'}
|
|| Name || Type || Description || Required || | service | QName | the service name of the exposed jbi endpoint | yes |
|
...
|