/**
  * @param WorkflowId $workflowId
  * @param Process $process
  * @param Task $task
  * @return TaskWasAddedToProcess
  */
 public static function record(WorkflowId $workflowId, Process $process, Task $task)
 {
     $event = self::occur($workflowId->toString(), ['process_id' => $process->id()->toString(), 'task_id' => $task->id()->toString()]);
     $event->workflowId = $workflowId;
     $event->processId = $process->id();
     $event->taskId = $task->id();
     return $event;
 }
Пример #2
0
 /**
  * @return string representation of the unique identifier of the aggregate root
  */
 protected function aggregateId()
 {
     return $this->workflowId->toString();
 }
 /**
  * @param WorkflowId $workflowId
  * @param int $releasedVersion
  * @param int $releaseNumber
  * @return WorkflowWasReleased
  */
 public static function withVersion(WorkflowId $workflowId, $releasedVersion, $releaseNumber)
 {
     return self::occur($workflowId->toString(), ['released_version' => $releasedVersion, 'release_number' => $releaseNumber]);
 }
 /**
  * @param WorkflowId $workflowId
  * @param string $oldName
  * @param string $newName
  * @return WorkflowNameWasChanged
  */
 public static function record(WorkflowId $workflowId, $oldName, $newName)
 {
     $event = self::occur($workflowId->toString(), ['old_name' => $oldName, 'new_name' => $newName]);
     $event->workflowId = $workflowId;
     return $event;
 }
Пример #5
0
 /**
  * @param WorkflowId $other
  * @return bool
  */
 public function equals(WorkflowId $other)
 {
     return $this->toString() === $other->toString();
 }
 /**
  * @param WorkflowId $workflowId
  * @return WorkflowNotFound
  */
 public static function withId(WorkflowId $workflowId)
 {
     return new self(sprintf('Workflow with id %s could not be found', $workflowId->toString()));
 }
 /**
  * @param NodeName $nodeName
  * @param WorkflowId $workflowId
  * @param $workflowName
  * @return WorkflowWasCreated
  */
 public static function on(NodeName $nodeName, WorkflowId $workflowId, $workflowName)
 {
     return self::occur($workflowId->toString(), ['processing_node_name' => $nodeName->toString(), 'workflow_name' => $workflowName]);
 }
 /**
  * @param WorkflowId $workflowId
  * @return Workflow
  */
 public function get(WorkflowId $workflowId)
 {
     return $this->getAggregateRoot($workflowId->toString());
 }