Package org.eclipse.bpmn2.modeler.core

Examples of org.eclipse.bpmn2.modeler.core.ModelHandler


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


  @Override
    public Object[] create(ICreateContext context) {
    Participant p = null;
   
    try {
          ModelHandler mh = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
          p = mh.addParticipant();
          p.setName("Pool nr " + index++);
        } catch (IOException e) {
          Activator.logError(e);
        }
       
View Full Code Here

  private void modifyModelStructure(IMoveShapeContext context) {
    Lane movedLane = getMovedLane(context);
    Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());

    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      handler.moveLane(movedLane, targetParticipant);
    } catch (IOException e) {
      Activator.logError(e);
    }

    Process process = targetParticipant.getProcessRef();
View Full Code Here

  private void modifyModelStructure(IMoveShapeContext context) {
    try {
      Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context
          .getTargetContainer());
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      Lane movedLane = getMovedLane(context);
      handler.moveLane(movedLane, targetParticipant);
      Participant internalParticipant = handler.getParticipant(getDiagram());
      LaneSet laneSet = null;
      for (LaneSet set : internalParticipant.getProcessRef().getLaneSets()) {
        if (set.getLanes().contains(movedLane)) {
          laneSet = set;
          break;
View Full Code Here

    Lane movedLane = getMovedLane(context);
    Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
    Participant internalParticipant = null;

    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      internalParticipant = handler.getInternalParticipant();
      handler.moveLane(movedLane, internalParticipant);
    } catch (IOException e) {
      Activator.logError(e);
    }

    LaneSet laneSet = null;
View Full Code Here

  private void modifyModelStructure(IMoveShapeContext context) {
    Lane movedLane = getMovedLane(context);
    Lane toLane = getTargetLane(context);

    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      Participant participant = handler.getParticipant(toLane);
      handler.moveLane(movedLane, participant);
    } catch (IOException e) {
      Activator.logError(e);
    }

    Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
View Full Code Here

  protected void decorateContainerRect(RoundedRectangle containerRect) {
  }

  protected void addedFromImport(ChoreographyActivity choreography, ContainerShape choreographyContainer,
      IAddContext context) {
    ModelHandler mh = null;

    try {
      mh = ModelHandler.getInstance(getDiagram());
    } catch (IOException e) {
      Activator.logError(e);
      return;
    }

    List<Participant> participants = choreography.getParticipantRefs();
    List<BPMNShape> shapes = mh.getAll(BPMNShape.class);
    List<BPMNShape> filteredShapes = new ArrayList<BPMNShape>();
    BPMNShape choreoBpmnShape = null;

    for (BPMNShape shape : shapes) {
      if (shape.getBpmnElement().equals(choreography)) {
View Full Code Here

  private void modifyModelStructure(IMoveShapeContext context) {
    Lane movedLane = getMovedLane(context);
    Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());

    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      handler.moveLane(movedLane, targetParticipant);
    } catch (IOException e) {
      Activator.logError(e);
    }

    Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
View Full Code Here

  @Override
  public Object[] create(ICreateContext context) {
    TextAnnotation ta = null;

    try {
      ModelHandler mh = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
      ta = ModelHandler.FACTORY.createTextAnnotation();
//      ta.setId(EcoreUtil.generateUUID());
      mh.addArtifact(FeatureSupport.getTargetParticipant(context, mh), ta);
      ta.setText("Enter your comment here");
    } catch (IOException e) {
      Activator.logError(e);
    }
View Full Code Here

  @Override
  public Object[] create(ICreateContext context) {
    Conversation c = null;
    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      c = ModelHandler.FACTORY.createConversation();
//      c.setId(EcoreUtil.generateUUID());
      c.setName("Conversation");
      handler.addConversationNode(c);
      ModelUtil.setID(c);
    } catch (IOException e) {
      Activator.logError(e);
    }
    addGraphicalRepresentation(context, c);
View Full Code Here

TOP

Related Classes of org.eclipse.bpmn2.modeler.core.ModelHandler

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.