Пример #1
0
  @Override
  public String toJpdl() throws InvalidModelException {
    StringWriter jpdl = new StringWriter();
    String type = "";
    if (outgoings.size() <= 1) type = "join";
    else type = "fork";

    jpdl.write("  <" + type);

    jpdl.write(JsonToJpdl.transformAttribute("name", name));

    if (bounds != null) {
      jpdl.write(bounds.toJpdl());
    } else {
      throw new InvalidModelException("Invalid Wait activity. Bounds is missing.");
    }

    if (outgoings.size() > 0) {
      jpdl.write(" >\n");
      for (Transition t : outgoings) {
        jpdl.write(t.toJpdl());
      }
      jpdl.write("  </" + type + ">\n\n");
    } else {
      jpdl.write(" />\n\n");
    }

    return jpdl.toString();
  }
Пример #2
0
  @Override
  public String toJpdl() throws InvalidModelException {
    StringWriter jpdl = new StringWriter();
    jpdl.write("  <esb");

    jpdl.write(JsonToJpdl.transformAttribute("name", name));

    try {
      jpdl.write(JsonToJpdl.transformRequieredAttribute("category", category));
      jpdl.write(JsonToJpdl.transformRequieredAttribute("service", service));
    } catch (InvalidModelException e) {
      throw new InvalidModelException("Invalid Esb activity. " + e.getMessage());
    }

    if (bounds != null) {
      jpdl.write(bounds.toJpdl());
    } else {
      throw new InvalidModelException("Invalid ESB activity. Bounds is missing.");
    }

    jpdl.write(" >\n");

    for (Part p : part) {
      jpdl.write(p.toJpdl());
    }

    for (Transition t : outgoings) {
      jpdl.write(t.toJpdl());
    }

    jpdl.write("  </esb>\n\n");

    return jpdl.toString();
  }
Пример #3
0
 public String toJpdl() throws InvalidModelException {
   StringWriter jpdl = new StringWriter();
   jpdl.write("<field ");
   jpdl.write(JsonToJpdl.transformAttribute("name", name));
   jpdl.write(" >\n");
   if (child != null) {
     jpdl.write(child.toJpdl());
   } else {
     throw new InvalidModelException("Invalid Field. Object or String is missing");
   }
   jpdl.write("</field>\n");
   return jpdl.toString();
 }
Пример #4
0
  @Override
  public String toJpdl() throws InvalidModelException {
    StringWriter jpdl = new StringWriter();
    jpdl.write("  <task");

    jpdl.write(JsonToJpdl.transformAttribute("name", name));
    if (assignee != null && assignee.length() > 0)
      jpdl.write(JsonToJpdl.transformAttribute("assignee", assignee));
    if (candidateGroups != null && candidateGroups.length() > 0) {
      jpdl.write(JsonToJpdl.transformAttribute("candidate-groups", candidateGroups));
    }
    if (candidateUsers != null && candidateUsers.length() > 0) {
      jpdl.write(JsonToJpdl.transformAttribute("candidate-users", candidateUsers));
    }
    if (swimlane != null) {
      jpdl.write(JsonToJpdl.transformAttribute("swimlane", swimlane));
    }

    if (bounds != null) {
      jpdl.write(bounds.toJpdl());
    } else {
      throw new InvalidModelException("Invalid Task. Bounds is missing.");
    }

    if (outgoings.size() > 0) {
      jpdl.write(" >\n");
      for (Transition t : outgoings) {
        jpdl.write(t.toJpdl());
      }
      jpdl.write("  </task>\n\n");
    } else {
      jpdl.write(" />\n\n");
    }

    return jpdl.toString();
  }
Пример #5
0
  @Override
  public String toJpdl() throws InvalidModelException {
    StringWriter jpdl = new StringWriter();
    jpdl.write("  <hql");

    jpdl.write(JsonToJpdl.transformAttribute("name", name));
    jpdl.write(JsonToJpdl.transformAttribute("var", var));
    if (unique != null) jpdl.write(JsonToJpdl.transformAttribute("unique", unique.toString()));

    if (bounds != null) {
      jpdl.write(bounds.toJpdl());
    } else {
      throw new InvalidModelException("Invalid HQL activity. Bounds is missing.");
    }

    jpdl.write(" >\n");

    if (query != null) {
      jpdl.write("    <query>");
      jpdl.write(StringEscapeUtils.escapeXml(query));
      jpdl.write("</query>\n");
    } else {
      throw new InvalidModelException("Invalid HQL activity. Query is missing.");
    }

    if (parameters != null) {
      jpdl.write(parameters.toJpdl());
    }

    for (Transition t : outgoings) {
      jpdl.write(t.toJpdl());
    }

    jpdl.write("  </hql>\n");
    return jpdl.toString();
  }
  @Override
  public String toJpdl() throws InvalidModelException {
    StringWriter jpdl = new StringWriter();
    jpdl.write("  <start");
    jpdl.write(JsonToJpdl.transformAttribute("name", name));

    if (bounds != null) {
      jpdl.write(bounds.toJpdl());
    } else {
      throw new InvalidModelException("Invalid Start Event. Bounds is missing.");
    }

    if (outgoings.size() > 0) {
      jpdl.write(" >\n");
      for (Transition t : outgoings) {
        jpdl.write(t.toJpdl());
      }
      jpdl.write("  </start>\n\n");
    } else {
      jpdl.write(" />\n\n");
    }

    return jpdl.toString();
  }