コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBpmnDiagram()
        public virtual void testBpmnDiagram()
        {
            ICollection <BpmnDiagram> diagrams = modelInstance.getModelElementsByType(typeof(BpmnDiagram));

            assertThat(diagrams).hasSize(1);
            BpmnDiagram diagram = diagrams.GetEnumerator().next();

            assertThat(diagram.BpmnPlane).NotNull;
            assertThat(diagram.BpmnPlane.BpmnElement).isEqualTo(collaboration);
            assertThat(diagram.BpmnLabelStyles).hasSize(1);
        }
コード例 #2
0
        public void BPMNDiagram_Populate()
        {
            BpmnDiagram diagram = new BpmnDiagram {
                BPMNPlane      = new BpmnPlane(),
                BPMNLabelStyle = new BpmnLabelStyle[0] {
                }
            };

            Assert.NotNull(diagram.BPMNPlane);
            Assert.NotNull(diagram.BPMNLabelStyle);
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGeneratePlaneForProcess()
        public virtual void shouldGeneratePlaneForProcess()
        {
            // when
            instance = Bpmn.createExecutableProcess("process").done();

            // then
            ICollection <BpmnDiagram> bpmnDiagrams = instance.getModelElementsByType(typeof(BpmnDiagram));

            assertEquals(1, bpmnDiagrams.Count);

            BpmnDiagram diagram = bpmnDiagrams.GetEnumerator().next();

            assertNotNull(diagram.Id);

            assertNotNull(diagram.BpmnPlane);
            assertEquals(diagram.BpmnPlane.BpmnElement, instance.getModelElementById("process"));
        }
コード例 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCreateValidBpmnDi()
        public virtual void shouldCreateValidBpmnDi()
        {
            modelInstance = Bpmn.createProcess("process").startEvent("start").sequenceFlowId("flow").endEvent("end").done();

            process      = modelInstance.getModelElementById("process");
            startEvent   = modelInstance.getModelElementById("start");
            sequenceFlow = modelInstance.getModelElementById("flow");
            endEvent     = modelInstance.getModelElementById("end");

            // create bpmn diagram
            BpmnDiagram bpmnDiagram = modelInstance.newInstance(typeof(BpmnDiagram));

            bpmnDiagram.Id            = "diagram";
            bpmnDiagram.Name          = "diagram";
            bpmnDiagram.Documentation = "bpmn diagram element";
            bpmnDiagram.Resolution    = 120.0;
            modelInstance.Definitions.addChildElement(bpmnDiagram);

            // create plane for process
            BpmnPlane processPlane = modelInstance.newInstance(typeof(BpmnPlane));

            processPlane.Id          = "plane";
            processPlane.BpmnElement = process;
            bpmnDiagram.BpmnPlane    = processPlane;

            // create shape for start event
            BpmnShape startEventShape = modelInstance.newInstance(typeof(BpmnShape));

            startEventShape.Id          = "startShape";
            startEventShape.BpmnElement = startEvent;
            processPlane.DiagramElements.Add(startEventShape);

            // create bounds for start event shape
            Bounds startEventBounds = modelInstance.newInstance(typeof(Bounds));

            startEventBounds.setHeight(36.0);
            startEventBounds.setWidth(36.0);
            startEventBounds.setX(632.0);
            startEventBounds.setY(312.0);
            startEventShape.Bounds = startEventBounds;

            // create shape for end event
            BpmnShape endEventShape = modelInstance.newInstance(typeof(BpmnShape));

            endEventShape.Id          = "endShape";
            endEventShape.BpmnElement = endEvent;
            processPlane.DiagramElements.Add(endEventShape);

            // create bounds for end event shape
            Bounds endEventBounds = modelInstance.newInstance(typeof(Bounds));

            endEventBounds.setHeight(36.0);
            endEventBounds.setWidth(36.0);
            endEventBounds.setX(718.0);
            endEventBounds.setY(312.0);
            endEventShape.Bounds = endEventBounds;

            // create edge for sequence flow
            BpmnEdge flowEdge = modelInstance.newInstance(typeof(BpmnEdge));

            flowEdge.Id            = "flowEdge";
            flowEdge.BpmnElement   = sequenceFlow;
            flowEdge.SourceElement = startEventShape;
            flowEdge.TargetElement = endEventShape;
            processPlane.DiagramElements.Add(flowEdge);

            // create waypoints for sequence flow edge
            Waypoint startWaypoint = modelInstance.newInstance(typeof(Waypoint));

            startWaypoint.X = 668.0;
            startWaypoint.Y = 330.0;
            flowEdge.Waypoints.add(startWaypoint);

            Waypoint endWaypoint = modelInstance.newInstance(typeof(Waypoint));

            endWaypoint.X = 718.0;
            endWaypoint.Y = 330.0;
            flowEdge.Waypoints.add(endWaypoint);
        }