@@ -17,10 +17,12 @@ namespace WorkflowCore.Services.DefinitionStorage
1717 public class DefinitionLoader : IDefinitionLoader
1818 {
1919 private readonly IWorkflowRegistry _registry ;
20+ private readonly ITypeResolver _typeResolver ;
2021
21- public DefinitionLoader ( IWorkflowRegistry registry )
22+ public DefinitionLoader ( IWorkflowRegistry registry , ITypeResolver typeResolver )
2223 {
2324 _registry = registry ;
25+ _typeResolver = typeResolver ;
2426 }
2527
2628 public WorkflowDefinition LoadDefinition ( string source , Func < string , DefinitionSourceV1 > deserializer )
@@ -220,10 +222,11 @@ private void AttachOutputs(StepSourceV1 source, Type dataType, Type stepType, Wo
220222 var dataParameter = Expression . Parameter ( dataType , "data" ) ;
221223
222224
223- if ( output . Key . Contains ( "." ) || output . Key . Contains ( "[" ) )
225+ if ( output . Key . Contains ( "." ) || output . Key . Contains ( "[" ) )
224226 {
225227 AttachNestedOutput ( output , step , source , sourceExpr , dataParameter ) ;
226- } else
228+ }
229+ else
227230 {
228231 AttachDirectlyOutput ( output , step , dataType , sourceExpr , dataParameter ) ;
229232 }
@@ -259,11 +262,11 @@ private void AttachDirectlyOutput(KeyValuePair<string, string> output, WorkflowS
259262
260263 }
261264
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 )
263266 {
264267 PropertyInfo propertyInfo = null ;
265268 String [ ] paths = output . Key . Split ( '.' ) ;
266-
269+
267270 Expression targetProperty = dataParameter ;
268271
269272 bool hasAddOutput = false ;
@@ -352,7 +355,7 @@ private void AttachOutcomes(StepSourceV1 source, Type dataType, WorkflowStep ste
352355
353356 private Type FindType ( string name )
354357 {
355- return Type . GetType ( name , true , true ) ;
358+ return _typeResolver . FindType ( name ) ;
356359 }
357360
358361 private static Action < IStepBody , object , IStepExecutionContext > BuildScalarInputAction ( KeyValuePair < string , object > input , ParameterExpression dataParameter , ParameterExpression contextParameter , ParameterExpression environmentVarsParameter , PropertyInfo stepProperty )
0 commit comments