예제 #1
0
 /**
  * @param CollectData $collectData
  * @param TaskListPosition $taskListPosition
  * @param WorkflowEngine $workflowEngine
  * @param WorkflowMessage $previousMessage
  */
 protected function performCollectData(CollectData $collectData, TaskListPosition $taskListPosition, WorkflowEngine $workflowEngine, WorkflowMessage $previousMessage = null)
 {
     $metadata = $collectData->metadata();
     if (!is_null($previousMessage)) {
         $metadata = ArrayUtils::merge($previousMessage->metadata(), $collectData->metadata());
     }
     $workflowMessage = WorkflowMessage::collectDataOf($collectData->prototype(), $this->taskList->taskListId()->nodeName(), $collectData->source(), $metadata);
     $workflowMessage->connectToProcessTask($taskListPosition);
     try {
         $workflowEngine->dispatch($workflowMessage);
     } catch (CommandDispatchException $ex) {
         $this->receiveMessage(LogMessage::logException($ex->getPrevious(), $workflowMessage), $workflowEngine);
     } catch (\Exception $ex) {
         $this->receiveMessage(LogMessage::logException($ex, $workflowMessage), $workflowEngine);
     }
 }