mirror of https://github.com/MISP/MISP
fix: [workflow] Remove leftovers from previous design with [non]blocking paths from triggers
parent
4a26475b14
commit
51fa6fd6d8
|
@ -296,10 +296,6 @@ class WorkflowRoamingData
|
|||
|
||||
class WorkflowGraphTool
|
||||
{
|
||||
|
||||
const GRAPH_BLOCKING_CONNECTION_NAME = 'output_1';
|
||||
const GRAPH_NON_BLOCKING_CONNECTION_NAME = 'output_2';
|
||||
|
||||
/**
|
||||
* extractTriggerFromWorkflow Return the trigger id (or full module) that are specified in the workflow
|
||||
*
|
||||
|
@ -361,28 +357,6 @@ class WorkflowGraphTool
|
|||
return $nodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* triggerHasBlockingPath Return if the provided trigger has an edge leading to a blocking path
|
||||
*
|
||||
* @param array $node
|
||||
* @returns bool
|
||||
*/
|
||||
public static function triggerHasBlockingPath(array $node): bool
|
||||
{
|
||||
return !empty($node['outputs'][WorkflowGraphTool::GRAPH_BLOCKING_CONNECTION_NAME]['connections']);
|
||||
}
|
||||
|
||||
/**
|
||||
* triggerHasBlockingPath Return if the provided trigger has an edge leading to a non-blocking path
|
||||
*
|
||||
* @param array $node
|
||||
* @returns bool
|
||||
*/
|
||||
public static function triggerHasNonBlockingPath(array $node): bool
|
||||
{
|
||||
return !empty($node['outputs'][WorkflowGraphTool::GRAPH_NON_BLOCKING_CONNECTION_NAME]['connections']);
|
||||
}
|
||||
|
||||
/**
|
||||
* isAcyclic Return if the graph contains a cycle
|
||||
*
|
||||
|
|
|
@ -242,13 +242,8 @@ class Workflow extends AppModel
|
|||
if (!empty($trigger_to_add)) {
|
||||
$pipeline = $redis->multi();
|
||||
foreach ($trigger_to_add as $trigger_id) {
|
||||
if (
|
||||
$this->workflowGraphTool->triggerHasNonBlockingPath($new_node_trigger_list_per_id[$trigger_id]) ||
|
||||
$this->workflowGraphTool->triggerHasBlockingPath($new_node_trigger_list_per_id[$trigger_id])
|
||||
) {
|
||||
$pipeline->sAdd(sprintf(Workflow::REDIS_KEY_WORKFLOW_PER_TRIGGER, $trigger_id), $workflow['Workflow']['id']);
|
||||
$pipeline->sAdd(sprintf(Workflow::REDIS_KEY_TRIGGER_PER_WORKFLOW, $workflow['Workflow']['id']), $trigger_id);
|
||||
}
|
||||
$pipeline->sAdd(sprintf(Workflow::REDIS_KEY_WORKFLOW_PER_TRIGGER, $trigger_id), $workflow['Workflow']['id']);
|
||||
$pipeline->sAdd(sprintf(Workflow::REDIS_KEY_TRIGGER_PER_WORKFLOW, $workflow['Workflow']['id']), $trigger_id);
|
||||
}
|
||||
$pipeline->exec();
|
||||
}
|
||||
|
@ -1114,7 +1109,11 @@ class Workflow extends AppModel
|
|||
'data' => $module_config,
|
||||
'id' => 1,
|
||||
'inputs' => [],
|
||||
'outputs' => [],
|
||||
'outputs' => [
|
||||
'output_1' => [
|
||||
'connections' => []
|
||||
],
|
||||
],
|
||||
'pos_x' => 0,
|
||||
'pos_y' => 0,
|
||||
'typenode' => false,
|
||||
|
|
Loading…
Reference in New Issue