@@ -17,10 +17,12 @@ namespace WorkflowCore.Services.DefinitionStorage
17
17
public class DefinitionLoader : IDefinitionLoader
18
18
{
19
19
private readonly IWorkflowRegistry _registry ;
20
+ private readonly ITypeResolver _typeResolver ;
20
21
21
- public DefinitionLoader ( IWorkflowRegistry registry )
22
+ public DefinitionLoader ( IWorkflowRegistry registry , ITypeResolver typeResolver )
22
23
{
23
24
_registry = registry ;
25
+ _typeResolver = typeResolver ;
24
26
}
25
27
26
28
public WorkflowDefinition LoadDefinition ( string source , Func < string , DefinitionSourceV1 > deserializer )
@@ -220,10 +222,11 @@ private void AttachOutputs(StepSourceV1 source, Type dataType, Type stepType, Wo
220
222
var dataParameter = Expression . Parameter ( dataType , "data" ) ;
221
223
222
224
223
- if ( output . Key . Contains ( "." ) || output . Key . Contains ( "[" ) )
225
+ if ( output . Key . Contains ( "." ) || output . Key . Contains ( "[" ) )
224
226
{
225
227
AttachNestedOutput ( output , step , source , sourceExpr , dataParameter ) ;
226
- } else
228
+ }
229
+ else
227
230
{
228
231
AttachDirectlyOutput ( output , step , dataType , sourceExpr , dataParameter ) ;
229
232
}
@@ -259,11 +262,11 @@ private void AttachDirectlyOutput(KeyValuePair<string, string> output, WorkflowS
259
262
260
263
}
261
264
262
- private void AttachNestedOutput ( KeyValuePair < string , string > output , WorkflowStep step , StepSourceV1 source , LambdaExpression sourceExpr , ParameterExpression dataParameter )
265
+ private void AttachNestedOutput ( KeyValuePair < string , string > output , WorkflowStep step , StepSourceV1 source , LambdaExpression sourceExpr , ParameterExpression dataParameter )
263
266
{
264
267
PropertyInfo propertyInfo = null ;
265
268
String [ ] paths = output . Key . Split ( '.' ) ;
266
-
269
+
267
270
Expression targetProperty = dataParameter ;
268
271
269
272
bool hasAddOutput = false ;
@@ -352,7 +355,7 @@ private void AttachOutcomes(StepSourceV1 source, Type dataType, WorkflowStep ste
352
355
353
356
private Type FindType ( string name )
354
357
{
355
- return Type . GetType ( name , true , true ) ;
358
+ return _typeResolver . FindType ( name ) ;
356
359
}
357
360
358
361
private static Action < IStepBody , object , IStepExecutionContext > BuildScalarInputAction ( KeyValuePair < string , object > input , ParameterExpression dataParameter , ParameterExpression contextParameter , ParameterExpression environmentVarsParameter , PropertyInfo stepProperty )
0 commit comments