コード例 #1
0
ファイル: ForEachProcess.php プロジェクト: prooph/processing
 /**
  * @param LogMessage|WorkflowMessage $message
  * @param WorkflowEngine $workflowEngine
  */
 public function receiveMessage($message, WorkflowEngine $workflowEngine)
 {
     if (!$this->taskList->isStarted()) {
         parent::receiveMessage($message, $workflowEngine);
         return;
     }
     $this->assertTaskEntryExists($message->processTaskListPosition());
     $taskListEntry = $this->taskList->getTaskListEntryAtPosition($message->processTaskListPosition());
     if ($message instanceof WorkflowMessage) {
         if (!MessageNameUtils::isProcessingEvent($message->messageName())) {
             $this->receiveMessage(LogMessage::logWrongMessageReceivedFor($taskListEntry->task(), $taskListEntry->taskListPosition(), $message), $workflowEngine);
             return;
         }
         $this->recordThat(MultiPerformTaskSucceed::at($taskListEntry->taskListPosition()));
     }
     if ($message instanceof LogMessage) {
         $this->recordThat(LogMessageReceived::record($message));
         if ($message->isError()) {
             $this->recordThat(MultiPerformTaskFailed::at($taskListEntry->taskListPosition()));
         }
     }
     $this->checkFinished($taskListEntry);
 }
コード例 #2
0
 private function informParentProcessAboutSubProcess(Process $subProcess, $succeed, $lastAnswerReceivedForSubProcess)
 {
     $event = SubProcessFinished::record($this->nodeName, $subProcess->processId(), $succeed, $lastAnswerReceivedForSubProcess, $subProcess->parentTaskListPosition());
     $this->workflowEngine->dispatch($event);
 }