@@ -53,9 +53,9 @@ private WorkflowDefinition Convert(DefinitionSourceV1 source)
53
53
}
54
54
55
55
56
- private List < WorkflowStep > ConvertSteps ( ICollection < StepSourceV1 > source , Type dataType )
56
+ private WorkflowStepCollection ConvertSteps ( ICollection < StepSourceV1 > source , Type dataType )
57
57
{
58
- var result = new List < WorkflowStep > ( ) ;
58
+ var result = new WorkflowStepCollection ( ) ;
59
59
int i = 0 ;
60
60
var stack = new Stack < StepSourceV1 > ( source . Reverse < StepSourceV1 > ( ) ) ;
61
61
var parents = new List < StepSourceV1 > ( ) ;
@@ -87,7 +87,7 @@ private List<WorkflowStep> ConvertSteps(ICollection<StepSourceV1> source, Type d
87
87
targetStep . Name = nextStep . Name ;
88
88
targetStep . ErrorBehavior = nextStep . ErrorBehavior ;
89
89
targetStep . RetryInterval = nextStep . RetryInterval ;
90
- targetStep . Tag = $ "{ nextStep . Id } ";
90
+ targetStep . ExternalId = $ "{ nextStep . Id } ";
91
91
92
92
AttachInputs ( nextStep , dataType , stepType , targetStep ) ;
93
93
AttachOutputs ( nextStep , dataType , stepType , targetStep ) ;
@@ -114,7 +114,7 @@ private List<WorkflowStep> ConvertSteps(ICollection<StepSourceV1> source, Type d
114
114
}
115
115
116
116
if ( ! string . IsNullOrEmpty ( nextStep . NextStepId ) )
117
- targetStep . Outcomes . Add ( new StepOutcome ( ) { Tag = $ "{ nextStep . NextStepId } " } ) ;
117
+ targetStep . Outcomes . Add ( new StepOutcome ( ) { ExternalNextStepId = $ "{ nextStep . NextStepId } " } ) ;
118
118
119
119
result . Add ( targetStep ) ;
120
120
@@ -123,26 +123,26 @@ private List<WorkflowStep> ConvertSteps(ICollection<StepSourceV1> source, Type d
123
123
124
124
foreach ( var step in result )
125
125
{
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 } ") ;
128
128
129
129
foreach ( var outcome in step . Outcomes )
130
130
{
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 } ") ;
133
133
134
- outcome . NextStep = result . Single ( x => x . Tag == outcome . Tag ) . Id ;
134
+ outcome . NextStep = result . Single ( x => x . ExternalId == outcome . ExternalNextStepId ) . Id ;
135
135
}
136
136
}
137
137
138
138
foreach ( var parent in parents )
139
139
{
140
- var target = result . Single ( x => x . Tag == parent . Id ) ;
140
+ var target = result . Single ( x => x . ExternalId == parent . Id ) ;
141
141
foreach ( var branch in parent . Do )
142
142
{
143
143
var childTags = branch . Select ( x => x . Id ) . ToList ( ) ;
144
144
target . Children . AddRange ( result
145
- . Where ( x => childTags . Contains ( x . Tag ) )
145
+ . Where ( x => childTags . Contains ( x . ExternalId ) )
146
146
. OrderBy ( x => x . Id )
147
147
. Select ( x => x . Id )
148
148
. Take ( 1 )
@@ -152,11 +152,11 @@ private List<WorkflowStep> ConvertSteps(ICollection<StepSourceV1> source, Type d
152
152
153
153
foreach ( var item in compensatables )
154
154
{
155
- var target = result . Single ( x => x . Tag == item . Id ) ;
155
+ var target = result . Single ( x => x . ExternalId == item . Id ) ;
156
156
var tag = item . CompensateWith . Select ( x => x . Id ) . FirstOrDefault ( ) ;
157
157
if ( tag != null )
158
158
{
159
- var compStep = result . FirstOrDefault ( x => x . Tag == tag ) ;
159
+ var compStep = result . FirstOrDefault ( x => x . ExternalId == tag ) ;
160
160
if ( compStep != null )
161
161
target . CompensationStepId = compStep . Id ;
162
162
}
0 commit comments