public override WorkflowLaneSet ConvertFromXml(XElement element)
        {
            WorkflowLaneSet LaneSet = new WorkflowLaneSet(
                base.GetIdAttributeValue(element)
                );

            //Lane
            IEnumerable <XElement> WorkflowLaneList = element.Descendants(XMLNodeName.lane.ToString());

            foreach (XElement xLane in WorkflowLaneList)
            {
                WorkflowLane Lane = _WorkflowLaneConvertor.ConvertFromString(xLane.ToString());
                LaneSet.AddLane(Lane);
            }

            return(LaneSet);
        }
        public void Update(Guid processID, WorkflowProcess _WorkflowProcess)
        {
            List <sysBpmsLane> Lanes = this.GetList(processID);
            var CurrentWorkflowLane  = WorkflowLane.GetAllLanes(_WorkflowProcess.LaneSet);

            foreach (sysBpmsLane item in Lanes.Where(c => !CurrentWorkflowLane.Any(d => d.ID == c.ElementID)))
            {
                this.Delete(item.ID);
            }

            //StartEvents
            foreach (WorkflowLane item in CurrentWorkflowLane)
            {
                sysBpmsLane lane = Lanes.FirstOrDefault(c => c.ElementID == item.ID);
                if (lane != null)
                {
                    this.Update(lane);
                    //Element
                    lane.Element.Name = item.Name;
                    new ElementService(this.UnitOfWork).Update(lane.Element);
                }
                else
                {
                    lane = new sysBpmsLane()
                    {
                        ID        = Guid.NewGuid(),
                        ElementID = item.ID,
                        ProcessID = processID,
                        //Element
                        Element = new sysBpmsElement()
                        {
                            ID        = item.ID,
                            Name      = item.Name,
                            ProcessID = processID,
                            TypeLU    = (int)sysBpmsElement.e_TypeLU.Lane,
                        }
                    };
                    this.Add(lane);
                    new ElementService(this.UnitOfWork).Update(lane.Element);
                }
            }
        }