예제 #1
0
 private boolean isMissingDIElement(BaseElement be) {
   // ignore DataStores - there are bound to be references
   // to these, which *should* be rendered
   if (be instanceof DataStore) return false;
   BPMNDiagram bpmnDiagram = DIUtils.findBPMNDiagram(be);
   if (bpmnDiagram != null) return false;
   // couldn't find a BPMNDiagram entry for this BaseElement
   // check its container to see if it has a BPMNDiagram
   FlowElementsContainer container = this.getRootElementContainer(be);
   bpmnDiagram = DIUtils.findBPMNDiagram(container);
   if (bpmnDiagram != null) {
     // is the BaseElement defined as a BPMNShape or BPMNEdge in its
     // container's BPMNDiagram?
     if (bpmnDiagram.getPlane().getPlaneElement().contains(be)) return false;
   }
   boolean missing = (elements.get(be) == null && diagnostics.get(be) == null);
   if (missing)
     GraphicsUtil.dump(
         "Missing DI element for: "
             + be.eClass().getName()
             + " '"
             + ExtendedPropertiesProvider.getTextValue(be)
             + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
   return missing;
 }
예제 #2
0
  private BPMNDiagram createDIDiagram(BaseElement bpmnElement) {

    BPMNDiagram bpmnDiagram = DIUtils.findBPMNDiagram(bpmnElement, true);

    // if this container does not have a BPMNDiagram, create one
    if (bpmnElement instanceof Process) {
      if (bpmnDiagram == null) {
        // unless this Process is referenced by a Pool
        for (Collaboration c :
            ModelUtil.getAllObjectsOfType(bpmnElement.eResource(), Collaboration.class)) {
          for (Participant p : c.getParticipants()) {
            if (!ModelUtil.isParticipantBand(p)) {
              if (p.getProcessRef() == bpmnElement) {
                bpmnDiagram = DIUtils.findBPMNDiagram(p, true);
                break;
              }
            }
          }
          if (bpmnDiagram != null) break;
        }
      } else {
        // Always create a new BPMNDiagram if this Process is being referenced by a Participant Band
        //				for (Collaboration c : ModelUtil.getAllObjectsOfType(bpmnElement.eResource(),
        // Collaboration.class)) {
        //					for (Participant p : c.getParticipants()) {
        //						if (ModelUtil.isParticipantBand(p)) {
        //							if (p.getProcessRef() == bpmnElement) {
        //								bpmnDiagram = null;
        //								break;
        //							}
        //						}
        //					}
        //					if (bpmnDiagram==null)
        //						break;
        //				}
      }
    }

    if (bpmnDiagram == null) {
      FlowElementsContainer container = getRootElementContainer(bpmnElement);
      if (container == null) {
        diagnostics.add(IStatus.ERROR, bpmnElement, Messages.DIGenerator_No_Diagram);
        return this.bpmnDiagram;
      }
      BPMNPlane plane = BpmnDiFactory.eINSTANCE.createBPMNPlane();
      plane.setBpmnElement(container);

      bpmnDiagram = BpmnDiFactory.eINSTANCE.createBPMNDiagram();
      bpmnDiagram.setName(ExtendedPropertiesProvider.getTextValue(container));
      bpmnDiagram.setPlane(plane);

      definitions.getDiagrams().add(bpmnDiagram);
    }

    return bpmnDiagram;
  }
 protected String getText(EObject o) {
   String text = ""; // $NON-NLS-1$
   if (o != null) {
     text = labelProvider.getText(o);
     if (text == null) {
       text = ExtendedPropertiesProvider.getTextValue(o);
       if (text == null || text.isEmpty()) {
         EStructuralFeature f = o.eClass().getEStructuralFeature("id"); // $NON-NLS-1$
         if (f != null) text = o.eGet(f).toString();
       }
     }
   }
   return text;
 }
예제 #4
0
 @Override
 public String getText(Object element) {
   EObject object = getBusinessObject(element);
   if (object != null) {
     String text = ExtendedPropertiesProvider.getTextValue(object);
     // check if this is a CustomTask
     CustomTaskDescriptor ctd = getCustomTaskDescriptor(object);
     if (ctd != null) {
       // it is! build the property tab title from the CustomTask name
       // and the object's name (which could be the same)
       String name = ctd.getName();
       if (!text.equals(name)) return name + ": " + text; // $NON-NLS-1$
     }
     return text;
   }
   //		PictogramElement pe =
   // BusinessObjectUtil.getPictogramElementForSelection((ISelection)element);
   //		if (pe!=null && pe.getGraphicsAlgorithm()!=null) {
   //			return ModelUtil.getLabel( pe.getGraphicsAlgorithm() );
   //		}
   return super.getText(element);
 }