Example #1
0
        protected override void EndProcessing()
        {
            var privateData     = (Hashtable)MyInvocation.MyCommand.Module.PrivateData;
            var context         = (OrchestrationContext)privateData[SetFunctionInvocationContextCommand.ContextKey];
            var loadedFunctions = FunctionLoader.GetLoadedFunctions();

            _activityInvocationTracker.ReplayActivityOrStop(
                FunctionName, Input, context, loadedFunctions, NoWait.IsPresent, WriteObject);
        }
        protected override void EndProcessing()
        {
            var privateData     = (Hashtable)MyInvocation.MyCommand.Module.PrivateData;
            var context         = (OrchestrationContext)privateData[SetFunctionInvocationContextCommand.ContextKey];
            var loadedFunctions = FunctionLoader.GetLoadedFunctions();

            var task = new ActivityInvocationTask(FunctionName, Input);

            ActivityInvocationTask.ValidateTask(task, loadedFunctions);

            _durableTaskHandler.StopAndInitiateDurableTaskOrReplay(
                task, context, NoWait.IsPresent, WriteObject);
        }
Example #3
0
        protected override void EndProcessing()
        {
            var privateData     = (Hashtable)MyInvocation.MyCommand.Module.PrivateData;
            var context         = (OrchestrationContext)privateData[SetFunctionInvocationContextCommand.ContextKey];
            var loadedFunctions = FunctionLoader.GetLoadedFunctions();

            var task = new ActivityInvocationTask(FunctionName, Input, RetryOptions);

            ActivityInvocationTask.ValidateTask(task, loadedFunctions);

            _durableTaskHandler.StopAndInitiateDurableTaskOrReplay(
                task, context, NoWait.IsPresent,
                output: WriteObject,
                onFailure: failureReason => DurableActivityErrorHandler.Handle(this, failureReason),
                retryOptions: RetryOptions);
        }
 /// <summary>
 /// Create the PowerShell function that is equivalent to the 'scriptFile' when possible.
 /// </summary>
 private void DeployAzFunctionToRunspace()
 {
     foreach (AzFunctionInfo functionInfo in FunctionLoader.GetLoadedFunctions())
     {
         if (functionInfo.FuncScriptBlock != null)
         {
             // Create PS constant function for the Az function.
             // Constant function cannot be changed or removed, it stays till the session ends.
             _pwsh.AddCommand("New-Item")
             .AddParameter("Path", @"Function:\")
             .AddParameter("Name", functionInfo.DeployedPSFuncName)
             .AddParameter("Value", functionInfo.FuncScriptBlock)
             .AddParameter("Options", "Constant")
             .InvokeAndClearCommands();
         }
     }
 }