From 65f8ba62e00901f37ed2a08e818fe27073d692d2 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bianchi Date: Wed, 18 Dec 2024 16:06:37 +0100 Subject: [PATCH] fix(Dashboard): Fixed graph transition issues - Fixed an issue in the graph where the transition of a conditional node was followed instead of skipped - Fixed an issue in the graph where an exit or end transition in a switch case would result in an error - Added an icon to "custom function" nodes Signed-off-by: Jean-Baptiste Bianchi --- .../Services/WorkflowGraphBuilder.cs | 22 ++++++++++++++----- .../Synapse.Dashboard/wwwroot/index.html | 8 +++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/dashboard/Synapse.Dashboard/Services/WorkflowGraphBuilder.cs b/src/dashboard/Synapse.Dashboard/Services/WorkflowGraphBuilder.cs index 8f332508..db358e98 100644 --- a/src/dashboard/Synapse.Dashboard/Services/WorkflowGraphBuilder.cs +++ b/src/dashboard/Synapse.Dashboard/Services/WorkflowGraphBuilder.cs @@ -143,7 +143,7 @@ protected virtual void BuildTransitions(INodeViewModel node, TaskNodeRenderingCo while (!string.IsNullOrWhiteSpace(nextTask?.Definition?.If)) { this.Logger.LogTrace("[WorkflowGraphBuilder.BuildTransitions][{nodeId}] if clause found, looking up next task.", node.Id); - nextTask = this.GetNextTask(context.TasksList, nextTask.Name); + nextTask = this.GetNextTask(context.TasksList, nextTask.Name, FlowDirective.Continue); transitions.Add(nextTask); this.Logger.LogTrace("[WorkflowGraphBuilder.BuildTransitions][{nodeId}] found transition to '{nextTaskName}'", node.Id, nextTask?.Name); } @@ -214,7 +214,7 @@ protected INodeViewModel BuildTaskNode(TaskNodeRenderingContext context) SwitchTaskDefinition => this.BuildSwitchTaskNode(context.OfType()), TryTaskDefinition => this.BuildTryTaskNode(context.OfType()), WaitTaskDefinition => this.BuildWaitTaskNode(context.OfType()), - _ => throw new NotSupportedException($"The specified task type '{context.TaskDefinition?.GetType()}' is not supported") + _ => throw new NotSupportedException($"The specified task type '{context.TaskDefinition?.GetType()}' is not supported. (reference: '{context.TaskReference}')") } ?? throw new Exception($"Unable to define a last node for task '{context.TaskName}'"); } @@ -259,7 +259,8 @@ protected virtual NodeViewModel BuildCallTaskNode(TaskNodeRenderingContext string.IsNullOrEmpty(switchCase.Value.When))) { diff --git a/src/dashboard/Synapse.Dashboard/wwwroot/index.html b/src/dashboard/Synapse.Dashboard/wwwroot/index.html index 8c8d94c6..7bf82812 100644 --- a/src/dashboard/Synapse.Dashboard/wwwroot/index.html +++ b/src/dashboard/Synapse.Dashboard/wwwroot/index.html @@ -148,6 +148,14 @@ + + + + + + + +