public static function setUp(NodeName $nodeName, array $tasks, array $config = array())
    {
        /** @var $instance Process */
        $instance = new static();

        $instance->assertConfig($config);

        $processId = ProcessId::generate();

        $taskList = TaskList::scheduleTasks(TaskListId::linkWith($nodeName, $processId), $tasks);

        $instance->recordThat(ProcessWasSetUp::with($processId, $taskList, $config));

        return $instance;
    }
public static function setUp(NodeName $nodeName, array $tasks, array $config = array())
    {
        /** @var $instance Process */
        $instance = new static();

        $instance->assertConfig($config);

        $processId = ProcessId::generate();

        $taskList = TaskList::scheduleTasks(TaskListId::linkWith($nodeName, $processId), $tasks);

        $instance->recordThat(ProcessWasSetUp::with($processId, $taskList, $config));

        return $instance;
    }
public static function setUp ( NodeName $ nodeName , array $ tasks , array $ config = array ( ) ) { /** @var $instance Process */ $ instance = new static ( ) ; $ instance -> assertConfig ( $ config ) ; $ processId = ProcessId :: generate ( ) ; $ taskList = TaskList :: scheduleTasks ( TaskListId :: linkWith ( $ nodeName , $ processId ) , $ tasks ) ; $ instance -> recordThat ( ProcessWasSetUp :: with ( $ processId , $ taskList , $ config ) ) ; return $ instance ; }
Creates new process from given tasks and config

@param NodeName $nodeName
@param Task[] $tasks
@param array $config
@return static
Creates new process from given tasks and config