示例#1
0
        public void InitWorkflowState(string workflowName)
        {
            var workflowContext = WorkflowInstance.GetWorkflowContextByWorkflowName(workflowName);

            AddInvokeStepRelation(workflowContext);
            AddRoleActionRelation(workflowContext);
        }
示例#2
0
        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);
        }