@@ -143,7 +143,7 @@ protected virtual void BuildTransitions(INodeViewModel node, TaskNodeRenderingCo
143143 while ( ! string . IsNullOrWhiteSpace ( nextTask ? . Definition ? . If ) )
144144 {
145145 this . Logger . LogTrace ( "[WorkflowGraphBuilder.BuildTransitions][{nodeId}] if clause found, looking up next task." , node . Id ) ;
146- nextTask = this . GetNextTask ( context . TasksList , nextTask . Name ) ;
146+ nextTask = this . GetNextTask ( context . TasksList , nextTask . Name , FlowDirective . Continue ) ;
147147 transitions . Add ( nextTask ) ;
148148 this . Logger . LogTrace ( "[WorkflowGraphBuilder.BuildTransitions][{nodeId}] found transition to '{nextTaskName}'" , node . Id , nextTask ? . Name ) ;
149149 }
@@ -214,7 +214,7 @@ protected INodeViewModel BuildTaskNode(TaskNodeRenderingContext context)
214214 SwitchTaskDefinition => this . BuildSwitchTaskNode ( context . OfType < SwitchTaskDefinition > ( ) ) ,
215215 TryTaskDefinition => this . BuildTryTaskNode ( context . OfType < TryTaskDefinition > ( ) ) ,
216216 WaitTaskDefinition => this . BuildWaitTaskNode ( context . OfType < WaitTaskDefinition > ( ) ) ,
217- _ => throw new NotSupportedException ( $ "The specified task type '{ context . TaskDefinition ? . GetType ( ) } ' is not supported")
217+ _ => throw new NotSupportedException ( $ "The specified task type '{ context . TaskDefinition ? . GetType ( ) } ' is not supported. (reference: ' { context . TaskReference } ') ")
218218 } ?? throw new Exception ( $ "Unable to define a last node for task '{ context . TaskName } '") ;
219219 }
220220
@@ -259,7 +259,8 @@ protected virtual NodeViewModel BuildCallTaskNode(TaskNodeRenderingContext<CallT
259259 break ;
260260 }
261261 default :
262- callType = context . TaskDefinition . Call . ToLower ( ) ;
262+ callType = "custom-function" ;
263+ content = context . TaskDefinition . Call . ToLower ( ) ;
263264 break ;
264265 }
265266 var node = new CallTaskNodeViewModel ( context . TaskReference , context . TaskName ! , content , callType ) ;
@@ -482,8 +483,19 @@ protected virtual NodeViewModel BuildSwitchTaskNode(TaskNodeRenderingContext<Swi
482483 foreach ( var switchCase in context . TaskDefinition . Switch )
483484 {
484485 var switchCaseTask = this . GetNextTask ( context . TasksList , context . TaskName , switchCase . Value . Then ) ! ;
485- var switchCaseNode = this . BuildTaskNode ( new ( context . Workflow , context . Graph , context . TasksList , switchCaseTask . Index , switchCaseTask . Name , switchCaseTask . Definition , context . TaskGroup , context . ParentReference , context . ParentContext , context . EntryNode , context . ExitNode ) ) ;
486- this . BuildEdge ( context . Graph , this . GetNodeAnchor ( node , NodePortType . Exit ) , GetNodeAnchor ( switchCaseNode , NodePortType . Entry ) ) ;
486+ if ( switchCaseTask . Index != - 1 )
487+ {
488+ var switchCaseNode = this . BuildTaskNode ( new ( context . Workflow , context . Graph , context . TasksList , switchCaseTask . Index , switchCaseTask . Name , switchCaseTask . Definition , context . TaskGroup , context . ParentReference , context . ParentContext , context . EntryNode , context . ExitNode ) ) ;
489+ this . BuildEdge ( context . Graph , this . GetNodeAnchor ( node , NodePortType . Exit ) , GetNodeAnchor ( switchCaseNode , NodePortType . Entry ) ) ;
490+ }
491+ else if ( switchCaseTask . Name == FlowDirective . Exit )
492+ {
493+ this . BuildEdge ( context . Graph , this . GetNodeAnchor ( node , NodePortType . Exit ) , context . ExitNode ) ;
494+ }
495+ else if ( switchCaseTask . Name == FlowDirective . End )
496+ {
497+ this . BuildEdge ( context . Graph , this . GetNodeAnchor ( node , NodePortType . Exit ) , context . Graph . AllNodes . Skip ( 1 ) . First ( ) . Value ) ;
498+ }
487499 }
488500 if ( ! context . TaskDefinition . Switch . Any ( switchCase => string . IsNullOrEmpty ( switchCase . Value . When ) ) )
489501 {
0 commit comments