Hello, my team has the need to track all the “Receive Tasks” we have in our processes. We noticed that the Java API doesn’t expose any “taskId” and that these seem to be reserved to user tasks. The closest thing we found to a unique Id was the “ActivityInstanceId”, but it looks like it appends the task name to a UUID. Is there any guarantee that these UUIDs are unique across tasks? Or is there any other way we could get an ID for each task that has been completed?
We have an execution listener setup to try to capture any “receiveTask” that has been completed:
@Override
public void parseReceiveTask(Element receiveTaskElement, ScopeImpl scope, ActivityImpl activity) {
activity.addBuiltInListener(PvmEvent.EVENTNAME_START, new ReceiveTaskCompletedListener(messageProducer));
}
public class ReceiveTaskCompletedListener implements ExecutionListener {
public ReceiveTaskCompletedListener(MessageProducer messageProducer) {
this.messageProducer = messageProducer;
}
@Override
public void notify(DelegateExecution execution) throws Exception {
execution.[**some get API here to get a Unique ID for the task that was just completed***]
}
}