示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testRemoveChildOfUnknownAnimal()
        public virtual void testRemoveChildOfUnknownAnimal()
        {
            assertThat(wanda.removeChildElement(flipper)).False;
            wanda.insertElementAfter(flipper, null);
            assertThat(wanda.removeChildElement(flipper)).True;
            assertThat(wanda.getChildElementsByType(flipper.ElementType)).Empty;
        }
示例#2
0
        public virtual ModifiableBpmnModelInstance removeFlowNode(string flowNodeId)
        {
            FlowNode             flowNode = getModelElementById(flowNodeId);
            ModelElementInstance scope    = flowNode.ParentElement;

            foreach (SequenceFlow outgoingFlow in flowNode.Outgoing)
            {
                removeBpmnEdge(outgoingFlow);
                scope.removeChildElement(outgoingFlow);
            }
            foreach (SequenceFlow incomingFlow in flowNode.Incoming)
            {
                removeBpmnEdge(incomingFlow);
                scope.removeChildElement(incomingFlow);
            }
            ICollection <Association> associations = scope.getChildElementsByType(typeof(Association));

            foreach (Association association in associations)
            {
                if (flowNode.Equals(association.Source) || flowNode.Equals(association.Target))
                {
                    removeBpmnEdge(association);
                    scope.removeChildElement(association);
                }
            }

            removeBpmnShape(flowNode);
            scope.removeChildElement(flowNode);

            return(this);
        }
示例#3
0
        protected internal virtual void removeBpmnShape(FlowNode flowNode)
        {
            ICollection <BpmnShape> bpmnShapes = modelInstance.getModelElementsByType(typeof(BpmnShape));

            foreach (BpmnShape shape in bpmnShapes)
            {
                if (shape.BpmnElement.Equals(flowNode))
                {
                    ModelElementInstance bpmnPlane = shape.ParentElement;
                    bpmnPlane.removeChildElement(shape);
                    break;
                }
            }
        }
示例#4
0
        protected internal virtual void removeBpmnEdge(BaseElement element)
        {
            ICollection <BpmnEdge> edges = modelInstance.getModelElementsByType(typeof(BpmnEdge));

            foreach (BpmnEdge edge in edges)
            {
                if (edge.BpmnElement.Equals(element))
                {
                    ModelElementInstance bpmnPlane = edge.ParentElement;
                    bpmnPlane.removeChildElement(edge);
                    break;
                }
            }
        }