Esempio n. 1
0
        /// <summary>
        /// 获取之前节点集合
        /// </summary>
        /// <param name="directions">方向集合</param>
        /// <param name="nodeId">节点ID</param>
        /// <returns>节点集合</returns>
        private static void GetPreNodeList(IList <DIRECTION> directions, int nodeId, List <FlowNode> result)
        {
            var node = NodeService.GetNode(nodeId);

            result.Add(node);

            foreach (var direction in directions)
            {
                if (result.Where(x => x.NodeID == direction.NODE).Count() > 0)
                {
                    continue;
                }
                if (direction.TONODE == nodeId)
                {
                    var fromNode = NodeService.GetNode(direction.NODE.Value);
                    if (fromNode != null)
                    {
                        result.Add(fromNode);
                    }
                    if (directions.Where(x => x.TONODE == direction.NODE && result.Where(y => y.NodeID == x.NODE).Count() == 0).Count() > 0)
                    {
                        GetPreNodeList(directions, direction.NODE.Value, result);
                    }
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 获取节点以前的节点集合
        /// </summary>
        /// <param name="nodeId">节点ID</param>
        /// <returns>节点集合</returns>
        public static List <FlowNode> GetPreviousNodeList(int nodeId)
        {
            var node       = NodeService.GetNode(nodeId);
            var directions = FlowService.GetDirectionsByFlowNo(node.FK_Flow);

            directions = directions.Where(x => x.NODE != x.TONODE).ToList();

            var result = new List <FlowNode>();

            GetPreNodeList(directions, nodeId, result);

            return(result);
        }
Esempio n. 3
0
 /// <summary>
 /// 创建空白流程,流程状态为0
 /// </summary>
 /// <param name="flowNo">流程编号</param>
 /// <param name="userName">用户名</param>
 /// <returns>流程工作标识</returns>
 public static long CreateBlankWork(string flowNo, string userName)
 {
     try
     {
         UserLogin(userName);
         var workID = BP.WF.Dev2Interface.Node_CreateBlankWork(flowNo, null, null, userName, null);
         var nodeID = BP.WF.Dev2Interface.Node_GetCurrentNodeID(flowNo, workID);
         var node   = NodeService.GetNode(nodeID);
         return(workID);
     }
     catch
     {
         return(-1);
     }
 }