Exemple #1
0
 public void RecordProcessStatus(ProcessStatus processStatus)
 {
     _processInstanceRecord.EndTime       = DateTime.Now;
     _processInstanceRecord.Parameters    = ProcessParameterManager.GetValueInString();
     _processInstanceRecord.ProcessStatus = processStatus;
     ProcessRecordSqLiteUtil.LogProcessInstance(_processInstanceRecord);
 }
Exemple #2
0
        public void Initialize(Process process, ResourceDicModel <string> resourceDic)
        {
            try
            {
                _processInstanceRecord = new ProcessInstanceRecord
                {
                    ProcessName = ProcessName, Pid = Pid, StartTime = DateTime.Now
                };

                _processInstanceRecord.Messages.Add(new Message {
                    Description = $"Pid: [{Pid}]"
                });

                //将主流程调用时选定的资源名同步到ProcessInstance当中。
                if (resourceDic != null)
                {
                    ProcessParameterManager.GetDictionaryParam(resourceDic.ResourceDictionaryName)
                    .Replace(resourceDic.DictionaryParameter);
                }

                foreach (var processStep in process.Steps)
                {
                    var step = processStep.Value.CreateInstance(ProcessParameterManager);

                    step.OwnerProcessInstance = this;

                    Steps.Add(processStep.Key, step);
                }
            }
            catch (Exception e)
            {
                Log.Error($"ProcessInstance进行初始化失败,{e.Message}");
            }
        }
Exemple #3
0
        private IResource GetResourceFromResourceDic(string resourceKey)
        {
            var lockerName = ProcessParameterManager.GetDictionaryParam(ResourceDicName).GetValue(resourceKey)
                             .ToString();

            var lockerResource = ResourceManager.GetResource(lockerName);

            return(lockerResource);
        }
Exemple #4
0
 public void StopWork()
 {
     foreach (var step in Steps)
     {
         step.Value.Dispose();
     }
     ProcessParameterManager.Dispose();
     Steps.Clear();
     BreakCondition = null;
     Dispose();
 }
Exemple #5
0
 public List <ParameterInfo> GetParametersValue()
 {
     return(ProcessParameterManager.GetValueInString());
 }