Esempio n. 1
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);
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void getChildElementsByTypeForAlternativeNs()
        public virtual void getChildElementsByTypeForAlternativeNs()
        {
            ModelElementInstance birdo = modelInstance.getModelElementById("birdo");

            assertThat(birdo, @is(notNullValue()));
            ICollection <Wings> elements = birdo.getChildElementsByType(typeof(Wings));

            assertThat(elements.Count, @is(1));
            assertThat(elements.GetEnumerator().next().TextContent, @is("zisch"));
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testAddUnknownAnimal()
        public virtual void testAddUnknownAnimal()
        {
            ModelInstanceImpl modelInstanceImpl = (ModelInstanceImpl)modelInstance;
            ModelElementType  unknownAnimalType = modelInstanceImpl.registerGenericType(MODEL_NAMESPACE, "unknownAnimal");
            ModelElementType  animalsType       = modelInstance.Model.getType(typeof(Animals));
            ModelElementType  animalType        = modelInstance.Model.getType(typeof(Animal));

            ModelElementInstance unknownAnimal = modelInstance.newInstance(unknownAnimalType);

            assertThat(unknownAnimal).NotNull;
            unknownAnimal.setAttributeValue("id", "new-animal", true);
            unknownAnimal.setAttributeValue("gender", "Unknown");
            unknownAnimal.setAttributeValue("species", "unknown");

            ModelElementInstance         animals             = modelInstance.getModelElementsByType(animalsType).GetEnumerator().next();
            IList <ModelElementInstance> childElementsByType = new List <ModelElementInstance>(animals.getChildElementsByType(animalType));

            animals.insertElementAfter(unknownAnimal, childElementsByType[2]);
            assertThat(animals.getChildElementsByType(unknownAnimalType)).hasSize(3);
        }
Esempio n. 4
0
        protected internal virtual void addProcessDefinitionToCacheAndRetrieveDocumentation(IList <ProcessDefinition> list)
        {
            foreach (ProcessDefinition processDefinition in list)
            {
                BpmnModelInstance bpmnModelInstance = Context.ProcessEngineConfiguration.DeploymentCache.findBpmnModelInstanceForProcessDefinition((ProcessDefinitionEntity)processDefinition);

                ModelElementInstance processElement = bpmnModelInstance.getModelElementById(processDefinition.Key);
                if (processElement != null)
                {
                    ICollection <Documentation> documentations = processElement.getChildElementsByType(typeof(Documentation));
                    IList <string> docStrings = new List <string>();
                    foreach (Documentation documentation in documentations)
                    {
                        docStrings.Add(documentation.TextContent);
                    }

                    ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity)processDefinition;
                    processDefinitionEntity.setProperty(BpmnParse.PROPERTYNAME_DOCUMENTATION, BpmnParse.parseDocumentation(docStrings));
                }
            }
        }
Esempio n. 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testAddChildToUnknownAnimal()
        public virtual void testAddChildToUnknownAnimal()
        {
            assertThat(wanda.getChildElementsByType(flipper.ElementType)).hasSize(0);
            wanda.insertElementAfter(flipper, null);
            assertThat(wanda.getChildElementsByType(flipper.ElementType)).hasSize(1);
        }