Search code examples
bpmncamunda

BPMN model API to edit Process diagram


I have a process diagram that directs flow on the basis of threshold variables. For example, for variable x,y; if x<50 I am directed to service task 1 , if y<40 to service task 2, or if x>50 && y>40 to some task.. As intuition tells, I am using compare checks on sequence flow to determine next task.

x,y are input by user but 50, 40 (Let's call these numbers {n}) is a part of process definition(PD).

Now, for a fixed {n} I have deployed a process diagram and it runs successfully.

What should I do if my {n} can vary for different process instances? Is there a way to maintain the same version of process definition but which takes {n} dynamically?

I read about BPMN Model API here. But, I can't seem to figure out how to use it to edit my PD dynamically? Do I need to redeploy it each time on Tomcat or how does it work?


Solution

  • If you change a process model with the model API you have to redeploy it to actually use it. If you want to have a process definition with variable {n} values you can also use a variable for it and set it during the start of the process instance either using the Java API, REST API or the Tasklist.