Package com.iisigroup.cap.operation

Examples of com.iisigroup.cap.operation.OperationStep


   * (non-Javadoc)
   *
   * @see tw.com.iisi.cap.flow.Operation#execute()
   */
  public void execute(OpStepContext ctx, IRequest params, IHandler handler) {
    OperationStep step = getStartStep();
    long startOperation = System.currentTimeMillis();
    try {
      while (step != null) {
        OpStepContext result = ctx;
        try {
          long startStep = System.currentTimeMillis();
          result = step.execute(result, params, handler);
          logger.debug("{} cost : {} ms", step.getName(),
              (System.currentTimeMillis() - startStep));
        } catch (CapException e) {
          result = step.handleException(result, e);
          throw e;
        }
        if (result != null) {
          if (OperationStep.NEXT.equals(result.getGoToStep())) {
            step = getNextStep(step.getName());
          } else if (OperationStep.RETURN.equals(result.getGoToStep())
              || OperationStep.ERROR.equals(result.getGoToStep())) {
            step = null;
          } else {
            step = getStep(result.getGoToStep());
View Full Code Here


  public OperationStep getStartStep() {
    if (ruleMap != null && !ruleMap.isEmpty()) {
      Set<Entry<String, OperationStep>> steps = ruleMap.entrySet();
      for (Entry<String, OperationStep> entry : steps) {
        OperationStep step = entry.getValue();
        step.setName(entry.getKey());
        return step;
      }
    }
    return null;
  }
View Full Code Here

    if (ruleMap != null && !ruleMap.isEmpty()) {
      Set<Entry<String, OperationStep>> steps = ruleMap.entrySet();
      boolean b = false;
      for (Entry<String, OperationStep> entry : steps) {
        if (b) {
          OperationStep step = entry.getValue();
          step.setName(entry.getKey());
          return step;
        } else if (currentStepName.equals(entry.getKey())) {
          b = true;
        }
      }
View Full Code Here

    return null;
  }

  public OperationStep getStep(String stepName) {
    if (ruleMap != null && ruleMap.containsKey(stepName)) {
      OperationStep step = ruleMap.get(stepName);
      step.setName(stepName);
      return step;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of com.iisigroup.cap.operation.OperationStep

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.