Exemplo n.º 1
0
 public WorkflowState GetInitialState(string schemeCode, IDictionary<string, object> processParameters = null)
 {
     ProcessDefinition processDefinition = (processParameters != null ? this.Builder.GetProcessScheme(schemeCode, processParameters) : this.Builder.GetProcessScheme(schemeCode));
     ActivityDefinition ınitialActivity = processDefinition.InitialActivity;
     WorkflowState workflowState = new WorkflowState()
     {
         Name = ınitialActivity.State,
         SchemeCode = schemeCode,
         VisibleName = processDefinition.GetLocalizedStateName(ınitialActivity.State, CultureInfo.CurrentCulture)
     };
     return workflowState;
 }
Exemplo n.º 2
0
 public WorkflowState GetCurrentState(Guid processId)
 {
     ProcessInstance processInstance = this.Builder.GetProcessInstance(processId);
     this.PersistenceProvider.FillSystemProcessParameters(processInstance);
     object value = processInstance.GetParameter(DefaultDefinitions.ParameterCurrentState.Name).Value;
     string name = processInstance.ProcessScheme.Name;
     if (value == null)
     {
         return null;
     }
     WorkflowState workflowState = new WorkflowState()
     {
         Name = value.ToString(),
         SchemeCode = name,
         VisibleName = processInstance.ProcessScheme.GetLocalizedStateName(value.ToString(), CultureInfo.CurrentCulture)
     };
     return workflowState;
 }