示例#1
0
 public function get($id)
 {
     $workflow = $this->workflowFinder->find($id);
     if (is_null($workflow)) {
         return $this->apiProblem(404, "Workflow not found");
     }
     return ['workflow' => $workflow];
 }
 public function create($data)
 {
     if (!array_key_exists('workflow_id', $data)) {
         return $this->apiProblem(422, "No workflow_id given for the release");
     }
     $workflowData = $this->workflowFinder->find($data['workflow_id']);
     if (!$workflowData) {
         return $this->apiProblem(404, "Workflow can not be found");
     }
     $newRelease = (int) $workflowData['current_release'];
     $newRelease++;
     $this->commandBus->dispatch(PublishWorkflow::withReleaseNumber($newRelease, $data['workflow_id']));
     return $this->location($this->url()->fromRoute('prooph.link/process_config/api/workflow_release', ['id' => $newRelease]));
 }
 public function startAppAction()
 {
     $workflows = $this->workflowFinder->findAll();
     $viewModel = new ViewModel(['workflows' => $workflows, 'processes' => array_values(Func::map($this->systemConfig->getProcessDefinitions(), function ($definition, $message) {
         return $this->convertToClientProcess($message, $definition, $this->systemConfig->getAllAvailableProcessingTypes());
     })), 'connectors' => array_values(Func::map($this->systemConfig->getConnectors(), function ($connector, $id) {
         $connector['id'] = $id;
         if (!isset($connector['metadata']) || empty($connector['metadata'])) {
             //Force empty object
             $connector['metadata'] = new \stdClass();
         }
         return $connector;
     })), 'available_processing_types' => $this->getProcessingTypesForClient(), 'available_manipulation_scripts' => $this->scriptLocation->getScriptNames(), 'locations' => $this->locationTranslator->getLocations(), 'available_process_types' => [['value' => \Prooph\Processing\Processor\Definition::PROCESS_LINEAR_MESSAGING, 'label' => $this->i18nTranslator->translate('Linear Process')], ['value' => \Prooph\Processing\Processor\Definition::PROCESS_PARALLEL_FOR_EACH, 'label' => $this->i18nTranslator->translate('Foreach Process')]], 'available_task_types' => [['value' => \Prooph\Processing\Processor\Definition::TASK_COLLECT_DATA, 'label' => $this->i18nTranslator->translate('Collect Data')], ['value' => \Prooph\Processing\Processor\Definition::TASK_PROCESS_DATA, 'label' => $this->i18nTranslator->translate('Process Data')], ['value' => \Prooph\Processing\Processor\Definition::TASK_MANIPULATE_PAYLOAD, 'label' => $this->i18nTranslator->translate('Run Manipulation Script')]], 'available_messages' => [['value' => 'collect-data', 'label' => $this->i18nTranslator->translate('Collect Data Message')], ['value' => 'data-collected', 'label' => $this->i18nTranslator->translate('Data Collected Message')], ['value' => 'process-data', 'label' => $this->i18nTranslator->translate('Process Data Message')]]]);
     $viewModel->setTemplate('prooph.link.process-manager/process-manager/app');
     $this->layout()->setVariable('includeRiotJs', true);
     return $viewModel;
 }