Skip to content

Commit

Permalink
Merge branch '1.0.0-alpha1' of https://github.com/serverlessworkflow/…
Browse files Browse the repository at this point in the history
…synapse into 1.0.0-alpha1
  • Loading branch information
cdavernas committed Aug 16, 2024
2 parents 4f02bbd + 5deff6d commit d02b32b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/dashboard/Synapse.Dashboard/Services/WorkflowGraphBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,15 @@ public IGraphViewModel Build(WorkflowDefinition workflow)
protected TaskIdentity? GetNextTaskIdentity(TaskNodeRenderingContext context, NodeViewModel currentNode, string? transition = null)
{
transition = !string.IsNullOrWhiteSpace(transition) ? transition : context.TaskDefinition.Then;
if (transition == FlowDirective.End || transition == FlowDirective.Exit) return null;
if (transition == FlowDirective.End) return null;
if (transition == FlowDirective.Exit)
{
if (context.ParentContext == null)
{
return null;
}
return this.GetNextTaskIdentity(context.ParentContext, currentNode);
}
var nextTaskName = string.IsNullOrWhiteSpace(transition) || transition == FlowDirective.Continue
? context.Workflow.GetTaskAfter(new(context.TaskName, context.TaskDefinition), context.ParentReference)?.Key
: transition;
Expand All @@ -104,7 +112,7 @@ public IGraphViewModel Build(WorkflowDefinition workflow)
{
return null;
}
return this.GetNextTaskIdentity(context.ParentContext, currentNode, transition);
return this.GetNextTaskIdentity(context.ParentContext, currentNode);
}
var nextTaskIndex = context.Workflow.IndexOf(nextTaskName, context.ParentReference);
var nextTaskReference = $"{context.ParentReference}/{nextTaskIndex}/{nextTaskName}";
Expand Down Expand Up @@ -135,7 +143,7 @@ protected NodeViewModel GetNextNode(TaskNodeRenderingContext context, NodeViewMo
{
return (NodeViewModel)context.Graph.AllClusters[nextTaskIdentity.Reference].AllNodes.First().Value;
}
return (NodeViewModel)context.Graph.AllNodes[nextTaskIdentity.Reference]; //((IReadOnlyDictionary<string, IGraphElement>)context.Graph.AllNodes).Concat((IReadOnlyDictionary<string, IGraphElement>)context.Graph.AllClusters).ToDictionary()[nextTaskReference];
return (NodeViewModel)context.Graph.AllNodes[nextTaskIdentity.Reference];
}

/// <summary>
Expand Down

0 comments on commit d02b32b

Please sign in to comment.