Search code examples
javaprocessbpmncamunda

Camunda BPMN: Dynamically add subprocess


I try to use BPMN with Camunda for automatized deployment of applications. Almost all of the script tasks are the same for every deployment. But a certain part differs a lot from app to app and I would like other developers to throw in their custom BPMN-Model along their app and just dynamically execute it.

So if I tell developers they need to include a BPMN Model named certain way, containing specific information on deployment for their app. Then my BPMN-Model dynamically runs this as a subprocess.

I have googled a fair bit but couldnt find something like this or that somebody has done this. Thank you for any suggestions !


Solution

  • If you use the element "call activity" you can specifiy the called element, which names the subprocess to be started.

    You can use an expression to let some class decide which element to call, simply use ${mySubprocessDecider.whatEverMethodName(execution)} (you are free to name whatever you like) and let whatEverMethod return a string (the key of the called subprocess.