示例#1
0
        public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (o == null || GetType() != o.GetType())
            {
                return(false);
            }

            ValuedDataObject otherObject = (ValuedDataObject)o;

            if (!otherObject.ItemSubjectRef.StructureRef.Equals(this.ItemSubjectRef.StructureRef))
            {
                return(false);
            }
            if (!otherObject.Id.Equals(this.Id))
            {
                return(false);
            }
            if (!otherObject.Name.Equals(this.Name))
            {
                return(false);
            }
            if (otherObject.GetValue() == null || this.value == null || (!otherObject.GetValue().Equals(this.value.ToString())))
            {
                return(false);
            }

            return(true);
        }
示例#2
0
        //public abstract ValuedDataObject Clone();

        public void SetValues(ValuedDataObject otherElement)
        {
            base.SetValues(otherElement);
            if (otherElement.GetValue() != null)
            {
                SetValue(otherElement.GetValue());
            }
        }
示例#3
0
        public void SetValues(SubProcess otherElement)
        {
            base.SetValues(otherElement);

            /*
             * This is required because data objects in Designer have no DI info and are added as properties, not flow elements
             *
             * Determine the differences between the 2 elements' data object
             */
            foreach (ValuedDataObject thisObject in DataObjects)
            {
                bool exists = false;
                foreach (ValuedDataObject otherObject in otherElement.DataObjects)
                {
                    if (thisObject.Id == otherObject.Id)
                    {
                        exists = true;
                    }
                }
                if (!exists)
                {
                    // missing object
                    RemoveFlowElement(thisObject.Id);
                }
            }

            dataObjects = new List <ValuedDataObject>();
            if (otherElement.DataObjects != null && otherElement.DataObjects.Count > 0)
            {
                foreach (ValuedDataObject dataObject in otherElement.DataObjects)
                {
                    ValuedDataObject clone = (ValuedDataObject)dataObject.Clone();
                    dataObjects.Add(clone);
                    // add it to the list of FlowElements
                    // if it is already there, remove it first so order is same as
                    // data object list
                    RemoveFlowElement(clone.Id);
                    AddFlowElement(clone);
                }
            }

            flowElementList.Clear();
            foreach (FlowElement flowElement in otherElement.FlowElements)
            {
                AddFlowElement(flowElement);
            }

            artifactList.Clear();
            foreach (Artifact artifact in otherElement.Artifacts)
            {
                AddArtifact(artifact);
            }
        }
示例#4
0
        public void SetValues(Process otherElement)
        {
            base.SetValues(otherElement);

            //    setBpmnModel(bpmnModel);
            name          = otherElement.Name;
            executable    = otherElement.IsExecutable;
            documentation = otherElement.Documentation;
            if (otherElement.IoSpecification != null)
            {
                ioSpecification = (IOSpecification)otherElement.IoSpecification.Clone();
            }

            executionListeners = new List <ActivitiListener>();
            if (otherElement.GetExecutionListeners() != null && otherElement.GetExecutionListeners().Count > 0)
            {
                foreach (ActivitiListener listener in otherElement.GetExecutionListeners())
                {
                    executionListeners.Add((ActivitiListener)listener.Clone());
                }
            }

            candidateStarterUsers = new List <string>();
            if (otherElement.CandidateStarterUsers != null && otherElement.CandidateStarterUsers.Count > 0)
            {
                candidateStarterUsers.AddRange(otherElement.CandidateStarterUsers);
            }

            candidateStarterGroups = new List <string>();
            if (otherElement.CandidateStarterGroups != null && otherElement.CandidateStarterGroups.Count > 0)
            {
                candidateStarterGroups.AddRange(otherElement.CandidateStarterGroups);
            }

            eventListeners = new List <EventListener>();
            if (otherElement.EventListeners != null && otherElement.EventListeners.Count > 0)
            {
                foreach (EventListener listener in otherElement.EventListeners)
                {
                    eventListeners.Add((EventListener)listener.Clone());
                }
            }

            /*
             * This is required because data objects in Designer have no DI info and are added as properties, not flow elements
             *
             * Determine the differences between the 2 elements' data object
             */
            foreach (ValuedDataObject thisObject in DataObjects)
            {
                bool exists = false;
                foreach (ValuedDataObject otherObject in otherElement.DataObjects)
                {
                    if (thisObject.Id == otherObject.Id)
                    {
                        exists = true;
                    }
                }
                if (!exists)
                {
                    // missing object
                    RemoveFlowElement(thisObject.Id);
                }
            }

            dataObjects = new List <ValuedDataObject>();
            if (otherElement.DataObjects != null && otherElement.DataObjects.Count > 0)
            {
                foreach (ValuedDataObject dataObject in otherElement.DataObjects)
                {
                    ValuedDataObject clone = (ValuedDataObject)dataObject.Clone();
                    dataObjects.Add(clone);
                    // add it to the list of FlowElements
                    // if it is already there, remove it first so order is same as
                    // data object list
                    RemoveFlowElement(clone.Id);
                    AddFlowElement(clone);
                }
            }
        }