protected CmdletActivity(CmdletActivity activity) : base(activity)
 {
     this.StatusReport                   = activity.StatusReport;
     this.DataObjectName                 = activity.DataObjectName;
     this.CommandText                    = activity.CommandText;
     this.SnapInAlias                    = activity.SnapInAlias;
     this.IdentityVariable               = activity.IdentityVariable;
     this.IdentityName                   = activity.IdentityName;
     this.ShouldContinueParam            = activity.ShouldContinueParam;
     this.ShouldContinueOperation        = activity.ShouldContinueOperation;
     this.AllowExceuteThruHttpGetRequest = activity.AllowExceuteThruHttpGetRequest;
     this.DisableLogging                 = activity.DisableLogging;
 }
Beispiel #2
0
        public PowerShellResults Run(DataRow input, DataTable dataTable, DataObjectStore store, Type codeBehind, Workflow.UpdateTableDelegate updateTableDelegate)
        {
            DDIHelper.Trace("Executing workflow: {0} {1}", new object[]
            {
                base.GetType().Name,
                this.Name
            });
            this.Initialize(input, dataTable);
            List <PowerShellResults> list = new List <PowerShellResults>();

            this.activitiesExecutedCount = 0;
            bool forGetListProgress = DDIHelper.ForGetListProgress;

            foreach (Activity activity in this.Activities)
            {
                if (activity.IsRunnable(input, dataTable, store))
                {
                    this.currentExecutingActivity = activity;
                    if (!forGetListProgress && this.AsyncRunning)
                    {
                        foreach (Activity activity2 in activity.Find((Activity x) => x is CmdletActivity))
                        {
                            CmdletActivity cmdletActivity = (CmdletActivity)activity2;
                            cmdletActivity.PSProgressChanged += this.Activity_ProgressChanged;
                        }
                    }
                    RunResult runResult = activity.RunCore(input, dataTable, store, codeBehind, updateTableDelegate);
                    list.AddRange(activity.GetStatusReport(input, dataTable, store));
                    if (runResult.ErrorOccur && activity.ErrorBehavior == ErrorBehavior.Stop)
                    {
                        break;
                    }
                }
                this.activitiesExecutedCount++;
            }
            PowerShellResults powerShellResults = forGetListProgress ? new PowerShellResults <JsonDictionary <object> >() : new PowerShellResults();

            foreach (PowerShellResults powerShellResults2 in list)
            {
                powerShellResults.MergeErrors(powerShellResults2);
                if (forGetListProgress)
                {
                    ((PowerShellResults <JsonDictionary <object> >)powerShellResults).MergeProgressData <PSObject>(powerShellResults2 as PowerShellResults <PSObject>);
                }
            }
            return(powerShellResults);
        }
Beispiel #3
0
 public PowerShellResults <O> Invoke <O>(RunspaceMediator runspaceMediator, IEnumerable pipelineInput, WebServiceParameters parameters, CmdletActivity activity, bool isGetListAsync)
 {
     return(this.command.Invoke(runspaceMediator, pipelineInput, parameters, activity, isGetListAsync));
 }