public function handleTask(&$context) { if ($this->getWorkflow()->isSubWorkflow()) { $this->addStat('RequestValue Task in SubWorkflow currently not supported!'); return 'yes'; } $blockKey = 'block_' . $this->getBlockId(); if (!$this->getWorkflow()->hasRequestValues($blockKey)) { $export = $this->_formgenerator->exportUserQueue($this->_settings, $context); if ($this->get('pausable') == -1) { $pausable = true; } else { $pausable = $this->get('pausable') == '1'; } if ($this->get('stoppable') == -1) { $stoppable = false; } else { $stoppable = $this->get('stoppable') == '1'; } $this->getWorkflow()->requestValues($blockKey, $export, $this, $this->get('message', $context), $context, $stoppable, $pausable); return false; } $this->getWorkflow()->resetRequestValueKey($blockKey); return "yes"; }
/** * @param $context \Workflow\VTEntity * @return array|string */ public function handleTask(&$context) { if ($this->get("start") == "asynchron" && !$this->isContinued()) { return array("delay" => time() + 1, "checkmode" => "static"); } $workflowSettings = $this->getWorkflow()->getSettings(); if (!empty($workflowSettings["startfields"])) { if ($this->getWorkflow()->isSubWorkflow()) { $this->addStat('RequestValue Task in SubWorkflow currently not supported!'); return 'start'; } if (!$this->getWorkflow()->hasRequestValues('startfields')) { $export = $this->_formgenerator->exportUserQueue($this->_settings, $context); $this->getWorkflow()->requestValues('startfields', $export, $this, getTranslatedString('LBL_ENTER_VALUES_TO_START', 'Workflow2'), $context, true, false); return false; } } $startvalues = $context->getEnvironment("value"); if ($startvalues !== false) { $this->addStat("requested values:"); foreach ($startvalues as $key => $value) { $this->addStat("'" . $key . "' = '" . $value . "'"); } } return "start"; }