test11_expression_calc.json 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. {
  2. "version": "3.15",
  3. "name": "Test11: Expression & Calculation",
  4. "registry": {
  5. "params": ["a(INT)", "b(INT)"],
  6. "vars": ["$sum(INT)", "$product(INT)", "$comparison(STRING)", "$combined(STRING)"]
  7. },
  8. "steps": [
  9. { "id": "Set_Sum", "target": "$sum", "value": "=a + b", "next": "Set_Product" },
  10. { "id": "Set_Product", "target": "$product", "value": "=a * b", "next": "Branch_Compare" },
  11. {
  12. "id": "Branch_Compare",
  13. "cases": [
  14. ["=a > b", "Set_AGreater"],
  15. ["=a == b", "Set_Equal"],
  16. ["ELSE", "Set_BGreater"]
  17. ],
  18. "next": "Set_Combined"
  19. },
  20. { "id": "Set_AGreater", "target": "$comparison", "value": "\"a > b\"", "next": "RETURN" },
  21. { "id": "Set_Equal", "target": "$comparison", "value": "\"a == b\"", "next": "RETURN" },
  22. { "id": "Set_BGreater", "target": "$comparison", "value": "\"a < b\"", "next": "RETURN" },
  23. {
  24. "id": "Set_Combined",
  25. "target": "$combined",
  26. "value": "=\"sum=\" + $sum + \", product=\" + $product + \", comp=\" + $comparison",
  27. "next": "Stop_End"
  28. },
  29. { "id": "Stop_End" }
  30. ]
  31. }