Package it.unito.di.artifact.examples.cnpFirst

Examples of it.unito.di.artifact.examples.cnpFirst.CNPArtifact$Participant


    }
  }

  private static String getMessageName(List<MessageFlow> messageFlows, List<ContainerShape> bands) {
    for (ContainerShape band : bands) {
      Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
      BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
      if (bpmnShape.isIsMessageVisible()) {
        for (MessageFlow flow : messageFlows) {
          if (flow.getSourceRef().equals(participant)) {
            return flow.getName();
View Full Code Here


    return context.getTargetContainer() instanceof Diagram;
    }

  @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);
        }
       
        addGraphicalRepresentation(context, p);
View Full Code Here

    FeatureSupport.redraw(context.getSourceContainer());
  }

  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();
    if (process.getLaneSets().isEmpty()) {
      LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
//      createLaneSet.setId(EcoreUtil.generateUUID());
      process.getLaneSets().add(createLaneSet);
      ModelUtil.setID(createLaneSet);
View Full Code Here

    super(fp);
  }

  @Override
  public boolean canMoveShape(IMoveShapeContext context) {
    Participant p = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());

    if (getMovedLane(context).getFlowNodeRefs().isEmpty()) {
      return true;
    }

    if (p.getProcessRef() == null) {
      return true;
    }

    if (!p.getProcessRef().getLaneSets().isEmpty()) {
      return true;
    }

    return false;
  }
View Full Code Here

    FeatureSupport.redraw(context.getTargetContainer());
  }

  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;
        }
      }
      if (laneSet != null) {
        laneSet.getLanes().remove(movedLane);
        if (laneSet.getLanes().isEmpty()) {
          internalParticipant.getProcessRef().getLaneSets().remove(laneSet);
        }

        Process process = targetParticipant.getProcessRef();
        if (process.getLaneSets().isEmpty()) {
          LaneSet claneSet = ModelHandler.FACTORY.createLaneSet();
View Full Code Here

    FeatureSupport.redraw(context.getSourceContainer());
  }

  private void modifyModelStructure(IMoveShapeContext context) {
    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;
    for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
      if (set.getLanes().contains(movedLane)) {
        laneSet = set;
        break;
      }
    }

    if (laneSet != null) {
      laneSet.getLanes().remove(movedLane);
      if (laneSet.getLanes().isEmpty()) {
        sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
      }

      Process process = internalParticipant.getProcessRef();
      if (process.getLaneSets().isEmpty()) {
        LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
//        createLaneSet.setId(EcoreUtil.generateUUID());
        process.getLaneSets().add(createLaneSet);
        ModelUtil.setID(createLaneSet);
View Full Code Here

    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());

    LaneSet laneSet = null;
    for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
      if (set.getLanes().contains(movedLane)) {
        laneSet = set;
        break;
      }
    }

    if (laneSet != null) {
      laneSet.getLanes().remove(movedLane);
      if (laneSet.getLanes().isEmpty()) {
        sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
      }
    }

    if (toLane.getChildLaneSet() == null) {
      LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
View Full Code Here

    super(fp);
  }

  @Override
  public boolean canMoveShape(IMoveShapeContext context) {
    Participant p1 = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
    Participant p2 = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());

    if (p1.equals(p2)) {
      return false;
    }

    if (getMovedLane(context).getFlowNodeRefs().isEmpty()) {
      return true;
    }

    if (p2.getProcessRef() == null) {
      return true;
    }

    if (!p2.getProcessRef().getLaneSets().isEmpty()) {
      return true;
    }

    return false;
  }
View Full Code Here

    FeatureSupport.redraw(context.getTargetContainer());
  }

  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());

    LaneSet laneSet = null;
    for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
      if (set.getLanes().contains(movedLane)) {
        laneSet = set;
        break;
      }
    }

    if (laneSet != null) {
      laneSet.getLanes().remove(movedLane);
      if (laneSet.getLanes().isEmpty()) {
        sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
      }

      Process process = targetParticipant.getProcessRef();
      if (process.getLaneSets().isEmpty()) {
        LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
View Full Code Here

    ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
        ChoreographyActivity.class);

    String id = peService.getPropertyValue(context.getPictogramElement(), INITIATING_PARTICIPANT_REF);
    Participant participant = choreography.getInitiatingParticipantRef();

    if ((id == null || id.equals("null")) && participant == null) {
      return Reason.createFalseReason();
    }

    if (participant != null && (id != null && id.equals(participant.getId()))) {
      return Reason.createFalseReason();
    }

    return Reason.createTrueReason();
  }
View Full Code Here

TOP

Related Classes of it.unito.di.artifact.examples.cnpFirst.CNPArtifact$Participant

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.