@@ -143,7 +143,7 @@ protected virtual void BuildTransitions(INodeViewModel node, TaskNodeRenderingCo
143
143
while ( ! string . IsNullOrWhiteSpace ( nextTask ? . Definition ? . If ) )
144
144
{
145
145
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 ) ;
147
147
transitions . Add ( nextTask ) ;
148
148
this . Logger . LogTrace ( "[WorkflowGraphBuilder.BuildTransitions][{nodeId}] found transition to '{nextTaskName}'" , node . Id , nextTask ? . Name ) ;
149
149
}
@@ -214,7 +214,7 @@ protected INodeViewModel BuildTaskNode(TaskNodeRenderingContext context)
214
214
SwitchTaskDefinition => this . BuildSwitchTaskNode ( context . OfType < SwitchTaskDefinition > ( ) ) ,
215
215
TryTaskDefinition => this . BuildTryTaskNode ( context . OfType < TryTaskDefinition > ( ) ) ,
216
216
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 } ') ")
218
218
} ?? throw new Exception ( $ "Unable to define a last node for task '{ context . TaskName } '") ;
219
219
}
220
220
@@ -259,7 +259,8 @@ protected virtual NodeViewModel BuildCallTaskNode(TaskNodeRenderingContext<CallT
259
259
break ;
260
260
}
261
261
default :
262
- callType = context . TaskDefinition . Call . ToLower ( ) ;
262
+ callType = "custom-function" ;
263
+ content = context . TaskDefinition . Call . ToLower ( ) ;
263
264
break ;
264
265
}
265
266
var node = new CallTaskNodeViewModel ( context . TaskReference , context . TaskName ! , content , callType ) ;
@@ -482,8 +483,19 @@ protected virtual NodeViewModel BuildSwitchTaskNode(TaskNodeRenderingContext<Swi
482
483
foreach ( var switchCase in context . TaskDefinition . Switch )
483
484
{
484
485
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
+ }
487
499
}
488
500
if ( ! context . TaskDefinition . Switch . Any ( switchCase => string . IsNullOrEmpty ( switchCase . Value . When ) ) )
489
501
{
0 commit comments