cancel
Showing results for 
Search instead for 
Did you mean: 

Rule package for two or more processes

jusc
Champ in-the-making
Champ in-the-making
Hi,

I've created different processes in activiti with business rule tasks and it works fine.
But now I want to use the same set of business rules in two different process definitions. Is it possible to deploy a bar file just with a *.drl files and connect both process definitions with this bar file or is there any other possibility?

The advantages of using a rule engine is that I can use the same rules in different relations. I also have features like revision control…
But if I can just use a set of rules in one process definition these advantages are not present anymore.

Thanks for your support Smiley Happy
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
The rules are "deployed" and available in a per-deployment basis. I imagine that adding both your process-definitions in the same bar as the rules-file, will make the rules available in both of your processes.

jusc
Champ in-the-making
Champ in-the-making
Thank you for your immediate reply.

For my Project it's very important that all process are stored in an own bar file. If I would only use one bar file including all available processes and rules, I have to update the whole bar file everytime when change just one process.

Is it possible to store the business rules in a rule repository and activiti is kind of "linked" to this repository?

frederikherema1
Star Contributor
Star Contributor
As rules are added to a KnowledgeBase and kept in the deployment-cache on a per-deployment basis. When a rule-task is executed, a state full knowledge-base is created of this shared one. There is currently no mechanism that supports rules to be shared cross-deployment or system-wide.

I guess the reasoning behind this is quite simple: The rules that go with a process are bundled together. If a developer would update one of the two parts (process or rules) , both resources are deployed again. If another process would use the same rules, deploying a new version of the rules would potentially break the existing process-definition, which is not redeployed and could be using rules that aren't in the new deployment anymore. Also, when existing "processes" are running and a new process/rule-set is deployed, the old processes will keep using the "old" rules, as the new processes will us the rules in the new deployment.

You could always try to alter the behavior of the BusinessRuleTaskActivitybehaviour to include additional KnowledgeBase(s), but this required modifying activiti source-code.