Business Process addon
Introduction
Soffid Business Processes use JBoss JBPM engine. You can find the original JBPM documentation here.
In order to develop a new business process addon you need Eclipse Java EE IDE for Web Developers and three plugins installed on it:
- JBPM plugin. You can find it on http://fr.sourceforge.jp/projects/sfnet_jbpm/downloads/jBPM%20Process%20Designer/jbpm-jpdl-designer-3.1.7/jbpm-jpdl-designer-site-3.1.7.zip/ and you can install it from Help/Install New Software/Add and select the file you have downloaded with the Archive button.
- ZK Studio. Follow this instructions in order to install http://books.zkoss.org/wiki/ZK_Studio_Essentials/Installation#Install_ZK_Studio.
- maven plugin (m2e-Maven Integration for Eclipse). Go to Help/Install New Software/Work with: "All Available Sites" and select the pluguin.
The business process addon can be build using the com.soffid.tools:maven-par-plugin addon.
They follow the JBPM conventions for .par files:
- /processdefinition.xml contains the business process definition that you define.
- /processimage.jpg contains a bitmap representation of the definition you have created.
- /gpd.xml contains the position of business process elements on processimage.jpb bitmap.
- /classes directory contains the java compiled classes that support the business process that you implement.
- /ui.xml file describes some aspects not covered by processdefinition.xml, just like permissions, user interface and process versioning and upgrade.
- /ui directory contains the user interface (ZK) components that are needed to render the workflow tasks.
Examples
/processdefinition.xml
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.3"
name="Recertification process">
<description>
Process to execute recertification tasks.
</description>
<start-state name="Start">
<description>
Starts a recertification process
</description>
<transition to="Select groups"></transition>
<event type="before-signal">
<action name="Create recertification process" class="com.soffid.iam.recertification.bpm.CreateRecertificationProcessHandler"></action>
</event>
</start-state>
<task-node name="Select groups">
<description>
Selects one or more business units.
...
</description>
<task name="Select business units">
<assignment pooled-actors="SEU_ADMIN, SEU_ADMINISTRADOR, SOFFID_ADMIN"></assignment>
</task>
<transition to="Cancelled" name="Cancel"></transition>
<transition to="Create recertification task" name="Recertificate"></transition>
</task-node>
<node name="Create recertification task">
<action name="Create recertification info" class="com.soffid.iam.recertification.bpm.CreateRecertificationTaskHandler"></action>
<transition to="Waiting for group certification"></transition>
</node>
<state name="Waiting for group certification" async="true">
<transition to="Cancelled" name="Cancel"></transition>
<transition to="End" name="End"></transition>
</state>
<end-state name="Cancelled"></end-state>
<end-state name="End"></end-state>
<event type="process-end">
<action class="com.soffid.iam.recertification.bpm.ProcessFinishedHandler"></action>
</event>
</process-definition>
/processimage.jpg
/gpd.xml
<?xml version="1.0" encoding="UTF-8"?>
<root-container name="Recertification process" width="743" height="369">
<node name="Start" x="16" y="14" width="132" height="36">
<edge>
<label x="5" y="-10"/>
</edge>
</node>
<node name="Select groups" x="260" y="14" width="203" height="36">
<edge>
<label x="-135" y="-21"/>
<bendpoint w1="314" h1="0" w2="-1" h2="-207"/>
</edge>
<edge>
<label x="5" y="-10"/>
</edge>
</node>
<node name="Create recertification task" x="259" y="124" width="207" height="36">
<edge>
<label x="5" y="-10"/>
</edge>
</node>
<node name="Waiting for group certification" x="258" y="219" width="210" height="36">
<edge>
<label x="-14" y="-20"/>
</edge>
<edge>
<label x="5" y="-10"/>
</edge>
</node>
<node name="Cancelled" x="610" y="221" width="132" height="36"/>
<node name="End" x="297" y="332" width="132" height="36"/>
</root-container>
/classes directory
Some additional files must be included.
/ui.xml
<?xml version="1.0" encoding="UTF-8"?>
<process>
<tag>${pom.version}</tag>
<roles>
<initiator>
<role name="SEU_ADMIN" />
<role name="SOFFID_ADMIN" />
</initiator>
<supervisor>
<role name="SEU_ADMIN" />
<role name="SOFFID_ADMIN" />
</supervisor>
<observer>
<role name="SEU_ADMIN" />
<role name="SOFFID_ADMIN" />
</observer>
</roles>
<task name="Select business units">
<file path="ui/recertificateBUform.zul" />
</task>
<upgrade>
<process>
<tag>${project.version}</tag>
</process>
</upgrade>
</process>