cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically Create CallActivity

mwooten1111
Champ in-the-making
Champ in-the-making
All,

I'm trying to come up with a solution for dynamically calling another process as a subtask.

Example:
P1: T1 -> T2 -> T3
P2: T4 -> T5
P3: T6 -> T7

At task T2 the user will need either start process P2,  P3, or maybe one of each. Task T2 should not complete until all of those subprocesses are completed. The key here is which process to run will not be known until the user selects it from a dynamic list.  From the documentation I have seen, it sounds like CallActivity is the approach used to start a subprocess. I have not been able to figure out how to create and execute a CallActivity from the Java API.

Are there any examples of dynamically creating a CallActivity as a subprocess with a dynamic called element? Is this even possible?

Thanks in advance.

-Michael
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Michael,

Are there any examples of dynamically creating a CallActivity as a subprocess with a dynamic called element?
This feature is planned for activiti 6. To dynamically change process definition of currently running process  instance in activiti 5 is not so straight forward, but possible. (I think you do not need dynamic process definition change.)

At task T2 the user will need either start process P2, P3, or maybe one of each.
use  Inclusive Gateway (examples: org.activiti.examples.bpmn.gateway.InclusiveGatewayTest)

Task T2 should not complete until all of those subprocesses are completed.
Check whether inclusive gateway is wait state or not (more info: http://activiti.org/userguide/index.html#bpmnConcurrencyAndTransactions)

I have not been able to figure out how to create and execute a CallActivity from the Java API.
example:
I do not understand the need,  but have a look on org.activiti.engine.impl.bpmn.behavior.CallActivityBehavior#execute implementation.

Regards
Martin

Regard