public IEnumerable <Transition> GetTransition(ActorCommandDto dto) { WorkflowInstance instance = WorkflowInstance.GetInstance(dto.ID); var current = GetCurrent(instance, dto.ActorID); return(NodeService.GetExecuteTransition(current)); }
public int GetNodeCooperation(ActorCommandDto dto) { WorkflowInstance instance = WorkflowInstance.GetInstance(dto.ID); Node current = GetCurrent(instance, dto.ActorID); return(String.IsNullOrEmpty(current.Cooperation)?0:1); }
public dynamic Get(ActorCommandDto dto) { WorkflowInstance instance = WorkflowInstance.GetInstance(dto.ID); IList <Pending> pendings = _pendingService.GetPending(instance.InstanceID, dto.ActorID); if (pendings.Count > 0) { var current = GetCurrent(instance, dto.ActorID); Dictionary <string, object> queryArg = new Dictionary <string, object> { { "actorID", dto.ActorID }, { "instanceID", dto.ID }, { "nodeID", current.NID } }; var pending = _pendingService.Query(queryArg).FirstOrDefault(); var hasAuth = (current.NodeType == WorkflowNodeCategory.Start && instance.State == WorkflowInstanceState.Running) ? true : instance.State == WorkflowInstanceState.Running && pending != null; return(new { current.NID, current.Name, Category = current.NodeType.ToString(), HasAuth = hasAuth }); } else { return(new { NID = Guid.NewGuid(), Name = instance.State == WorkflowInstanceState.End ? "结束" : "审批中", Category = instance.State == WorkflowInstanceState.End ? WorkflowNodeCategory.End.ToString() : WorkflowNodeCategory.Fork.ToString(), HasAuth = false }); } }