protected function setUp() { parent::setUp(); $eventBus = new EventBus(); $commandBus = new CommandBus(); $commandRouter = new CommandRouter(); $commandRouter->route(StartSubProcess::MSG_NAME)->to(function (StartSubProcess $command) { $this->receivedMessage = $command; }); $commandRouter->route('processing-message-proophprocessingtestmockuserdictionary-collect-data')->to(function (WorkflowMessage $message) { $this->receivedMessage = $message; }); $commandBus->utilize($commandRouter); $commandBus->utilize(new ToProcessingMessageTranslator()); $commandBus->utilize(new CallbackStrategy()); $eventRouter = new EventRouter(); $eventRouter->route('processing-message-proophprocessingtestmockuserdictionary-data-collected')->to(function (WorkflowMessage $workflowMessage) { $this->receivedMessage = $workflowMessage; }); $eventRouter->route('processing-log-message')->to(function (LogMessage $logMessage) { $this->receivedMessage = $logMessage; }); $eventRouter->route(SubProcessFinished::MSG_NAME)->to(function (SubProcessFinished $event) { $this->receivedMessage = $event; }); $eventBus->utilize($eventRouter); $eventBus->utilize(new ToProcessingMessageTranslator()); $eventBus->utilize(new CallbackStrategy()); $this->workflowEngine = new RegistryWorkflowEngine(); $this->workflowEngine->registerCommandBus($commandBus, [NodeName::defaultName()->toString(), 'test-target', 'sub-processor']); $this->workflowEngine->registerEventBus($eventBus, [NodeName::defaultName()->toString()]); }
protected function setUp() { parent::setUp(); $eventBus = new EventBus(); $commandBus = new CommandBus(); $this->messageDispatcher = new InMemoryRemoteMessageDispatcher($commandBus, $eventBus); $commandRouter = new CommandRouter(); $commandRouter->route(StartSubProcess::MSG_NAME)->to(function (StartSubProcess $command) { $this->receivedMessage = $command; }); $commandBus->utilize($commandRouter); $commandBus->utilize(new ToProcessingMessageTranslator()); $commandBus->utilize(new CallbackStrategy()); $eventRouter = new EventRouter(); $eventRouter->route('processing-message-proophprocessingtestmockuserdictionary-data-collected')->to(function (WorkflowMessage $workflowMessage) { $this->receivedMessage = $workflowMessage; }); $eventRouter->route('processing-log-message')->to(function (LogMessage $logMessage) { $this->receivedMessage = $logMessage; }); $eventRouter->route(SubProcessFinished::MSG_NAME)->to(function (SubProcessFinished $event) { $this->receivedMessage = $event; }); $eventBus->utilize($eventRouter); $eventBus->utilize(new ToProcessingMessageTranslator()); $eventBus->utilize(new CallbackStrategy()); }
protected function tearDown() { parent::tearDownTestEnvironment(); }
public function dataProviderTargetListeners() { parent::setUpLocalMachine(); return [[$this->getTestWorkflowProcessor()], [new TestWorkflowMessageHandler()], [new InMemoryRemoteMessageDispatcher(new CommandBus(), new EventBus())], ["processing.workflow_processor_alias"]]; }