Esempio n. 1
0
        public virtual EventSubProcessBuilder eventSubProcess(string id)
        {
            // Create a subprocess, triggered by an event, and add it to modelInstance
            SubProcess subProcess = subProcessBuilder.createChild(typeof(SubProcess), id);

            subProcess.TriggeredByEvent = true;

            // Create Bpmn shape so subprocess will be drawn
            BpmnShape targetBpmnShape = subProcessBuilder.createBpmnShape(subProcess);

            //find the lowest shape in the process
            // place event sub process underneath
            Coordinates = targetBpmnShape;

            subProcessBuilder.resizeSubProcess(targetBpmnShape);

            // Return the eventSubProcessBuilder
            EventSubProcessBuilder eventSubProcessBuilder = new EventSubProcessBuilder(subProcessBuilder.modelInstance, subProcess);

            return(eventSubProcessBuilder);
        }
Esempio n. 2
0
        public virtual StartEventBuilder startEvent(string id)
        {
            StartEvent start = subProcessBuilder.createChild(typeof(StartEvent), id);

            BpmnShape startShape      = subProcessBuilder.createBpmnShape(start);
            BpmnShape subProcessShape = subProcessBuilder.findBpmnShape(subProcessBuilder.Element);

            if (subProcessShape != null)
            {
                Bounds subProcessBounds = subProcessShape.Bounds;
                Bounds startBounds      = startShape.Bounds;

                double subProcessX      = subProcessBounds.getX().Value;
                double subProcessY      = subProcessBounds.getY().Value;
                double subProcessHeight = subProcessBounds.getHeight().Value;
                double startHeight      = startBounds.getHeight().Value;

                startBounds.setX(subProcessX + SPACE);
                startBounds.setY(subProcessY + subProcessHeight / 2 - startHeight / 2);
            }

            return(start.builder());
        }