Browse Source

基础框架发布: 8.2.22

1) 规则引擎中,增加 Java 执行引擎
  2) 规则引擎中,模型定义中,将参数附加属性中的枚举值变量替换成常量
  3) 规则引擎中,模型定义中,将参数选项属性中的枚举值变量替换成常量
main
wangshaoping 2 months ago
parent
commit
9776d77169
  1. 4
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ExecutionFlow.java
  2. 4
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/OptionValue.java
  3. 1
      io.sc.engine.rule.frontend/src/views/shared/TestcaseParameterGrid.vue

4
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/ExecutionFlow.java

@ -109,10 +109,10 @@ public class ExecutionFlow {
EdgeConditionBranchNode edge =(EdgeConditionBranchNode)outs.get(i); //出口边 EdgeConditionBranchNode edge =(EdgeConditionBranchNode)outs.get(i); //出口边
GraphNode nexNode =edge.getOuts().get(0); //出口边指向的节点 GraphNode nexNode =edge.getOuts().get(0); //出口边指向的节点
if(i==0) { if(i==0) {
sb.append("\tif((").append(GroovyExpressionReplacer.groovy(node.getCondition(),null)).append(").equals(").append(GroovyExpressionReplacer.groovy(edge.getValue(),edge.getValueType())).append(")){").append("\n"); sb.append("\tif((").append(GroovyExpressionReplacer.groovy(edge.getValue(),edge.getValueType())).append(").equals(").append(GroovyExpressionReplacer.groovy(node.getCondition(),null)).append(")){").append("\n");
}else { }else {
if(edge.getValue()!=null && !edge.getValue().trim().isEmpty()) { if(edge.getValue()!=null && !edge.getValue().trim().isEmpty()) {
sb.append("else if((").append(GroovyExpressionReplacer.groovy(node.getCondition(),null)).append(").equals(").append(GroovyExpressionReplacer.groovy(edge.getValue(),edge.getValueType())).append(")){").append("\n"); sb.append("else if((").append(GroovyExpressionReplacer.groovy(edge.getValue(),edge.getValueType())).append(").equals(").append(GroovyExpressionReplacer.groovy(node.getCondition(),null)).append(")){").append("\n");
}else { }else {
sb.append("else {").append("\n"); sb.append("else {").append("\n");
} }

4
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/OptionValue.java

@ -32,13 +32,13 @@ public class OptionValue {
sb.append("\n").append("else if("); sb.append("\n").append("else if(");
} }
sb.append(GroovyExpressionReplacer.ARGUMENT_NAME).append(".").append(IdReplacer.fieldName(inOptionParameter.getCode())); sb.append(GroovyExpressionReplacer.ARGUMENT_NAME).append(".").append(IdReplacer.fieldName(inOptionParameter.getCode()));
sb.append("=="); sb.append(".equals(");
if(ValueTypeUtil.isString(inOptionParameter.getValueType())){ if(ValueTypeUtil.isString(inOptionParameter.getValueType())){
sb.append(GroovyExpressionReplacer.groovy(item.getInputValue(),"java.lang.String")); sb.append(GroovyExpressionReplacer.groovy(item.getInputValue(),"java.lang.String"));
}else{ }else{
sb.append(GroovyExpressionReplacer.groovy(item.getInputValue())); sb.append(GroovyExpressionReplacer.groovy(item.getInputValue()));
} }
sb.append("){ "); sb.append(")){ ");
sb.append(GroovyExpressionReplacer.ARGUMENT_NAME).append(".").append(IdReplacer.fieldName(parameter.getCode())); sb.append(GroovyExpressionReplacer.ARGUMENT_NAME).append(".").append(IdReplacer.fieldName(parameter.getCode()));
sb.append(" =TypeConvertor.getValue("); sb.append(" =TypeConvertor.getValue(");
sb.append(GroovyExpressionReplacer.groovy(item.getValue(),parameter.getValueType())); sb.append(GroovyExpressionReplacer.groovy(item.getValue(),parameter.getValueType()));

1
io.sc.engine.rule.frontend/src/views/shared/TestcaseParameterGrid.vue

@ -184,6 +184,7 @@
const parameterType = arg.form.getFieldValue('parameterType'); const parameterType = arg.form.getFieldValue('parameterType');
const scoreCardVarType = arg.form.getFieldValue('scoreCardVarType'); const scoreCardVarType = arg.form.getFieldValue('scoreCardVarType');
const indicatorType = arg.form.getFieldValue('indicatorType'); const indicatorType = arg.form.getFieldValue('indicatorType');
console.log(indicatorType);
if ( if (
(!Tools.isUndefinedOrNull(parameterType) && (!Tools.isUndefinedOrNull(parameterType) &&
(parameterType === 'INTERMEDIATE' || (parameterType === 'INTERMEDIATE' ||

Loading…
Cancel
Save