@@ -66,22 +66,27 @@ public void BeforeFunctionInvocation(IList<ParameterBinding> inputData)
66
66
}
67
67
else if ( _durableFunctionInfo . IsOrchestrationFunction )
68
68
{
69
- _orchestrationBindingInfo = CreateOrchestrationBindingInfo ( inputData ) ;
70
- _powerShellServices . SetOrchestrationContext ( _orchestrationBindingInfo . Context ) ;
71
-
72
- // Bote: Cannot find the DurableSDK module here, somehow.
73
- Collection < object > output2 = this . pwsh . AddCommand ( "Get-Module" )
74
- . InvokeAndClearCommands < object > ( ) ;
75
-
76
- var context = inputData [ 0 ] ;
77
- Collection < Action < object > > output = this . pwsh . AddCommand ( "Set-BindingData" )
78
- . AddParameter ( "Input" , context . Data . String )
79
- . AddParameter ( "SetResult" , ( Action < object , bool > ) _orchestrationBindingInfo . Context . SetExternalResult )
80
- . InvokeAndClearCommands < Action < object > > ( ) ;
81
- if ( output . Count ( ) == 1 )
69
+ try
82
70
{
83
- this . _orchestrationInvoker . SetExternalInvoker ( output [ 0 ] ) ;
71
+ _orchestrationBindingInfo = CreateOrchestrationBindingInfo ( inputData ) ;
72
+ var context = inputData [ 0 ] ;
73
+ Collection < Action < object > > output = this . pwsh . AddCommand ( "Set-BindingData" )
74
+ . AddParameter ( "Input" , context . Data . String )
75
+ . AddParameter ( "SetResult" , ( Action < object , bool > ) _orchestrationBindingInfo . Context . SetExternalResult )
76
+ . InvokeAndClearCommands < Action < object > > ( ) ;
77
+ if ( output . Count ( ) == 1 )
78
+ {
79
+ this . _orchestrationInvoker . SetExternalInvoker ( output [ 0 ] ) ;
80
+ }
81
+
82
+ _powerShellServices . SetOrchestrationContext ( _orchestrationBindingInfo . Context ) ;
84
83
}
84
+ catch
85
+ {
86
+ _orchestrationBindingInfo = CreateOrchestrationBindingInfo ( inputData ) ;
87
+ _powerShellServices . SetOrchestrationContext ( _orchestrationBindingInfo . Context ) ;
88
+ }
89
+
85
90
}
86
91
}
87
92
0 commit comments