0

I have a process in drools with a process variable that gets set. I would like to be able to dynamically change what ruleflowgroup gets called based on the variable.

I have tried setting the ruleflowgroup to #{ruleFlowGroupName} but the rules never activate.

I have a script task right before the ruleflow group that prints out the value of the variable and it is correct.

I have done this before with a reconfigurable subprocess where the process id is a process variable and the process dynamically gets replaced when the main process runs.

I was hoping to be able to do this with specifying the ruleflowgroup too.

any ideas?

strickon
  • 1
  • 1

2 Answers2

0

What is the business objective of doing that? if you have two different set of rules that evaluate different data depending on what you are inserting inside the drools engine, there is no need to have two different rule flow groups. Only the relevant rules will be activated. Cheers

salaboy
  • 4,123
  • 1
  • 14
  • 15
  • By having it set of rules in the dynamic subprocess, the rules can be simpler. Right now each subprocess executes a set of rules in a ruleflow group, controlling activation. I could have one large ruleflow group and add an additional clause that would test a process variable. For larger sets of rules, this may become cumbersome, thus putting a smaller set in a ruleflow group with a different name and swapping ruleflow groups is much simpler. Right now I just swap subprocesses, but if I could dynamically change the ruleflowgroup, I could use the same subprocesss. – strickon Feb 24 '12 at 19:49
0

It is indeed true that a dynamic ruleflowgroup name is currently not supported. I've created a JIRA for this so we can track this and you can keep updated on any progress.

https://issues.jboss.org/browse/JBPM-3552

It would indeed be useful to describe the situation where you think this might be useful, as there may be alternatives / workarounds already.

Kris Verlaenen
  • 2,918
  • 1
  • 15
  • 5
  • I have a subprocess that is dynamically swapped out based on a ruleflow group prior to the subprocess. Each subprocess is identical. It is basically some script tasks and ruleflow groups. Right now I have a .drl and .rf for the rules and flow associated with each subprocess. If I could dynamically change the name of the ruleflow group, I would no longer need to keep the .rf files and just have one generic one that can be used. – strickon Feb 24 '12 at 19:40
  • On JIRA this is indicated as resolved. Are you aware of any documentation or examples available? – mapto Mar 15 '21 at 09:16