Package org.eclipse.bpmn2

Examples of org.eclipse.bpmn2.BoundaryEvent


   
    addEventProperties(boundaryEvent, propertiesNode);
  }
 
  protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) {
    BoundaryEvent boundaryEvent = Bpmn2Factory.eINSTANCE.createBoundaryEvent();// BoundaryEvent();
    String stencilId = BpmnJsonConverterUtil.getStencilId(elementNode);
    if (STENCIL_EVENT_BOUNDARY_TIMER.equals(stencilId)) {
      boundaryEvent.setCancelActivity(getPropertyValueAsBoolean(PROPERTY_CANCEL_ACTIVITY, elementNode));
      convertJsonToTimerDefinition(elementNode, boundaryEvent);
    } else if (STENCIL_EVENT_BOUNDARY_ERROR.equals(stencilId)) {
      convertJsonToErrorDefinition(elementNode, boundaryEvent);
    } else if (STENCIL_EVENT_BOUNDARY_SIGNAL.equals(stencilId)) {
      boundaryEvent.setCancelActivity(getPropertyValueAsBoolean(PROPERTY_CANCEL_ACTIVITY, elementNode));
      convertJsonToSignalDefinition(elementNode, boundaryEvent);
    }
   
    Activity activityRef=BpmnModelUtil.getElement(model, lookForAttachedRef(elementNode.get(EDITOR_SHAPE_ID).asText(), modelNode.get(EDITOR_CHILD_SHAPES)),Activity.class);
   
    boundaryEvent.setAttachedToRef(activityRef);
    return boundaryEvent;
  }
