simple_statelang_with_catches.json 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {
  2. "Name": "simpleCachesStateMachine",
  3. "Comment": "带Caches异常路由的测试状态机定义",
  4. "StartState": "FirstState",
  5. "Version": "0.0.1",
  6. "States": {
  7. "FirstState": {
  8. "Type": "ServiceTask",
  9. "ServiceName": "demoService",
  10. "ServiceMethod": "foo",
  11. "Next": "ChoiceState",
  12. "Input": [
  13. {
  14. "fooInput": "$.[a]"
  15. }
  16. ],
  17. "Output": {
  18. "fooResult": "$.#root"
  19. }
  20. },
  21. "ChoiceState":{
  22. "Type": "Choice",
  23. "Choices":[
  24. {
  25. "Expression":"[a] == 1",
  26. "Next":"SecondState"
  27. },
  28. {
  29. "Expression":"[a] == 2",
  30. "Next":"ThirdState"
  31. }
  32. ],
  33. "Default":"Fail"
  34. },
  35. "SecondState": {
  36. "Type": "ServiceTask",
  37. "ServiceName": "demoService",
  38. "ServiceMethod": "bar",
  39. "Input": [
  40. {
  41. "barInput": "$.[fooResult]",
  42. "throwException": "$.[barThrowException]"
  43. }
  44. ],
  45. "Output": {
  46. "barResult": "$.#root"
  47. },
  48. "Catch": [
  49. {
  50. "Exceptions": [
  51. "io.seata.saga.engine.mock.DemoException"
  52. ],
  53. "Next": "Fail"
  54. }
  55. ],
  56. "Next": "Succeed"
  57. },
  58. "ThirdState": {
  59. "Type": "ServiceTask",
  60. "ServiceName": "demoService",
  61. "ServiceMethod": "foo",
  62. "Input": [
  63. {
  64. "fooInput": "$.[fooResult]"
  65. }
  66. ],
  67. "Output": {
  68. "fooResult": "$.#root"
  69. },
  70. "Next": "Succeed"
  71. },
  72. "Succeed": {
  73. "Type":"Succeed"
  74. },
  75. "Fail": {
  76. "Type":"Fail",
  77. "ErrorCode": "NOT_FOUND",
  78. "Message": "not found"
  79. }
  80. }
  81. }