Exemplo n.º 1
0
        private void LoadWorkflow(IWorkflowBuilder <TModel> builder)
        {
            WorkDefine.Workflow wf = null;
            if (this.WorkflowManager != null)
            {
                wf = this.WorkflowManager.WorkFlow;
            }
            else
            {
                wf = this.ImplementationManager.GetWorkflow(builder);
                this.WorkflowManager = new WorkflowManager(wf, this.Configuration);
            }

            if (RunManager == null)
            {
                RunManager = new RunManager(this.Configuration.Convention, wf.Id);
            }
            else
            {
                this.RunManager.WorkflowId = wf.Id;
            }

            this.ValidationContainer = ValidationContainer.CreateValidationContainer();

            if (this.preOverrides.Count() > 0)
            {
                this.preOverrides.ForEach(o =>
                {
                    ((IValidationContainer)this.ValidationContainer).AddOverride(o.Key, o.Comment, o.AuditCode);
                });
            }

            this.WorkflowCache = this.Configuration.Cache.Spawn(wf.Id);
        }
Exemplo n.º 2
0
        //defer is called during the execution of an IAction
        void IEngineScope <TModel> .Defer(IDeferredAction <TModel> action, bool onlyIfValidationsResolved)
        {
            string key = RunManager.GetDeferralId();

            if (onlyIfValidationsResolved)
            {
                this.finalize.Add(key, action);
            }
            else
            {
                this.finalizeAlways.Add(key, action);
            }
        }
Exemplo n.º 3
0
 internal Engine(Config config, RunManager runManager) : this(config)
 {
     this.RunManager = runManager;
 }