eventMessagePayload.setTriggerTracingTag(triggerActivityTracingTag);
mainProcessDefinition.fireMessage("event", mainProcessInstance, eventMessagePayload);
//get the initiated sub process instance
EventHandler[] ehs = getEventHandlersInAction(mainInstanceId);
EventHandler theEventHandler = null;
for(int i=0; i<ehs.length; i++){
if(ehs[i].getName().equals(eventName)){
theEventHandler = ehs[i];
break;
}
}
Activity handlerActivity = theEventHandler.getHandlerActivity();
HumanActivity humanActivity = null;
if(handlerActivity instanceof SubProcessActivity){
SubProcessActivity subProcessActivity = (SubProcessActivity)theEventHandler.getHandlerActivity();
Vector idVt = subProcessActivity.getSubprocessIds(mainProcessInstance);
String subInstanceId = (String)idVt.get(0);
ProcessInstance subProcessInstance = getInstance(subInstanceId);