public void dispatchToEngine(IntegrationMessage integrationMessage, Map<String, Object> metaData) {
// get the actor to send the integration message to
String targetNodeActorString = uniqueFlowNodeIdToActorRefMap
.get(integrationMessage.getUniqueFlowNodeId());
ActorRef targetNodeActor = this.actorSystem
.actorFor("user/" + targetNodeActorString);
// create the integration message
TriggerMessage triggerMessage = new TriggerMessage(
integrationMessage.getProcessInstanceId(),
integrationMessage.getPayload());
LOG.debug("Message Dispatcher sending trigger message to " + targetNodeActor);
// send the integration message to the actor
targetNodeActor.tell(triggerMessage, null);
// send the meta data to the meta data actor (if it is not a start event, which can not collect meta data)
if (integrationMessage.getProcessInstanceId() != null) {
MetaDataMessage metaDataMessage = new MetaDataMessage(integrationMessage.getProcessId(), integrationMessage.getProcessInstanceId(), metaData);