View Full Code Here


                nodeProperties.put("node.type", "ExclusiveGateway");
            } else if (flowElement instanceof ParallelGateway) {

                nodeProperties.put("node.type", "ParallelGateway");
            } else if (flowElement instanceof BoundaryEvent) {
                BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }

                nodeProperties.put("node.type", "BoundaryEvent:"+eventDef);
            } else if (flowElement instanceof IntermediateCatchEvent) {
                IntermediateCatchEvent boundaryEvent = (IntermediateCatchEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }
                nodeProperties.put("node.type", "IntermediateCatchEvent:"+eventDef);
            } else if (flowElement instanceof IntermediateThrowEvent) {
                IntermediateThrowEvent boundaryEvent = (IntermediateThrowEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }
                nodeProperties.put("node.type", "IntermediateThrowEvent:"+eventDef);
            } else if (flowElement instanceof StartEvent) {
                StartEvent boundaryEvent = (StartEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }
                nodeProperties.put("node.type", "StartEvent:"+eventDef);
            } else if (flowElement instanceof EndEvent) {
                EndEvent boundaryEvent = (EndEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }
View Full Code Here

                nodeProperties.put("node.type", "ExclusiveGateway");
            } else if (flowElement instanceof ParallelGateway) {

                nodeProperties.put("node.type", "ParallelGateway");
            } else if (flowElement instanceof BoundaryEvent) {
                BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }

                nodeProperties.put("node.type", "BoundaryEvent:"+eventDef);
            } else if (flowElement instanceof IntermediateCatchEvent) {
                IntermediateCatchEvent boundaryEvent = (IntermediateCatchEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }
                nodeProperties.put("node.type", "IntermediateCatchEvent:"+eventDef);
            } else if (flowElement instanceof IntermediateThrowEvent) {
                IntermediateThrowEvent boundaryEvent = (IntermediateThrowEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }
                nodeProperties.put("node.type", "IntermediateThrowEvent:"+eventDef);
            } else if (flowElement instanceof StartEvent) {
                StartEvent boundaryEvent = (StartEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }
                nodeProperties.put("node.type", "StartEvent:"+eventDef);
            } else if (flowElement instanceof EndEvent) {
                EndEvent boundaryEvent = (EndEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }
View Full Code Here

  public void doWork(Activity activity, Diagram diagram) {
    IPeService peService = Graphiti.getPeService();
    Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
    for (PictogramElement e : elements) {
      BoundaryEvent boundaryEvent = BusinessObjectUtil.getFirstElementOfType(e, BoundaryEvent.class);
      if (boundaryEvent != null && activity.getBoundaryEventRefs().contains(boundaryEvent)) {
        ContainerShape container = (ContainerShape) e;
        doWorkInternal(container);
      }
    }
View Full Code Here

    return bo != null && bo instanceof Activity;
  }

  @Override
  public PictogramElement add(IAddContext context) {
    BoundaryEvent event = (BoundaryEvent) context.getNewObject();

    Object prop = context.getProperty(DIImport.IMPORT_PROPERTY);
    boolean importing = prop != null && (Boolean) prop;
    ContainerShape target = importing ? context.getTargetContainer() : (ContainerShape) context
            .getTargetContainer().eContainer();

    ContainerShape containerShape = peService.createContainerShape(target, true);
    Ellipse ellipse = gaService.createEllipse(containerShape);
    StyleUtil.applyBGStyle(ellipse, this);

    if (importing) { // if loading from DI then place according to context
      gaService.setLocationAndSize(ellipse, context.getX(), context.getY(), EVENT_SIZE, EVENT_SIZE);
    } else { // otherwise place it in the center of shape for user to adjust it
      GraphicsAlgorithm ga = context.getTargetContainer().getGraphicsAlgorithm();
      int x = ga.getX() + context.getX() - (EVENT_SIZE / 2);
      int y = ga.getY() + context.getY() - (EVENT_SIZE / 2);
      gaService.setLocationAndSize(ellipse, x, y, EVENT_SIZE, EVENT_SIZE);
    }

    Ellipse circle = GraphicsUtil.createIntermediateEventCircle(ellipse);
    circle.setStyle(StyleUtil.getStyleForClass(getDiagram()));
    createDIShape(containerShape, event);

    ChopboxAnchor anchor = peService.createChopboxAnchor(containerShape);
    anchor.setReferencedGraphicsAlgorithm(ellipse);
    AnchorUtil.addFixedPointAnchors(containerShape, ellipse);

    Activity activity = event.getAttachedToRef();
    PictogramElement foundElem = BusinessObjectUtil.getFirstBaseElementFromDiagram(getDiagram(), activity);
    if (foundElem != null && foundElem instanceof ContainerShape) {
      ContainerShape activityContainer = (ContainerShape) foundElem;
      PositionOnLine pos = BoundaryEventPositionHelper.getPositionOnLineUsingBPMNShape(containerShape,
              activityContainer);
View Full Code Here

      }

      Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());

      if (e instanceof BoundaryEvent) {
        BoundaryEvent be = (BoundaryEvent) e;
        return be.isCancelActivity();
      }

      if (e instanceof CatchEvent || e instanceof IntermediateThrowEvent) {
        return false;
      }
View Full Code Here

      }

      Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());

      if (e instanceof BoundaryEvent) {
        BoundaryEvent be = (BoundaryEvent) e;
        return be.isCancelActivity();
      }

      if (e instanceof StartEvent) {
        if (((StartEvent) e).isIsInterrupting() == false) {
          return false;
View Full Code Here

    return BoundaryEventPositionHelper.canCreateEventAt(context, ga, 10);
  }

  @Override
  public Object[] create(ICreateContext context) {
    BoundaryEvent event = null;
    try {
      Activity activity = (Activity) getBusinessObjectForPictogramElement(context.getTargetContainer());
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      event = ModelHandler.FACTORY.createBoundaryEvent();
//      event.setId(EcoreUtil.generateUUID());
      event.setAttachedToRef(activity);
      event.setName("Boundary event");
      event.setCancelActivity(true); // by default is interrupting
      Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
      if (bo instanceof FlowElementsContainer) {
        bo = getBusinessObjectForPictogramElement((PictogramElement) context.getTargetContainer().eContainer());
      }
      handler.addFlowElement(bo, event);
View Full Code Here

  public boolean layout(ILayoutContext context) {
    boolean layout = false;

    PictogramElement element = context.getPictogramElement();
    GraphicsAlgorithm eventGa = element.getGraphicsAlgorithm();
    BoundaryEvent event = BusinessObjectUtil.getFirstElementOfType(element, BoundaryEvent.class);

    PictogramElement activityContainer = BusinessObjectUtil.getFirstBaseElementFromDiagram(getDiagram(),
            event.getAttachedToRef());
    GraphicsAlgorithm activityGa = activityContainer.getGraphicsAlgorithm();

    PositionOnLine pos = BoundaryEventPositionHelper.getPositionOnLineProperty(element);

    switch (pos.getLineType()) {
View Full Code Here

      ILocation loc = peService.getLocationRelativeToDiagram(context.getTargetContainer());
      x += loc.getX();
      y += loc.getY();
    }

    BoundaryEvent event = BusinessObjectUtil.getFirstElementOfType(context.getShape(), BoundaryEvent.class);
    GraphicsAlgorithm eventGa = context.getShape().getGraphicsAlgorithm();
    ContainerShape activityContainer = (ContainerShape) BusinessObjectUtil.getFirstBaseElementFromDiagram(diagram,
            event.getAttachedToRef());
    GraphicsAlgorithm activityGa = activityContainer.getGraphicsAlgorithm();
    ILocation activityLoc = peService.getLocationRelativeToDiagram(activityContainer);

    if (!(activityContainer.equals(context.getTargetContainer()) || activityContainer.eContainer().equals(
            context.getTargetContainer()))) {
View Full Code Here

TOP

Related Classes of org.eclipse.bpmn2.BoundaryEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.