public void InitWorkflowState(string workflowName) { var workflowContext = WorkflowInstance.GetWorkflowContextByWorkflowName(workflowName); AddInvokeStepRelation(workflowContext); AddRoleActionRelation(workflowContext); }
public ApplicationState GetAppStateByCondition(string workflowName, string workflowState) { var workflowContext = WorkflowInstance.GetWorkflowContextByWorkflowName(workflowName); var currentStepList = workflowContext.WorkflowStepList.OfType <IStepRunnerStep>().Select(stepRunnerStep => (from invokeStep in stepRunnerStep.WorkflowSteps.OfType <IInvokeStep>() where invokeStep.InvokeContext.Name.CompareEqualIgnoreCase(workflowState) select invokeStep)).FirstOrDefault(); var currentStep = currentStepList.Count() > 0 ? currentStepList.First() : null; if (currentStep != null && currentStep.InvokeContext.PortType.CompareEqualIgnoreCase(WFConstants.WorkflowEndPortTypeTags)) { return(ApplicationState.Complete); } return(ApplicationState.InProgress); }