Examples of EvaluationResult


Examples of org.springframework.ide.eclipse.webflow.core.internal.model.EvaluationResult

        else if (this.action.getEvaluationResult() != null) {
          this.actionClone.getEvaluationResult().setName(this.resultNameText.getText());
          this.actionClone.getEvaluationResult().setScope(this.scopeText.getText());
        }
        else if (this.action.getEvaluationResult() == null) {
          EvaluationResult result = new EvaluationResult();
          result.createNew(actionClone);
          this.actionClone.setEvaluationResult(result);
          this.actionClone.getEvaluationResult().setName(this.resultNameText.getText());
          this.actionClone.getEvaluationResult().setScope(this.scopeText.getText());
        }
      }
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult

  }

  @Override
  public EvaluationResult evaluate(ProcessDataRecord record) {
    if (this.ops.isEmpty()) {
      return new EvaluationResult(null).withWarning(ErrorCode.W120);
    } else if (this.ops.size() == 1) {
      EvaluationResult r = this.ops.get(0).evaluate(record);
      if (r.getPayload() instanceof String) {         
        return new EvaluationResult(
            new User((String) r.getPayload(), SharedConstants.User.DEFAULT_AUTH_DOMAIN), r);
      } else {
        return r.withWarning(ErrorCode.W121);
      }
    } else if (this.ops.size() == 2) {
      EvaluationResult r0 = this.ops.get(0).evaluate(record);
      EvaluationResult r1 = this.ops.get(1).evaluate(record);
      if (r0.getPayload() instanceof String && r1.getPayload() instanceof String) {
        String email = (String)r0.getPayload();
        String authDomain = (String)r1.getPayload();
        return new EvaluationResult(new User(email, authDomain), r0, r1);
      } else {
        return r1.withWarning(ErrorCode.W121);
      }
    } else {
      return this.ops.get(0).evaluate(record).withWarning(ErrorCode.W120);
    }
  }
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult

  }

  @Override
  public EvaluationResult evaluate(ProcessDataRecord record) {
    if (this.ops.isEmpty()) {
      return new EvaluationResult(null).withWarning(ErrorCode.W122);
    } else if (this.ops.size() == 2) {
      EvaluationResult r0 = this.ops.get(0).evaluate(record);
      EvaluationResult r1 = this.ops.get(1).evaluate(record);
      if (r0.getPayload() instanceof Number && r1.getPayload() instanceof Number) {
        float lat = ((Number)r0.getPayload()).floatValue();
        float lon = ((Number)r1.getPayload()).floatValue();
       
        try {
          return new EvaluationResult(new GeoPt(lat, lon), r0, r1)
        } catch (IllegalArgumentException e) {
          // Longitude must be between -180 and 180 and Latitude must be between -90 and 90 (inclusive).
          return r1.withWarning(ErrorCode.W143);
        }
      } else {
        return r1.withWarning(ErrorCode.W123);
      }
    } else {
      return this.ops.get(0).evaluate(record).withWarning(ErrorCode.W122);
    }
  }
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult

  }

  @Override
  public EvaluationResult evaluate(ProcessDataRecord record) {
    if (ops.isEmpty()) {
      return new EvaluationResult(null).withWarning(ErrorCode.W111);
    } else if (ops.size() == 2) {
      EvaluationResult val = ops.get(0).evaluate(record);
      EvaluationResult start = ops.get(1).evaluate(record);
     
      if (val.getPayload() instanceof String && start.getPayload() instanceof Number) {
        String str = (String) val.getPayload();
        int startI = ((Number)start.getPayload()).intValue();
        return new EvaluationResult(str.substring(startI), val, start);
      } else {
        return val.withWarning(ErrorCode.W110);
      }
    } else if (ops.size() == 3) {
      EvaluationResult val = ops.get(0).evaluate(record);
      EvaluationResult start = ops.get(1).evaluate(record);
      EvaluationResult length = ops.get(2).evaluate(record);
     
      if (val.getPayload() instanceof String &&
          start.getPayload() instanceof Number &&
          length.getPayload() instanceof Number) {
        String str = (String) val.getPayload();
        int startI = ((Number)start.getPayload()).intValue();
        int lengthI = ((Number)length.getPayload()).intValue();
        return new EvaluationResult(str.substring(startI, startI + lengthI), val, start, length);
      } else {
        return val.withWarning(ErrorCode.W110);
      }
    } else {
      return ops.get(0).evaluate(record).withWarning(ErrorCode.W111);
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult

    FunctionUtil.ensureParamSize(ops, 1);
  }

  @Override
  public EvaluationResult evaluate(ProcessDataRecord record) {
    EvaluationResult r = ops.get(0).evaluate(record);
   
    if (r.getPayload() instanceof String) {
      PhoneNumber val = new PhoneNumber((String) r.getPayload());
      return new EvaluationResult(val, r)
    } else {
      return r.withWarning(ErrorCode.W133);
    }
  }
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult

    FunctionUtil.ensureParamSize(ops, 1);
  }

  @Override
  public EvaluationResult evaluate(ProcessDataRecord record) {
    EvaluationResult r = ops.get(0).evaluate(record);
   
    // since this will only be used when user is trying to execute an expression with function text
    // then the actual text will NEVER be passed in as ops.get(0).evaluate(context).getPayload()
    if (r.getPayload() instanceof String) {
      return new EvaluationResult(new TextStringWrapper((String) r.getPayload()), r)
    } else if (r.getPayload() instanceof BigDecimal) {
      BigDecimal bd = (BigDecimal) r.getPayload();
      int index = bd.intValue() - 1;
      return new EvaluationResult(new TextFileRefWrapper(record.lookupFileReference(index)));
    } else {
      return r.withWarning(ErrorCode.W132);
    }
  }
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult

    FunctionUtil.ensureParamSize(ops, 1);
  }

  @Override
  public EvaluationResult evaluate(ProcessDataRecord record) {
    EvaluationResult r = ops.get(0).evaluate(record);
   
    if (r.getPayload() instanceof String) {
      Email val = new Email((String) r.getPayload());
      return new EvaluationResult(val, r)
    } else {
      return r.withWarning(ErrorCode.W136);
    }
  }
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult

    FunctionUtil.ensureParamSize(ops, 1);
  }

  @Override
  public EvaluationResult evaluate(ProcessDataRecord record) {
    EvaluationResult r = ops.get(0).evaluate(record);
   
    if (r.getPayload() instanceof Number) {
      Number val = (Number) r.getPayload();
      return new EvaluationResult(val.doubleValue(), r)
    } else {
      return r.withWarning(ErrorCode.W139);
    }
  }
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult

    FunctionUtil.ensureParamSize(ops, 0);
  }

  @Override
  public EvaluationResult evaluate(ProcessDataRecord record) {
    return new EvaluationResult(null);
  }
View Full Code Here

Examples of org.yaac.server.egql.evaluator.EvaluationResult

  }

  @Override
  public EvaluationResult evaluate(ProcessDataRecord record) {
    if (this.ops.isEmpty()) {
      return new EvaluationResult(null).withWarning(ErrorCode.W101);
    } else if (this.ops.size() == 1) {
      EvaluationResult r = ops.get(0).evaluate(record);
      if (r.getPayload() instanceof String) {
        return new EvaluationResult(((String)r.getPayload()).toUpperCase(), r);
      } else {
        return r.withWarning(ErrorCode.W103);
      }
    } else {
      return this.ops.get(0).evaluate(record).withWarning(ErrorCode.W101);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.