jBPM5 Example - jBPM

how to create a project using jBPM5?

Let’s create an example program using jBPM5. Task at the hand uses jBPM for deciding if a passenger boards a flight or a train based on his income.

Steps for creating the project are same as that of "Hello World" project. Open .rf file in the editor, and see the changes as marked in red


In the above screenshot we have changed ruleflow id (unique) and added a variable income, as we will be deciding the route depending on the income of the passenger.

How to set variable − Select the edit button marked in red.


Click the Add button


Below screen pops up


Put name as income and type as Integer.


Click OK. You will see the income variable defined now.


Changes to be done in ProcessTest.java class (Class to load and run your process)


You should first create a MAP, set a value in MAP and pass this value to the startProcess overloaded method. As explained, we have changed the ruleflow id and hence used the same id (vivek.ruleflow) in the startProcess method.

Before running the ProcessTest.java class, create a POJO Passenger.java in the same package as ProcessTest.java

Now run the ProcessTest.java class as a Java Application and see the output −


Change the value − params.put("income", 900); and re-run the class and see the change in output.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

jBPM Topics