Ejemplo n.º 1
0
  @Override
  protected void findGL(Definitions diagram) {
    StringBuilder temp = new StringBuilder();

    int num = 0;

    for (RootElement rootElement : diagram.getRootElements()) {
      if (rootElement instanceof Process) {
        Process process = (Process) rootElement;
        // System.out.format("Found a process: %s\n", process.getName());

        IDProcess = process.getId();
        for (FlowElement fe : process.getFlowElements()) {
          if (fe instanceof SubProcess) {
            SubProcess sub = (SubProcess) fe;
            // System.out.format("Found a SubProcess: %s\n", sub.getName());
            this.searchSubProcess(sub);
          } else if (fe instanceof IntermediateCatchEvent) {
            IntermediateCatchEvent a = (IntermediateCatchEvent) fe;
            if (a.getName() == null || (a.getName().length() == 0)) {
              num++;

              elementsBPMN.add(fe);
              String name =
                  fe.getName() != null
                      ? fe.getName()
                      : Messages.getString("Generic.LabelEmpty", l); // $NON-NLS-1$
              setElements(fe.getId(), IDProcess, name);
              temp.append(
                  "* name="
                      + name
                      + " ID="
                      + fe.getId() // $NON-NLS-1$ //$NON-NLS-2$
                      + "\n"); //$NON-NLS-1$
            }

          } else if (fe instanceof IntermediateThrowEvent) {
            IntermediateThrowEvent a = (IntermediateThrowEvent) fe;
            if (a.getName() == null || (a.getName().length() == 0)) {
              num++;

              elementsBPMN.add(fe);
              String name =
                  fe.getName() != null
                      ? fe.getName()
                      : Messages.getString("Generic.LabelEmpty", l); // $NON-NLS-1$
              setElements(fe.getId(), IDProcess, name);
              temp.append(
                  "* name="
                      + name
                      + " ID="
                      + fe.getId() // $NON-NLS-1$ //$NON-NLS-2$
                      + "\n"); //$NON-NLS-1$
            }
          }
        }
      }
    }
    if (num > 0) {

      this.Suggestion += Messages.getString("LabelingEvents.SuggestionKO", l); // $NON-NLS-1$
      this.status = false;
    } else {
      this.status = true;
      this.Suggestion += Messages.getString("LabelingEvents.SuggestionOK", l); // $NON-NLS-1$
    }
  }