예제 #1
0
  private boolean withinSubnet(String hostIP) {
    String[] keyArry = null;
    String[] hostArry = null;
    boolean flag = true;

    keyArry = com.dcivision.framework.TextUtility.splitString(Info.getIp(), ".");
    hostArry = com.dcivision.framework.TextUtility.splitString(hostIP, ".");

    for (int i = 0; i < 4; i++) {
      if (!(keyArry[i].equals(hostArry[i]) || keyArry[i].equals("*"))) {
        flag = false;
        break;
      }
    }

    return flag;
  }
  public String[][] getNotifyTaskTypeByStepType(String setpActionType) {
    /*
     * String TRIGGER_TYPE_MAP[][] = { {"workflow.label.notify_task_is_arrived", MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_ARRIVED},
     * {"workflow.label.notify_task_is_pending", MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_PENDING_FOR}, {"workflow.label.notify_task_priority_changed",
     * MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_PRIORITY_CHANGED}, {"workflow.label.notify_task_is_check_out_by_user",
     * MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_CHECK_OUT_BY_USER}, {"workflow.label.notify_task_is_completed_by_user",
     * MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_COMPLETED_BY_USER}, {"workflow.label.notify_task_is_completed",
     * MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_COMPLETED}, {"workflow.label.notify_task_is_stoped",
     * MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_STOPPED}, {"workflow.label.before_task_due_date",
     * MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_BEFORE_DUE_DATE}, {"workflow.label.notify_task_is_overdue",
     * MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_OVER_DUE_DATE} };
     */

    String tiggerType[][] = null;
    int branchCount = 0;
    if (WorkflowStep.ACTION_TYPE_APPROVAL.equals(setpActionType)) {
      tiggerType = new String[11][2];
      setStandNotifyType(tiggerType);

      tiggerType[9][0] = "workflow.label.notify_task_is_approved";
      tiggerType[9][1] = MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_APPROVED;
      tiggerType[10][0] = "workflow.label.notify_task_is_reject";
      tiggerType[10][1] = MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_REJECT;

    } else if (WorkflowStep.ACTION_TYPE_BOOLEAN.equals(setpActionType)) {
      tiggerType = new String[11][2];
      setStandNotifyType(tiggerType);

      tiggerType[9][0] = "workflow.label.notify_task_is_yes";
      tiggerType[9][1] = MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_YES;
      tiggerType[10][0] = "workflow.label.notify_task_is_no";
      tiggerType[10][1] = MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_NO;

    } else if (!Utility.isEmpty(setpActionType) && setpActionType.length() > 1) {
      String[] routeArr = TextUtility.splitString(setpActionType, "|");
      if (Utility.isEmpty(routeArr)) {
        tiggerType = new String[9][2];
        setStandNotifyType(tiggerType);
      } else {
        tiggerType = new String[9 + routeArr.length][2];
        setStandNotifyType(tiggerType);

        for (int i = 0; i < routeArr.length; i++) {
          tiggerType[9 + i][0] = "workflow.label.notify_task_is_decision";
          tiggerType[9 + i][1] = MtmWfStepNotificationRule.NOTIFY_TRIGGER_TYPE_DECISION + i;
        }
      }
      //      tiggerType = new String[branchCount + 9][2];
      //      setStandNotifyType(tiggerType);

    } else {
      tiggerType = new String[9][2];
      setStandNotifyType(tiggerType);
    }

    return tiggerType;
  }
예제 #3
0
 public String getFunctionNameByLocale(java.util.Locale loc) {
   try {
     Class cls = this.getClass();
     String suffix = loc.toString().toLowerCase();
     String[] locStrAry = TextUtility.splitString(suffix, "_");
     suffix = "";
     for (int i = 0; i < locStrAry.length; i++) {
       suffix += Character.toUpperCase(locStrAry[i].charAt(0)) + locStrAry[i].substring(1);
     }
     Method mtd = cls.getMethod("getFunctionName" + suffix, null);
     String functionName = (String) mtd.invoke(this, null);
     return (functionName);
   } catch (Exception e) {
     return this.functionName;
   }
 }