Examples of ChoreographyActivity


Examples of org.eclipse.bpmn2.ChoreographyActivity

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.CHOREOGRAPHY_ACTIVITY: {
            ChoreographyActivity choreographyActivity = (ChoreographyActivity) theEObject;
            T result = caseChoreographyActivity(choreographyActivity);
            if (result == null)
                result = caseFlowNode(choreographyActivity);
            if (result == null)
                result = caseFlowElement(choreographyActivity);
View Full Code Here

Examples of org.eclipse.bpmn2.ChoreographyActivity

  public static void updateParticipantReferences(ContainerShape choreographyContainer,
      List<ContainerShape> currentParticipantContainers, List<Participant> newParticipants, IFeatureProvider fp,
      boolean showNames) {

    Diagram diagram = peService.getDiagramForShape(choreographyContainer);
    ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
        ChoreographyActivity.class);

    BPMNDiagram dia = BusinessObjectUtil.getFirstElementOfType(diagram, BPMNDiagram.class);
    List<DiagramElement> diElements = dia.getPlane().getPlaneElement();
    for (int i = 0; i < currentParticipantContainers.size(); i++) {
View Full Code Here

Examples of org.eclipse.bpmn2.ChoreographyActivity

  }

  @Override
  public IReason updateNeeded(IUpdateContext context) {
    ContainerShape choreographyContainer = (ContainerShape) context.getPictogramElement();
    ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
        ChoreographyActivity.class);

    String loopType = choreography.getLoopType() == null ? "null" : choreography.getLoopType().getName();
    String property = peService.getPropertyValue(choreographyContainer, ChoreographyProperties.CHOREOGRAPHY_MARKER);

    if (!loopType.equals(property)) {
      return Reason.createTrueReason();
    } else {
View Full Code Here

Examples of org.eclipse.bpmn2.ChoreographyActivity

  }

  @Override
  public boolean update(IUpdateContext context) {
    ContainerShape choreographyContainer = (ContainerShape) context.getPictogramElement();
    ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
        ChoreographyActivity.class);

    for (Shape s : peService.getAllContainedShapes(choreographyContainer)) {
      String property = peService.getPropertyValue(s, ChoreographyProperties.CHOREOGRAPHY_MARKER_SHAPE);
      if (property != null && new Boolean(property)) {
        ChoreographyUtil.drawChoreographyLoopType((ContainerShape) s, choreography.getLoopType());
      }
    }

    String loopType = choreography.getLoopType() == null ? "null" : choreography.getLoopType().getName();
    peService.setPropertyValue(choreographyContainer, ChoreographyProperties.CHOREOGRAPHY_MARKER, loopType);

    return true;
  }
View Full Code Here

Examples of org.eclipse.bpmn2.ChoreographyActivity

  }

  @Override
  public IReason updateNeeded(IUpdateContext context) {

    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();
    }
View Full Code Here

Examples of org.eclipse.bpmn2.ChoreographyActivity

  @Override
  public boolean update(IUpdateContext context) {

    ContainerShape container = (ContainerShape) context.getPictogramElement();

    ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(container,
        ChoreographyActivity.class);

    boolean hasInitiatingParticipant = choreography.getInitiatingParticipantRef() != null;

    for (ContainerShape band : ChoreographyUtil.getParticipantBandContainerShapes(container)) {
      Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
      boolean isInitiating = hasInitiatingParticipant
          && participant.equals(choreography.getInitiatingParticipantRef());
      Color color = manageColor(isInitiating ? IColorConstant.WHITE : IColorConstant.LIGHT_GRAY);
      band.getGraphicsAlgorithm().setBackground(color);
      BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
      bpmnShape.setParticipantBandKind(getParticipantBandKind(isInitiating, bpmnShape.getParticipantBandKind()));
    }

    Participant initiatingParticipant = choreography.getInitiatingParticipantRef();
    String id = initiatingParticipant == null ? "null" : initiatingParticipant.getId();
    peService.setPropertyValue(context.getPictogramElement(), INITIATING_PARTICIPANT_REF, id);

    return true;
  }
View Full Code Here

Examples of org.eclipse.bpmn2.ChoreographyActivity

    return context.getTargetContainer().equals(getDiagram());
  }

  @Override
  public PictogramElement add(IAddContext context) {
    ChoreographyActivity choreography = (ChoreographyActivity) context.getNewObject();

    int width = context.getWidth() > 0 ? context.getWidth() : 150;
    int height = context.getHeight() > 0 ? context.getHeight() : 150;

    ContainerShape choreographyContainer = peService.createContainerShape(context.getTargetContainer(), true);
    RoundedRectangle containerRect = gaService.createRoundedRectangle(choreographyContainer, R, R);
    gaService.setLocationAndSize(containerRect, context.getX(), context.getY(), width, height);
    StyleUtil.applyBGStyle(containerRect, this);
    decorateContainerRect(containerRect);

    Object importProperty = context.getProperty(DIImport.IMPORT_PROPERTY);
    if (importProperty != null && (Boolean) importProperty) {
      addedFromImport(choreography, choreographyContainer, context);
    }

    Shape nameShape = peService.createShape(choreographyContainer, false);

    Text text = gaService.createDefaultText(getDiagram(), nameShape);
    text.setValue(choreography.getName());
    text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
    text.getFont().setBold(false);
    setTextLocation(choreographyContainer, text, width, height);
View Full Code Here

Examples of org.eclipse.bpmn2.ChoreographyActivity

    return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyActivity.class);
  }

  @Override
  public IReason updateNeeded(IUpdateContext context) {
    ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
        ChoreographyActivity.class);

    if (!ChoreographyUtil.getParticipantRefIds(choreography).equals(getParticipantRefIds(context))) {
      return Reason.createTrueReason();
    } else {
View Full Code Here

Examples of org.eclipse.bpmn2.ChoreographyActivity

    }
  }

  @Override
  public boolean update(IUpdateContext context) {
    ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
        ChoreographyActivity.class);
    ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
    List<Participant> participants = choreography.getParticipantRefs();
    List<ContainerShape> bandContainerShapes = ChoreographyUtil
        .getParticipantBandContainerShapes((ContainerShape) context.getPictogramElement());

    ChoreographyUtil.updateParticipantReferences(containerShape, bandContainerShapes, participants,
        getFeatureProvider(), isShowNames());
View Full Code Here

Examples of org.eclipse.bpmn2.ChoreographyActivity

    return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), ChoreographyActivity.class);
  }

  @Override
  public IReason updateNeeded(IUpdateContext context) {
    ChoreographyActivity activity = (ChoreographyActivity) BusinessObjectUtil.getFirstElementOfType(
        context.getPictogramElement(), ChoreographyActivity.class);
    if (activity.getName().equals(getBodyText(context).getValue())) {
      return Reason.createFalseReason();
    } else {
      return Reason.createTrueReason("Name is out of date");
    }
  }
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.