@@ -53,9 +53,9 @@ private WorkflowDefinition Convert(DefinitionSourceV1 source)
5353 }
5454
5555
56- private List < WorkflowStep > ConvertSteps ( ICollection < StepSourceV1 > source , Type dataType )
56+ private WorkflowStepCollection ConvertSteps ( ICollection < StepSourceV1 > source , Type dataType )
5757 {
58- var result = new List < WorkflowStep > ( ) ;
58+ var result = new WorkflowStepCollection ( ) ;
5959 int i = 0 ;
6060 var stack = new Stack < StepSourceV1 > ( source . Reverse < StepSourceV1 > ( ) ) ;
6161 var parents = new List < StepSourceV1 > ( ) ;
@@ -87,7 +87,7 @@ private List<WorkflowStep> ConvertSteps(ICollection<StepSourceV1> source, Type d
8787 targetStep . Name = nextStep . Name ;
8888 targetStep . ErrorBehavior = nextStep . ErrorBehavior ;
8989 targetStep . RetryInterval = nextStep . RetryInterval ;
90- targetStep . Tag = $ "{ nextStep . Id } ";
90+ targetStep . ExternalId = $ "{ nextStep . Id } ";
9191
9292 AttachInputs ( nextStep , dataType , stepType , targetStep ) ;
9393 AttachOutputs ( nextStep , dataType , stepType , targetStep ) ;
@@ -114,7 +114,7 @@ private List<WorkflowStep> ConvertSteps(ICollection<StepSourceV1> source, Type d
114114 }
115115
116116 if ( ! string . IsNullOrEmpty ( nextStep . NextStepId ) )
117- targetStep . Outcomes . Add ( new StepOutcome ( ) { Tag = $ "{ nextStep . NextStepId } " } ) ;
117+ targetStep . Outcomes . Add ( new StepOutcome ( ) { ExternalNextStepId = $ "{ nextStep . NextStepId } " } ) ;
118118
119119 result . Add ( targetStep ) ;
120120
@@ -123,26 +123,26 @@ private List<WorkflowStep> ConvertSteps(ICollection<StepSourceV1> source, Type d
123123
124124 foreach ( var step in result )
125125 {
126- if ( result . Any ( x => x . Tag == step . Tag && x . Id != step . Id ) )
127- throw new WorkflowDefinitionLoadException ( $ "Duplicate step Id { step . Tag } ") ;
126+ if ( result . Any ( x => x . ExternalId == step . ExternalId && x . Id != step . Id ) )
127+ throw new WorkflowDefinitionLoadException ( $ "Duplicate step Id { step . ExternalId } ") ;
128128
129129 foreach ( var outcome in step . Outcomes )
130130 {
131- if ( result . All ( x => x . Tag != outcome . Tag ) )
132- throw new WorkflowDefinitionLoadException ( $ "Cannot find step id { outcome . Tag } ") ;
131+ if ( result . All ( x => x . ExternalId != outcome . ExternalNextStepId ) )
132+ throw new WorkflowDefinitionLoadException ( $ "Cannot find step id { outcome . ExternalNextStepId } ") ;
133133
134- outcome . NextStep = result . Single ( x => x . Tag == outcome . Tag ) . Id ;
134+ outcome . NextStep = result . Single ( x => x . ExternalId == outcome . ExternalNextStepId ) . Id ;
135135 }
136136 }
137137
138138 foreach ( var parent in parents )
139139 {
140- var target = result . Single ( x => x . Tag == parent . Id ) ;
140+ var target = result . Single ( x => x . ExternalId == parent . Id ) ;
141141 foreach ( var branch in parent . Do )
142142 {
143143 var childTags = branch . Select ( x => x . Id ) . ToList ( ) ;
144144 target . Children . AddRange ( result
145- . Where ( x => childTags . Contains ( x . Tag ) )
145+ . Where ( x => childTags . Contains ( x . ExternalId ) )
146146 . OrderBy ( x => x . Id )
147147 . Select ( x => x . Id )
148148 . Take ( 1 )
@@ -152,11 +152,11 @@ private List<WorkflowStep> ConvertSteps(ICollection<StepSourceV1> source, Type d
152152
153153 foreach ( var item in compensatables )
154154 {
155- var target = result . Single ( x => x . Tag == item . Id ) ;
155+ var target = result . Single ( x => x . ExternalId == item . Id ) ;
156156 var tag = item . CompensateWith . Select ( x => x . Id ) . FirstOrDefault ( ) ;
157157 if ( tag != null )
158158 {
159- var compStep = result . FirstOrDefault ( x => x . Tag == tag ) ;
159+ var compStep = result . FirstOrDefault ( x => x . ExternalId == tag ) ;
160160 if ( compStep != null )
161161 target . CompensationStepId = compStep . Id ;
162162 }
0 commit comments