if else

  1. {
  2. "name" : "ifProcess",
  3. "config" : [
  4. {
  5. "expression" : "temp.total>240",
  6. "request" : {
  7. "isInterrupt" : "true",
  8. "returnProcess" : "true",
  9. "errorCode" : "1"
  10. }
  11. }
  12. ]
  13. }

说明:
1)temp.total默认情况下会优先从request取,如果没有再从response取值,也可以指定从response或者request取值,配置如下
备注:参考取数据规则1,以上为取数据规则,其他某些组件规则保持一致
2)expression配置了表达式,当条件发生时给上下文request赋值。
场景2 场景发生时,执行嵌套模块
具体嵌套模块在如下steps中,并且两种形式可以混合使用

  1. {
  2. "name" : "ifProcess",
  3. "config" : [
  4. {
  5. "expression" : "vipRights.status='payed'",
  6. "steps" : [
  7. {
  8. "name" : "mapingValue",
  9. "needKey" : {
  10. "vipRights.title" : "rights.title",
  11. "rights.description":"strReplace(vipRights.desc,rightsMap.benefitUserBO.circle)",
  12. "vipRights.days" : "rights.days",
  13. "vipRights.status" : "rights.status"
  14. }
  15. }
  16. ],
  17. "isElseLogic" : true
  18. },
  19. {
  20. "expression" : "vipRights.status='free'||vipRights.status='none'",
  21. "steps" : [
  22. {
  23. "name" : "mapingValue",
  24. "needKey" : {
  25. "vipRights.status" : "rights.status",
  26. "vipRights.title" : "rights.title",
  27. "vipRights.days" : "rights.days"
  28. }
  29. }
  30. ]
  31. },
  32. {
  33. "expression" : "else",
  34. "request" : {
  35. "isInterrupt" : "true",
  36. "returnProcess" : "true",
  37. "errorCode" : "1"
  38. }
  39. }
  40. ]
  41. }

说明:
1)expression 表达式支持逻辑表达&& (与) 和 || (或),可以多个,但目前暂时不支持混合使用。
3)当配置了 isElseLogic : true 当某个条件发生时,不会再向下执行,即 if - else if 逻辑,默认为true

循环计算

  1. {
  2. "input" : "typeList",
  3. "name" : "loopProcess",
  4. "output" : "types",
  5. "steps" : [
  6. {
  7. "name" : "setData",
  8. "input" : "1Y_priceList",
  9. "valueTo" : "request",
  10. "output" : {
  11. "close" : "value",
  12. "time":"timeFromat(Time,'yyyy-MM-dd HH:mm:ss','yyyy-MM-dd')"
  13. }
  14. }
  15. ]
  16. }

1)input 类型支持List 和 Map
2) 配置 “localVariable”:”param1,param2” 表示是局部变量,当前循环有效,在下次循环开始时会清除,防止数据冲突

分数区间匹配

在名单中的用户会执行steps中步骤

  1. {
  2. "name" : "scoreMatch",
  3. "input" : "score",
  4. "config" : [
  5. {
  6. "expression" : "[100,200]",
  7. "steps" : [
  8. ]
  9. },
  10. {
  11. "expression" : "(200,400]",
  12. "steps" : [
  13. ]
  14. }
  15. ]
  16. }

enable表示开关

白名单

在名单中的用户会执行steps中步骤

  1. {
  2. "name" : "whiteListProcess",
  3. "enable" : "false",
  4. "key" : "data:dianshi:user:whiteList",
  5. "steps" : [
  6. ],
  7. "db" : "6"
  8. }

enable表示开关


黑名单

在名单中的用户不会执行steps中步骤

  1. {
  2. "name" : "blacklistProcess",
  3. "enable" : "true",
  4. "key" : "data:dianshi:user:blackList",
  5. "steps" : [
  6. ],
  7. "db" : "6"
  8. }