Modeling
- Download and open the jPDLSample.vpp attached with this tutorial.
- Open the business process diagram BookStore.

- Right click on the background of the diagram and select jPDL Diagram from the popup menu.

To construct a business process. There are several main components: Process, Participant, and Task.
Let's go through them one by one.
Process
Process represents the business process.
(Note: In VP-UML, Pool represents Process.)
It contains the Tasks, Transitions, etc.... Normally, no process details need be specified for jPDL.
Participant
Participant represents the user of the business process.
(Note: In VP-UML, Lane represents Participant)
The users are defined in database. You are required to set the same name in
Lane and
User.
(Note: For more details about defining user in database, please read the section: Prepare jBPM jPDL database)
Same as process, no participant details need be specified for jPDL besides the participant name.
Task
Task means a job need be handled. If the task is
User Task or
Manual Task. The task need be started and completed by user. Otherwise, it will be completed automatically.
- Right click on the task Place Order and select Type > User Task from the popup menu.

- Right click on the task Verify Store and select Type > Manual Task from the popup menu.

- Repeat step 2 to set task Random Survey to be Manual Task.
Name All Components
For jPDL, all components insides the process need be named. And not allow duplicated name between the components.
(Note: If no name, a default name Unnamed{N} will be assigned to the component. If the name is duplicated. The {N} will be appended into the component, where the {N} is a sequence number.)
- Select the start event. Press F2 to start editing its name. Enter Start as its name.

-
Select the outgoing sequence flow exhibiting from event. Press F2 to start editing its name.
Enter to Place Order as its name.
The business process diagram is modified for jPDL.
Generate jPDL
- Right click on the diagram's background and select Utilities > Generate jPDL... from the popup menu.

-
Enter the Folder and click OK. The output files are generated. They includes:
BookStore.zip (Deployable process archive)
gpd.xml (Graphical process definition)
processdefinition.xml (Process definition)
processimage.jpg (Process image)
Install jBPM jPDL
- Prepare jBPM jPDL 3.2. May be downloaded from http://www.jboss.org/downloading/?projectId=jbossjbpm&url=http://downloads.sourceforge.net/jbpm/jbpm-installer-3.2.6.SP1.jar
- Prepare JBoss 5.0.0 GA. May be downloaded from http://www.jboss.org/downloading/?projectId=jbossas&url=https://sourceforge.net/project/showfiles.php?group_id=22866&package_id=16942&release_id=645033
- Prepare Java and MySQL.
- Execute java -jar jbpm-installer-3.2.b.SP1.jar to start installing the jBPM jPDL.

- Select installation path. Click Next to next page.
- Select jBPM3 JBoss Integration. Click Next to next page.

- Select JBoss-5.0.0, and enter default in Server. Click Next to next page.

- Select MySQL as target database. Click Next to next page.

- Select the JBoss-5.0.0 in JBoss Home. Click Next until installation completed.
Prepare jBPM jPDL database
- Login to MySQL as root.
- Create database jbpmtest.
- Execute the script file in $jPDL_INSTALLATION/database/jbpm.jpdl.mysql.sql.
-
Execute the following scripts to create the testing data. (Note: the Users (Participants) are created in the following scripts.)
INSERT INTO JBPM_ID_GROUP VALUES (1,'G','sales','organisation',NULL);
INSERT INTO JBPM_ID_GROUP VALUES (2,'G','admin','security-role',NULL);
INSERT INTO JBPM_ID_GROUP VALUES (3,'G','user','security-role',NULL);
INSERT INTO JBPM_ID_GROUP VALUES (4,'G','hr','organisation',NULL);
INSERT INTO JBPM_ID_GROUP VALUES (5,'G','manager','security-role',NULL);
INSERT INTO JBPM_ID_USER VALUES (1,'U','user','user at sample.domain','user');
INSERT INTO JBPM_ID_USER VALUES (2,'U','manager','manager at sample.domain','manager');
INSERT INTO JBPM_ID_USER VALUES (3,'U','admin','admin at sample.domain','admin');
INSERT INTO JBPM_ID_USER VALUES (4,'U','shipper','shipper at sample.domain','shipper');
INSERT INTO JBPM_ID_MEMBERSHIP VALUES (1,'M',NULL,NULL,2,4);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES (2,'M',NULL,NULL,3,4);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES (3,'M',NULL,NULL,4,4);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES (4,'M',NULL,NULL,4,3);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES (5,'M',NULL,NULL,1,3);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES (6,'M',NULL,NULL,2,3);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES (7,'M',NULL,NULL,3,3);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES (8,'M',NULL,NULL,3,2);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES (9,'M',NULL,NULL,2,2);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES (10,'M',NULL,NULL,2,5);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES (11,'M',NULL,'boss',2,1);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES (12,'M',NULL,NULL,1,1);
- Create database user jbpmtest. Allow this user to have all privileges for database jbpmtest.
Deploy jPDL process
- Execute $jPDL_INSTALLATION/bin/run.bat to launch jBPM jPDL.
- Start a web browser and visit http://localhost:8080/jbpm-console.
- Login as manager with User Name manager, Password manager.

- Click the Deploy link to start deployment.

- Select the generated BookStore.zip and click Deploy to confirm deploy this process.

- Process is deployed. You can see its summary in Process Summary.

- You also can click the Process Image link to show the business process diagram you drawn in VP-UML.

Execute process
-
Login as user with User name user, Password user.
(Note: After login, BookStore's summary should be shown automatically since there is only 1 process is deployed. If not, please click the Processes link to show a list of processes. Then click Examine link of BookStore to select BookStore.)
- Click the Start link to create the process instance.

- The process is started. A list of tasks is shown. However, there is no task in the list. Because the flow is hold on Start Event. Click the Tokens link to show a list of tokens.

- Click the Signal : toPlaceOrder link to trigger Place Order task.

- Click the Task link to show a list of tasks.

- The PlaceOrder is shown on the list. its status is Not Started. Click the Start link to start the task.

- After the task is started. its status becomes Running. Assumes user have done the task. Click the End : toFork link to complete the task and trigger to Fork.

- There are 3 tasks connected from Fork. The Nothing task is a normal task, it will be started and completed automatically. So, you see there are only 2 tasks shown on the list after Place Order is completed.

- Login as shipper and admin and repeat the above steps to start and complete the tasks Verify Store and Random Survey.
- After the tasks are completed. The status of process instance is Ended.

Resources
- BookStore.zip
- jPDLSample (before jPDL).vpp
- jPDLSample (after jPDL).vpp
Comments (6)
written by cmjhingeniero on February 20, 2010
The integration is only with the jBPM-3.2 version or you can use with jBPM-4.2???
written by Lilian Wong on March 12, 2010
I'm sorry that during our implementation, only 3.x have web-client. Therefore, we support 3.x rather than 4.x.
written by Brian on July 19, 2010
We are working on a project to use JBPM 4.2, and we will implement our own web client.
Do you have any plan to support JBPM 4.x? Is yes, what is the schedule?
written by Furgas on February 4, 2011
Hello,
I'm also interested in exporting to jBPM 4 (hey, jBPM 5 is around the corner...). What's the status of this issue?
written by Jick Yeung on February 8, 2011
Hi Furgas,
Thank you for your post. We will consider your request. If we decide to move on to jBPM 4 or 5, I will let you know.
Best regards,
Jick Yeung
written by A.S. on April 26, 2011
We´re also interested in exporting to jBPM 4 !!! It would be great.