cancel
Showing results for 
Search instead for 
Did you mean: 

Share Rules across deployments in Activiti 5.13

smcardle
Champ in-the-making
Champ in-the-making
Hi All

I would like some clarification regarding the deployment of Rules into the ProcessEngine.

I have several BAR files each containing multiple processes each of which use zero or more Rules.
The deployments run fine and the Rules are executed as expected. All is rosy in the process garden Smiley Happy

Problem……

The Rules that are deployed in each BAR are repeated in each BAR i.e. rules are used by different processes packaged in different BAR's.
I have a common set of Rules that I would like to deploy independently, just once, as independent DRL files, so that the deployed processes in the process BAR's can use any of them……

I don't see a way to do this with Activiti because if I deploy the bpmn's and the drl's independently, or the bpmn's packaged in multiple BAR files without the drl's, then suddenly the processes fail to execute stating that the rules cannot be found in the deployment.

Some of these rules are to be modified by Business Analysts at run time so we will monitor changes to the underlying drl files and redeploy on change detected, thus creating a new version of a rule that will be used by future process executions (not existing executions that may not yet have got to the rule in the currently executing process).

So my question is…..

Am I missing something in Activiti that will allow me to deploy the rules independently of the processes? and if so…. how do I do it ?

Regards

Steve
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
Steve,

Rules are indeed bound to a deployment. This allows isolation of rules/processes in their different versions, keeping the right ones together. If you want to have a "shared" knowledge-base, I suggest you create a custom JavaDelegate. Instead of using a knowledge-base based on deploymentId, you locate it using your own mechanism, exposing the "global" rules.

Take a look at the implementation of org.activiti.engine.impl.bpmn.behavior.BusinessRuleTaskActivityBehavior to make rules work nicely together with the activiti-context.