if (processInstanceId == null) {
throw BPMMessages.MESSAGES.cannotSignalEventUnknownProcessInstanceIdOrUnknownunmatchedCorrelationKey();
}
if (ExchangePattern.IN_OUT.equals(exchangePattern)) {
ProcessInstance processInstance = session.getStateful().getProcessInstance(processInstanceId);
processInstance.signalEvent(eventId, eventObject);
expressionVariables.putAll(getGlobalVariables(session));
expressionVariables.putAll(getProcessInstanceVariables(processInstance));
} else {
session.getStateful().signalEvent(eventId, eventObject, processInstanceId);
}