This integration with rules and processes is a first important step to facilitate all aspects of Business Process Management (BPM) into jBPM. From a runtime engine perspective, we'll be expanding further in this direction to cover all artefact types that are involved automating business processes to for example services. On the other hand, we'll also be expanding towards linking these BPM related artefacts to the business users. More on that topic soon.
The rules deployer is a convenience integration between jBPM and Drools. It allows for unified deployment of processes, rules together with forms and other process resources in a .bar business archive. jBPM creates a KnowledgeBase based on all .drl files that are included in a business archive deployment. Activities like the rules and rules-decision leverage this KnowledgeBase.
A rules-decision will take a single outgoing transition based on the evaluation of rules. Let's first look at a rules-decision example process:
This is the RulesDecision jPDL process file (click to enlarge) :
Now all you have to do is deploy the following .drl file together with the process in a .bar business archive and deploy it to jBPM (click to enlarge)
For your convenience, the process variables are made available as global variables in the rules. Then you can start a new process instance with jBPM like this (click to enlarge):
And your rules will be used to evaluate which outgoing transition will be taken in the process execution. Voila. That's all there is to it.
Similarly, a rules activity will evaluate rules, allowing them to update process variables or perform other actions. Let's look at a rules example process:
The Rules jPDL process file looks like this (click to enlarge):
Imagine a process variable of type Room (click to enlarge)
And a rule like this (click to enlarge)
Then starting a new process instance like this (click to enlarge):
will execute the activity, evaluate the rule and update the room process variable.