Skip to content

Commit

Permalink
update createExecutionArray
Browse files Browse the repository at this point in the history
  • Loading branch information
fiedlerNr9 committed Apr 8, 2024
1 parent 58b322f commit 8031505
Showing 1 changed file with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Identifier } from '../../../../models/Common/types';
import { CompiledTask } from '../../../../models/Task/types';
import { dNode } from '../../../../models/Graph/types';
import { isEndNode, isStartNode } from '../../../../models/Node/utils';
import { getTaskTypeFromCompiledNode } from '../../../WorkflowGraph/utils';

interface NodeExecutionInfo extends NodeExecutionDetails {
scopedId?: string;
Expand Down Expand Up @@ -104,6 +105,16 @@ export const getNodeDetails = (
};
}

if (compiledNode?.arrayNode) {
returnVal = {
...returnVal,
displayType:
returnVal.displayType !== NodeExecutionDisplayType.Unknown
? returnVal.displayType
: NodeExecutionDisplayType.ArrayNode,
};
}

return returnVal;
};

Expand All @@ -119,6 +130,13 @@ export const getNodeDetailsFromTask = (node: dNode, task?: CompiledTask): NodeEx
displayType: taskType ?? NodeExecutionDisplayType.Unknown,
};

if (node.value?.arrayNode) {
returnVal = {
...returnVal,
displayType: NodeExecutionDisplayType.ArrayNode,
};
}

if (node.value?.workflowNode) {
const { workflowNode } = node.value;
const info = workflowNode.launchplanRef ?? workflowNode.subWorkflowRef;
Expand Down Expand Up @@ -160,7 +178,7 @@ export const getNodeExecutionDetails = (
node: dNode,
tasks: CompiledTask[] = [],
): NodeExecutionInfo => {
const templateName = node?.value?.taskNode?.referenceId?.name ?? node.name;
const task = tasks.find((t) => t.template.id.name === templateName);
const taskNode = node?.value?.arrayNode?.node?.taskNode || node?.value?.taskNode;
const task = getTaskTypeFromCompiledNode(taskNode!, tasks);
return getNodeDetailsFromTask(node, task);
};

0 comments on commit 8031505

Please sign in to comment.