示例#1
0
 /**
  * @param TaskListPosition $parentTaskListPosition
  * @param NodeName $nodeName
  * @param Task[] $tasks
  * @param array $config
  * @param bool $syncLogMessages
  * @throws \InvalidArgumentException
  * @return static
  */
 public static function setUpAsSubProcess(TaskListPosition $parentTaskListPosition, NodeName $nodeName, array $tasks, array $config = array(), $syncLogMessages = true)
 {
     /** @var $instance Process */
     $instance = new static();
     $instance->assertConfig($config);
     $processId = ProcessId::generate();
     $taskList = TaskList::scheduleTasks(TaskListId::linkWith($nodeName, $processId), $tasks);
     if (!is_bool($syncLogMessages)) {
         throw new \InvalidArgumentException("Argument syncLogMessages must be of type boolean");
     }
     $instance->recordThat(ProcessWasSetUp::asSubProcess($processId, $parentTaskListPosition, $taskList, $config, $syncLogMessages));
     return $instance;
 }
示例#2
0
 /**
  * @return TaskList
  */
 protected function getTestTaskList()
 {
     $task1 = CollectData::from('crm', UserDictionary::prototype());
     $task2 = CollectData::from('online-shop', UserDictionary::prototype());
     $task3 = CollectData::from('address-book', UserDictionary::prototype());
     $processId = ProcessId::generate();
     $taskListId = TaskListId::linkWith(NodeName::defaultName(), $processId);
     return TaskList::scheduleTasks($taskListId, [$task1, $task2, $task3]);
 }