Hi @Phillipp_Ossler,
thanks for your answer, I found it useful. In our project, each ServiceTask represents a async microservice and we use the Task-Id to identify each request.
In the execute phase of the Activity, we send a message to an ActiveMQ queue and expect a response in a limited time. If there is no response within a set time (response trigger signal event) we want to trigger a Timeout event (BoundaryEvent in that case) in order to know which request was failed.
I’m sorry, I need the Activity-Id, not the Activity-Instance-Id. Finally I’m doing something like this. I don’t know if that’s the best way but it works.
public void notify(DelegateExecution delegateExecution) {
ExecutionEntity executionEntity = (ExecutionEntity) delegateExecution;
Job jobTimer = processEngine.getManagementService()
.createJobQuery()
.processInstanceId(executionEntity.getProcessInstanceId())
.activityId(executionEntity.getCurrentActivityId())
.singleResult();
String activityInstanceId = job.getExecutionId();
String activityId = processEngine.getRuntimeService().getActiveActivityIds(activityInstanceId).get(0);
// controlCenterService.warn(activityId, "Timeout exceeded");
}
Regards