mirror of https://github.com/MISP/MISP
new: [workflowMouldes:stop-execution] Added message paramter to allow user to provide a reason why the execution was stopped
parent
a0b92e4c7b
commit
a9be1561e1
|
@ -6,6 +6,7 @@ class Module_stop_execution extends WorkflowBaseActionModule
|
|||
public $blocking = true;
|
||||
public $id = 'stop-execution';
|
||||
public $name = 'Stop execution';
|
||||
public $version = '0.2';
|
||||
public $description = 'Essentially stops the execution for blocking workflows. Do nothing for non-blocking ones';
|
||||
public $icon = 'ban';
|
||||
public $inputs = 1;
|
||||
|
@ -15,12 +16,25 @@ class Module_stop_execution extends WorkflowBaseActionModule
|
|||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->params = [
|
||||
[
|
||||
'id' => 'message',
|
||||
'label' => 'Stop message',
|
||||
'type' => 'input',
|
||||
'default' => __('Execution stopped'),
|
||||
'placeholder' => __('Execution stopped'),
|
||||
'jinja_supported' => true,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function exec(array $node, WorkflowRoamingData $roamingData, array &$errors = []): bool
|
||||
{
|
||||
parent::exec($node, $roamingData, $errors);
|
||||
$errors[] = __('Execution stopped');
|
||||
$rData = $roamingData->getData();
|
||||
$params = $this->getParamsWithValues($node, $rData);
|
||||
$errors[] = empty($params['message']['value']) ? $params['message']['default'] : $params['message']['value'];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue