Example #1
0
        //void rt_Single_Progress(object sender, HandlerProgressCancelEventArgs e)
        //{
        //    if( _wantsCancel ) { e.Cancel = true; }
        //    (new ActionItem() { InstanceId = e.Id }).UpdateInstanceStatus( e.Status, e.Message, e.Sequence );
        //    OnProgress( e );
        //    if( e.Cancel ) { _wantsCancel = true; }
        //}
        #endregion


        #region progress/log handlers
        void rt_Progress(object sender, HandlerProgressCancelEventArgs e)
        {
            if (_wantsCancel)
            {
                e.Cancel = true;
            }
#if sqlite
            SynapseDal.UpdateActionInstance(e.Id, e.Status, e.Message, e.Sequence);
#endif
            OnProgress(e);
            if (e.Cancel)
            {
                _wantsCancel = true;
            }
        }
Example #2
0
        public ExecuteResult Start(Dictionary <string, string> dynamicData, bool dryRun = false, bool inProc = true)
        {
#if sqlite
            SynapseDal.CreateDatabase();
            CreateInstance();
#endif

            AddStartInfoToDynamicData(ref dynamicData);

            ResultPlan = new Plan
            {
                Name        = Name,
                UniqueName  = UniqueName,
                Description = Description,
                InstanceId  = InstanceId,
                StartInfo   = StartInfo,
                Signature   = Signature,
                RunAs       = RunAs,
                Crypto      = Crypto,
                Result      = new ExecuteResult()
            };

            if (inProc)
            {
                ProcessRecursive(ResultPlan, RunAs, null, Actions, ResultPlan.Result, dynamicData, dryRun, ExecuteHandlerProcessInProc);
            }
            else
            {
                ProcessRecursive(ResultPlan, RunAs, null, Actions, ResultPlan.Result, dynamicData, dryRun, ExecuteHandlerProcessExternal);
            }

            ResultPlan.Result.Status = ResultPlan.Result.BranchStatus;
            Result = ResultPlan.Result;

#if sqlite
            UpdateInstanceStatus(Result.Status, Result.Status.ToString());
#endif

            return(Result);
        }