simple_statelang_with_recover_strategy.json 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {
  2. "Name": "simpleStateMachineWithRecoverStrategy",
  3. "Comment": "带自定义恢复策略的测试状态机定义",
  4. "StartState": "FirstState",
  5. "Version": "0.0.1",
  6. "RecoverStrategy": "Forward",
  7. "States": {
  8. "FirstState": {
  9. "Type": "ServiceTask",
  10. "ServiceName": "demoService",
  11. "ServiceMethod": "foo",
  12. "Input": [
  13. {
  14. "fooInput": "$.[a]",
  15. "throwExceptionRandomly": "$.[fooThrowExceptionRandomly]",
  16. "sleepTime": "$.[fooSleepTime]"
  17. }
  18. ],
  19. "Output": {
  20. "fooResult": "$.#root"
  21. },
  22. "Status": {
  23. "$Exception{io.seata.saga.engine.mock.DemoException}": "UN",
  24. "#root != null": "SU",
  25. "#root == null": "FA"
  26. },
  27. "Catch": [
  28. {
  29. "Exceptions": [
  30. "java.lang.Throwable"
  31. ],
  32. "Next": "Fail"
  33. }
  34. ],
  35. "Next": "ChoiceState"
  36. },
  37. "ChoiceState":{
  38. "Type": "Choice",
  39. "Choices":[
  40. {
  41. "Expression":"[a] == 1",
  42. "Next":"SecondState"
  43. },
  44. {
  45. "Expression":"[a] == 2",
  46. "Next":"Fail"
  47. }
  48. ],
  49. "Default":"Fail"
  50. },
  51. "SecondState": {
  52. "Type": "ServiceTask",
  53. "ServiceName": "demoService",
  54. "ServiceMethod": "bar",
  55. "Input": [
  56. {
  57. "barInput": "$.[fooResult]",
  58. "throwExceptionRandomly": "$.[barThrowExceptionRandomly]",
  59. "sleepTime": "$.[barSleepTime]"
  60. }
  61. ],
  62. "Output": {
  63. "barResult": "$.#root"
  64. },
  65. "Status": {
  66. "$Exception{io.seata.saga.engine.mock.DemoException}": "UN",
  67. "#root != null": "SU",
  68. "#root == null": "FA"
  69. },
  70. "Catch": [
  71. {
  72. "Exceptions": [
  73. "java.lang.Throwable"
  74. ],
  75. "Next": "Fail"
  76. }
  77. ],
  78. "Next": "Succeed"
  79. },
  80. "Succeed": {
  81. "Type":"Succeed"
  82. },
  83. "Fail": {
  84. "Type":"Fail",
  85. "ErrorCode": "NOT_FOUND",
  86. "Message": "not found"
  87. }
  88. }
  89. }