Dynamic delegate call from task

Hi i would like to call java delegate from task but i want it to by dynamic. lets have master process which calls some slave process.


the call activity then calls something like this

in the first process i will set the name of the delegate that shold be called later.Is this possible?
The reason behind this all is that i have multiple processes with the same flow but the delegates do different thinks.There is always startDelegate, processDelegate etc. difference is the name so its startDelegateA, processDelegateA etc and startDelegateB, processDelegateB etc and so on. Its from “A” to “J” so its a lot. I would just change all the names before the activity call,

@FilipGregor you can use expressions in calledElement property in the Call activity.

Hi aravindhrs thank you for your quick response:). Iam afraid that i was not very clear in defining the problem. Here is master and slave process as bpmn filesslave.bpmn (6.2 KB)
master.bpmn (10.0 KB)
And here i will add some pictures :slight_smile: Master process:


This is master flow which does some processing in first ‘prepare data’ activity and it also sests the flag ‘type’ to one value from [a, b, c, d] array. Then based on the flag one ‘process X’ call activity is called. All of them call the same bpmn, this is intentional since the flow in slave flow looks the same for all types.
Then this is slave flow:
as you can see there are several service tastks there. I have created delegate java classes for all of them for yeach type so i have these classes for the first ‘validate Data TypeX 1’ task: ‘validateDataTypeA1’, ‘validateDataTypeB1’, ‘validateDataTypeC1’, ‘validateDataTypeD1’. Now i would like to somehow call different java classes each time i start this slave process so ${validateDataTypeX1} needs to be changed to ${validateDataTypeA1} etc based on the desision in master process. :).

Iam looking for something like callDelegate('validateDataType' + type + '1') instead of ${validateDataTypeX1}