Package org.eclipse.bpmn2

Examples of org.eclipse.bpmn2.BaseElement


  @Override
  public PictogramElement add(IAddContext context) {
    IPeService peService = Graphiti.getPeService();
    IGaService gaService = Graphiti.getGaService();

    BaseElement element = (BaseElement) context.getNewObject();
    IAddConnectionContext addConContext = (IAddConnectionContext) context;

    Connection connection = peService.createFreeFormConnection(getDiagram());

    Object importProp = context.getProperty(DIImport.IMPORT_PROPERTY);
View Full Code Here


    }

    @Override
    public boolean canReconnect(IReconnectionContext context) {
      if (super.canReconnect(context)) {
        BaseElement targetElement = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), BaseElement.class);
        return targetElement instanceof Participant;
      }
      return false;
    }
View Full Code Here

    }

    @Override
    public boolean canReconnect(IReconnectionContext context) {
      if (super.canReconnect(context)) {
        BaseElement targetElement = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), BaseElement.class);
        return targetElement instanceof FlowNode;
      }
      return false;
    }
View Full Code Here

    public void dragStart(DragSourceEvent event) {
      if (((IStructuredSelection) viewer.getSelection()).getFirstElement() instanceof TreeObject) {

        IStructuredSelection iStructuredSelection = (IStructuredSelection) viewer.getSelection();
        TreeObject treeObject = (TreeObject) iStructuredSelection.getFirstElement();
        BaseElement baseElement = treeObject.getBaseElement();
        LocalSelectionTransfer.getTransfer().setSelection(new StructuredSelection(baseElement));
      }

    }
View Full Code Here

  @Override
  public void removeBendpoint(IRemoveBendpointContext context) {
      super.removeBendpoint(context);
      try {
      FreeFormConnection connection = context.getConnection();
      BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
      ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
      BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(getDiagram(), element);
      edge.getWaypoint().remove(context.getBendpointIndex() + 1);
    } catch (Exception e) {
      Activator.logError(e);
View Full Code Here

  @Override
  public void addBendpoint(IAddBendpointContext context) {
    super.addBendpoint(context);
    try {
      FreeFormConnection connection = context.getConnection();
      BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
      ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());

      Point p = DcFactory.eINSTANCE.createPoint();
      p.setX(context.getX());
      p.setY(context.getY());
View Full Code Here

  @Override
  public boolean moveBendpoint(IMoveBendpointContext context) {
    boolean moved = super.moveBendpoint(context);
    try {
      FreeFormConnection connection = context.getConnection();
      BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
      ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
      BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(getDiagram(), element);
      int index = context.getBendpointIndex() + 1;
      Point p = edge.getWaypoint().get(index);
      p.setX(context.getX());
View Full Code Here

                // targetId = parser.getText();
                // parser.nextToken(); // }, closing the object
            }
        }
        properties.put("resourceId", resourceId);
        BaseElement baseElt = Bpmn20Stencil.createElement(stencil, properties.get("tasktype"));

        // register the sequence flow targets.
        if (baseElt instanceof SequenceFlow) {
            _sequenceFlowTargets.addAll(outgoing);
        }
View Full Code Here

    public void testIntermediateCatchMessageEventUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("intermediateCatchMessageEvent.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 3);
        Process process = getRootProcess(definitions);
        CatchEvent g = (CatchEvent) process.getFlowElements().get(0);
        assertEquals("catch message event", g.getName());
        assertTrue(g.getEventDefinitions().iterator().next() instanceof MessageEventDefinition);
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

    public void testIntermediateCatchTimerEventUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("intermediateCatchTimerEvent.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = getRootProcess(definitions);
        CatchEvent g = (CatchEvent) process.getFlowElements().get(0);
        assertEquals("catch timer event", g.getName());
        assertTrue(g.getEventDefinitions().iterator().next() instanceof TimerEventDefinition);
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

TOP

Related Classes of org.eclipse.bpmn2.BaseElement

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.