Overview
The Bonita Transport is a BPM transport, allowing you to integrate Mule with the Bonita BPM Open Solution. Bonita Open Solution allows you to draw your processes using a GUI, then deploy your process in one click. Apart from the process design, one can also use the GUI to create Forms which can be used to execute the process from a "Human" perspective. You also get the "User Experience" Web application from where one can initiate processes and access your tasks and execute them.
This transport will allow you to integrate with Bonita, and will allow you to initiate, advance or abort tasks. Apart from this transport, there is also a Bonita Mule Connector which will allow you to make use of Mule to send, dispatch or request messages.
Connector Configuration
One would typically have to configure the connector whenever bonita is embedded in mule. For deployment options look below.
| Connector Attribute | Description |
|---|---|
| login | Username to access bonita |
| password | Password to access bonita |
| bonitaEnvironmentPath | Path to the bonita-environment.xml which is the bonita environment configuration file |
| jaasFilePath | Out of the box, bonita makes use of Jaas for security. This value should point to the jaas configuration |
| undeployUnlistedProcesses | If set to true, any process that are not defined in this connector will be undeployed |
| redeployProcesses | If set to true, if a process is already deployed and defined in this connector, the |
Apart from these attributes, one can set a number of bonita processes that will be made available to Mule.
<bos:connector bonitaenvironmentpath="src/test/resources/bonita/bonita-environment.xml" jassfilepath="src/test/resources/bonita/jaas-standard.cfg" login="admin" name="bosConnector" password="bpm" redeployprocesses="true" undeployunlistedprocesses="true"> <bos:barfilepaths> <spring:value>src/test/resources/processes/LeaveApproval--1.0.bar</spring:value> </bos:barfilepaths> </bos:connector>
In this example, bonita will make use of the bonita-environment.xml configuration file and also set the jass configuration. Mule will access the bonita api using the credentials admin and bpm. There will be only 1 process made available, the LeaveApproval processes. If there are any other processes deployed on bonita, they will be undeployed since undeployUnlistedProcesses is true and if the LeaveApproval process is already deployed, it is first undeployed then deployed again.
Using the transport
Endpoints used in the bonita transport are similar to how they are used in the BPM transport.
You would start a new LeaveApprovalProcess as follows:
bos://LeaveApprovalProcess
To advance a process instance you need to set the process instance ID. This could be done on the endpoint address
bos://LeaveApprovalProcess/LeaveApproval--1.0-1
However it is typically more useful to set the id as a message property by setting the property value MULE_BPM_PROCESS_ID.
Bonita (unlike JBPM) allows you to have concurrent tasks active at the same time. In such situations, you cannot simply "Advance" the process since there will be more than task ready to be executed. In such situations, the transport will by default execute the first task which was set to ready, however, it would be even better to explicitly define which activity to execute. To this, one would typically set the MULE_BOS_ACTIVITY property.
Furthermore, by default, when executing a process, the message payload is placed in a variable called "incoming". However, you can set which variable you want Mule to use by setting the MULE_BOS_RESULT_VARIABLE property. Also, all the properties on the message will be saved to the processes if they where defined in the process.
Deployment
Apart from having Bonita embedded in Mule, you can actually have Mule run embedded inside bonita. This approach is typically taken if you want to make use of the Bonita Web Application. The bonita client api allows access to bonita running in the same JVM, or through EJB2 and EJB3. However, looking forward for the REST api which should be coming up in the next release of bonita.
Bonita Mule Connector
The Bonita Mule Connector is a Bonita specific connector which allows Bonita access to the Mule API. For documentation to use this connector go here.
Examples
For a complete example of using Mule with bonita go here.
With our library of Cloud Connectors and repeatable integration solutions, you can rapidly create connectivity either on premise or in the cloud.
