jbpmredhat-bpm

Dynamically set called element in reusable sub-process in jbpm 6.5.0


I'm trying to use the "reusable sub-process" activity in the workbench bpmn editor (jbpm 6.5.0).

I have defined two sub-process and I would dynamically set the "called element" parameter: the called sub-process depends on some main process inputs.

So, I set a variable in a script task (invoked before the "reusable sub-process" activity), with the following code: kcontext.setVariable("processId", "processX");.

In the "reusable sub-process" I set the "called element" parameter to #{processId} but it doesn't work (the engine couldn't resolve the expression #{processId}).

Is there a way to get the value of the variable processId in the "called element" parameter?


Solution

  • Make sure to also define "processId" as a variable in your process using the variables property of the process (this is needed so the engine knows where to store / find the variable). Once you do that, using #{processId} should work.