Exemplo n.º 1
0
 public void addTaskRow(HumanStepDefinition humanStepDefinition) {
   Object taskItemId =
       addTaskRow(
           null,
           humanStepDefinition.getName(),
           humanStepDefinition.getAssignee(),
           humanStepDefinition.getCandidateGroupsCommaSeparated(),
           humanStepDefinition.getDescription(),
           humanStepDefinition.isStartsWithPrevious());
   if (humanStepDefinition.getForm() != null) {
     taskFormModel.addForm(taskItemId, humanStepDefinition.getForm());
   }
 }
Exemplo n.º 2
0
  public List<HumanStepDefinition> getSteps() {
    List<HumanStepDefinition> steps = new ArrayList<HumanStepDefinition>();
    for (Object itemId : getItemIds()) {
      Item item = getItem(itemId);

      HumanStepDefinition humanStepDefinition = new HumanStepDefinition();

      String name = (String) item.getItemProperty(ID_NAME).getValue();
      if (name != null && name.length() > 0) {
        humanStepDefinition.setName(name);
      }

      String assignee = (String) item.getItemProperty(ID_ASSIGNEE).getValue();
      if (assignee != null && assignee.length() > 0) {
        humanStepDefinition.setAssignee(assignee);
      }

      String groups = (String) item.getItemProperty("groups").getValue();
      List<String> candidateGroups = new ArrayList<String>();
      if (groups != null && groups.length() > 0) {
        for (String group : groups.split(",")) {
          candidateGroups.add(group.trim());
        }
      }
      humanStepDefinition.setCandidateGroups(candidateGroups);

      String description =
          (String) ((TextField) item.getItemProperty(ID_DESCRIPTION).getValue()).getValue();
      if (description != null && description.length() > 0) {
        humanStepDefinition.setDescription(description);
      }

      humanStepDefinition.setStartsWithPrevious(
          (boolean)
              ((CheckBox) item.getItemProperty(ID_START_WITH_PREVIOUS).getValue()).booleanValue());

      FormDefinition formDefinition = taskFormModel.getForm(itemId);
      humanStepDefinition.setForm(formDefinition);

      steps.add(humanStepDefinition);
    }
    return steps;
  }