public int compareTo(KaleoAction kaleoAction) {
    int value = 0;

    if (getPriority() < kaleoAction.getPriority()) {
      value = -1;
    } else if (getPriority() > kaleoAction.getPriority()) {
      value = 1;
    } else {
      value = 0;
    }

    if (value != 0) {
      return value;
    }

    return 0;
  }
  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }

    KaleoAction kaleoAction = null;

    try {
      kaleoAction = (KaleoAction) obj;
    } catch (ClassCastException cce) {
      return false;
    }

    long primaryKey = kaleoAction.getPrimaryKey();

    if (getPrimaryKey() == primaryKey) {
      return true;
    } else {
      return false;
    }
  }
Пример #3
0
  protected Set<Action> buildActions(String kaleoClassName, long kaleoClassPK)
      throws SystemException {

    List<KaleoAction> kaleoActions =
        kaleoActionLocalService.getKaleoActions(kaleoClassName, kaleoClassPK);

    Set<Action> actions = new HashSet<Action>(kaleoActions.size());

    for (KaleoAction kaleoAction : kaleoActions) {
      Action action =
          new Action(
              kaleoAction.getName(),
              kaleoAction.getDescription(),
              kaleoAction.getExecutionType(),
              kaleoAction.getScript(),
              kaleoAction.getScriptLanguage(),
              kaleoAction.getScriptRequiredContexts(),
              kaleoAction.getPriority());

      actions.add(action);
    }

    return actions;
  }