Unable to retrieve business key after invoking call activity

Hello,

I have a process which is made of of various call activities. The idea is that an outer scheduler starts up an instance of the BPML diagram and based on the variable passed, it takes one of 4 routes. I’ve added a TaskListener to be invoked when tasks are created. The problem is that when I invoke the CallActivity and the first task within that process is hit:

 String businessKey = (String) taskDelegate.getVariable(BUSINESS_KEY) is null 
 and   taskDelegate.getExecution().getProcessBusinessKey() is also null.

I invoke the main process with the following:

ProcessInstance newProcess = runtimeService.startProcessInstanceByKey(constants.PROCESS_NAME, obj.getBusinessKey(), properties);

So, my main problem is how do I get the business key after using a call activity within a task listener?

Have you ticked the Business Key box?

1 Like

Doh! This indeed was not set on any of the call activities. I checked that box and all is well. I think I was looking at the problem for too long and couldn’t see the forest for the trees.

1 Like

Happens to the best of us :slight_smile:
Glad you can move forward now!