- jBPM5 - Example
- Draw & Validate a Workflow
- jBPM5 - Workflow Components
- jBPM5 - Components
- jBPM5 - Hello World!
- jBPM5 - Eclipse Plugin
- jBPM5 - Overview
- jBPM5 - Home
jBPM5 Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
jBPM5 - Draw & Vapdate a Workflow
To draw a workflow, you can use any of the components available in the palette as described in above article. All the workflow will have one start but it can have multiple end.
With the help of screenshots, I will depict you how to create a workflow.
Here, I’ve opened the blank rf or bpmn file
To add any event, select the particular event from Components Palette and drag and drop to right hand side. For example, I selected the start event and dragged it to right hand side and also a spanerge gateway.
Now, one needs to connect the two components. Select the Sequence flow and connect the two components.
This way you can drag the components to the editor and use the sequence flow to join the different components. One just needs to take care that some components will have one incoming and one outgoing connection only and needs to set the sequence flow accordingly to create a meaningful flow.
One needs to set some properties as well while we draw the workflow. Will post all the properties to set here. I have just created a flow but it won t be very meaningful to look at it at first instant as I haven t set any properties in the workflow created.
As you can see above, it s a blank workflow without any description as such and one cannot make out anything from the workflow created.
However, to explain further, I have a start component and then a spanerge gateway and depending on the condition of the spanerge gateway, I will choose one way and execute some code in the script task and then end the workflow. So I need to set properties for the spanerge gateway, then the script task and the converge gateway.
At this stage i will also show you that my workflow has some errors and later will show you once I set the properties there would be no errors in my workflow, Hence showing you how to VALIDATE the workflow created.
Tip − Remember that vapdator s are on under Windows → Preferences → Vapdation
Below screenshot shows the settings in ecppse.
As per the screenshot, you can see that there are 4 errors. The first error says script has no action and then another error is the gateway s defined have no type defined. Hence, we need to remove these errors to be able to run the workflow.
We will now set properties one by one and see the errors fading away.
Select the first gateway(spanerge) and cpck on properties, then cpck on type and select the gate as per your requirement.
Once you have selected the gateway then you need to select a constraint.
Cpck on the circle marked red, you will see below screenshot
Cpck on edit and fill the details as per the screenshot −
Cpck on Import and import the class on which we would be performing any operation. In the screenshot, we have imported passenger POJO which we will be using in our example.
Similarly, fill the details for another constraint −
Now, cpck the OK button.
Again cpck OK. Now, select the script task and do the same process as you did for spanerge gateway.
We have just added a SOP (print statement) to show the flow. Any java or mvel code can be written in the script task.
Similarly add the code for second constraint −
Finally, you need to add the gateway type for the spanerge gateway.
Now, save the workflow file and go to problems view. All the problems will be resolved.
No errors in the problem view suggests that, there is no error in the workflow created. This is how a workflow is created as well as vapdated in jBPM.
Advertisements