Examples of BoundaryEvent


Examples of org.eclipse.bpmn2.BoundaryEvent

  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

Examples of org.eclipse.bpmn2.BoundaryEvent

    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

Examples of org.eclipse.bpmn2.BoundaryEvent

      }

      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

Examples of org.eclipse.bpmn2.BoundaryEvent

      }

      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

Examples of org.eclipse.bpmn2.BoundaryEvent

    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

Examples of org.eclipse.bpmn2.BoundaryEvent

  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

Examples of org.eclipse.bpmn2.BoundaryEvent

      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

Examples of org.eclipse.bpmn2.BoundaryEvent

      }

      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

Examples of org.eclipse.bpmn2.BoundaryEvent

    if (property != null && (Boolean) property) {
      IGaService gaService = Graphiti.getGaService();
      GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();
      gaService.setLocation(ga, ga.getX() + context.getDeltaX(), ga.getY() + context.getDeltaY());
    } else {
      BoundaryEvent event = BusinessObjectUtil.getFirstElementOfType(containerShape, BoundaryEvent.class);
      PictogramElement activityContainer = BusinessObjectUtil.getFirstBaseElementFromDiagram(getDiagram(),
          event.getAttachedToRef());
      PositionOnLine newPos = BoundaryEventPositionHelper.getPositionOnLineUsingAbsoluteCoordinates(
          containerShape, (Shape) activityContainer);
      BoundaryEventPositionHelper.assignPositionOnLineProperty(containerShape, newPos);
    }
View Full Code Here

Examples of org.eclipse.bpmn2.BoundaryEvent

  @Override
  public IReason updateNeeded(IUpdateContext context) {
    String cancelProperty = Graphiti.getPeService().getPropertyValue(context.getPictogramElement(),
            BOUNDARY_EVENT_CANCEL);
    BoundaryEvent event = (BoundaryEvent) getBusinessObjectForPictogramElement(context.getPictogramElement());
    boolean changed = Boolean.parseBoolean(cancelProperty) != event.isCancelActivity();
    IReason reason = changed ? Reason.createTrueReason("Boundary type changed") : Reason.createFalseReason();
    return reason;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.