Esempio n. 1
0
 public void AddFlowElement(FlowElement element)
 {
     flowElementList.Add(element);
     element.ParentContainer = this;
     if (!string.IsNullOrEmpty(element.Id))
     {
         flowElementMap.Add(element.Id, element);
     }
 }
Esempio n. 2
0
        public FlowElement GetFlowElement(string id)
        {
            FlowElement foundElement = null;

            if (!string.IsNullOrEmpty(id))
            {
                foundElement = flowElementMap[id];
            }
            return(foundElement);
        }
Esempio n. 3
0
        public void RemoveFlowElement(string elementId)
        {
            FlowElement element = flowElementMap[elementId];

            if (element != null)
            {
                flowElementList.Remove(element);
                flowElementMap.Remove(element.Id);
            }
        }
Esempio n. 4
0
 public void AddFlowElementToMap(FlowElement element)
 {
     if (element != null && (!string.IsNullOrEmpty(element.Id)))
     {
         flowElementMap.Add(element.Id, element);
         if (ParentContainer != null)
         {
             ParentContainer.AddFlowElementToMap(element);
         }
     }
 }
Esempio n. 5
0
        public void RemoveFlowElement(string elementId)
        {
            FlowElement element = GetFlowElement(elementId);

            if (element != null)
            {
                flowElementList.Remove(element);
                flowElementMap.Remove(elementId);
                if (element.ParentContainer != null)
                {
                    element.ParentContainer.RemoveFlowElementFromMap(elementId);
                }
            }
        }
Esempio n. 6
0
        //public abstract FlowElement Clone();

        public void SetValues(FlowElement otherElement)
        {
            base.SetValues(otherElement);
            name          = otherElement.Name;
            documentation = otherElement.Documentation;

            executionListeners = new List <ActivitiListener>();
            if (otherElement.GetExecutionListeners() != null && otherElement.GetExecutionListeners().Count > 0)
            {
                foreach (ActivitiListener listener in otherElement.GetExecutionListeners())
                {
                    executionListeners.Add((ActivitiListener)listener.Clone());
                }
            }
        }
Esempio n. 7
0
 public IFlowElementsContainer FindParent(FlowElement childElement, IFlowElementsContainer flowElementsContainer)
 {
     foreach (FlowElement flowElement in flowElementsContainer.GetFlowElements())
     {
         if (childElement.Id != null && childElement.Id == flowElement.Id)
         {
             return(flowElementsContainer);
         }
         if (flowElement is IFlowElementsContainer)
         {
             IFlowElementsContainer result = FindParent(childElement, (IFlowElementsContainer)flowElement);
             if (result != null)
             {
                 return(result);
             }
         }
     }
     return(null);
 }
Esempio n. 8
0
        protected FlowElement GetFlowElementInSubProcess(string id, SubProcess subProcess)
        {
            FlowElement foundFlowElement = subProcess.GetFlowElement(id);

            if (foundFlowElement == null)
            {
                foreach (FlowElement flowElement in subProcess.GetFlowElements())
                {
                    if (flowElement is SubProcess)
                    {
                        foundFlowElement = GetFlowElementInSubProcess(id, (SubProcess)flowElement);
                        if (foundFlowElement != null)
                        {
                            break;
                        }
                    }
                }
            }
            return(foundFlowElement);
        }
Esempio n. 9
0
 public IFlowElementsContainer FindParent(FlowElement childElement)
 {
     return(FindParent(childElement, this));
 }