Exemplo n.º 1
0
  private void calculateIconStatus(ProcessProgressInstance instance) {
    if (instance != null && instance.getTerminationTime() != null) {
      this.completeIconStatus = true;
    } else {
      this.completeIconStatus = false;
    }

    this.completeText = "";

    if (instance != null && !instance.getDescriptors().isEmpty()) {
      this.descriptorIconStatus = true;

      List<ProcessDescriptor> processdescList =
          CommonDescriptorUtils.createProcessDescriptors(instance.getProcessInstance(), false);

      StringBuffer buffer = new StringBuffer();
      for (ProcessDescriptor processDescriptors : processdescList) {
        if (StringUtils.isNotEmpty(buffer.toString())) {
          buffer.append(", ");
        }
        buffer
            .append(processDescriptors.getKey())
            .append(" : ")
            .append(processDescriptors.getValue());
      }

      this.descriptorText = buffer.toString();

      if (instance.getNote() != null) {
        this.noteIconStatus = true;
        this.noteText = instance.getNote();
      } else {
        this.noteIconStatus = false;
      }

      if (instance.getError() != null) {
        this.errorIconStatus = true;
        this.errorText = instance.getError();
      } else {
        this.errorIconStatus = false;
      }
    } else {
      this.descriptorIconStatus = false;
      this.noteIconStatus = false;
      this.descriptorIconStatus = false;
    }
  }