if (we.getType() == JobType.MEX_MATCHER && routed) {
mex.getDAO().releasePremieMessages();
}
} else {
// Instance level events
ProcessInstanceDAO procInstance = getProcessDAO().getInstance(we.getInstanceId());
if (procInstance == null) {
if (__log.isDebugEnabled()) {
__log.debug("handleJobDetails: no ProcessInstance found with iid " + we.getInstanceId() + "; ignoring.");
}
return true;
}
BpelRuntimeContextImpl processInstance = createRuntimeContext(procInstance, null, null);
switch (we.getType()) {
case TIMER:
if (__log.isDebugEnabled()) {
__log.debug("handleJobDetails: TimerWork event for process instance " + processInstance);
}
processInstance.timerEvent(we.getChannel());
break;
case RESUME:
if (__log.isDebugEnabled()) {
__log.debug("handleJobDetails: ResumeWork event for iid " + we.getInstanceId());
}
processInstance.execute();
break;
case INVOKE_RESPONSE:
if (__log.isDebugEnabled()) {
__log.debug("InvokeResponse event for iid " + we.getInstanceId());
}
processInstance.invocationResponse(we.getMexId(), we.getChannel());
processInstance.execute();
break;
case MATCHER:
if (__log.isDebugEnabled()) {
__log.debug("Matcher event for iid " + we.getInstanceId());
}
if( procInstance.getState() == ProcessState.STATE_COMPLETED_OK
|| procInstance.getState() == ProcessState.STATE_COMPLETED_WITH_FAULT ) {
__log.debug("A matcher event was aborted. The process is already completed.");
return true;
}
processInstance.matcherEvent(we.getCorrelatorId(), we.getCorrelationKeySet());
}