designer_simple_statelang_with_script.json 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. {
  2. "nodes": [
  3. {
  4. "type": "node",
  5. "size": "72*72",
  6. "shape": "flow-circle",
  7. "color": "#FA8C16",
  8. "label": "Start",
  9. "stateId": "Start1",
  10. "stateType": "Start",
  11. "stateProps": {
  12. "StateMachine": {
  13. "Name": "designerSimpleScriptTaskStateMachine",
  14. "Comment": "带ScriptTask的测试状态机定义",
  15. "Version": "0.0.1"
  16. }
  17. },
  18. "x": 318.875,
  19. "y": 102,
  20. "id": "9e56dbe7"
  21. },
  22. {
  23. "type": "node",
  24. "size": "110*48",
  25. "shape": "flow-rect",
  26. "color": "#1890FF",
  27. "label": "FirstState",
  28. "stateId": "FirstState",
  29. "stateType": "ServiceTask",
  30. "stateProps": {
  31. "ServiceName": "demoService",
  32. "ServiceMethod": "foo",
  33. "Input": [
  34. {
  35. "fooInput": "$.[a]"
  36. }
  37. ],
  38. "Output": {
  39. "fooResult": "$.#root"
  40. }
  41. },
  42. "x": 318.875,
  43. "y": 202,
  44. "id": "d1d71346"
  45. },
  46. {
  47. "type": "node",
  48. "size": "110*48",
  49. "shape": "flow-rect",
  50. "color": "#13C2C2",
  51. "label": "ScriptState",
  52. "stateId": "ScriptState",
  53. "stateType": "ScriptTask",
  54. "stateProps": {
  55. "ScriptType": "groovy",
  56. "ScriptContent": "if(throwException){ throw new RuntimeException(\"test\") } else { 'hello ' + inputA }",
  57. "Input": [
  58. {
  59. "inputA": "$.[a]",
  60. "throwException": "$.[scriptThrowException]"
  61. }
  62. ],
  63. "Output": {
  64. "scriptStateResult": "$.#root"
  65. }
  66. },
  67. "x": 319.375,
  68. "y": 290.5,
  69. "id": "898649d3"
  70. },
  71. {
  72. "type": "node",
  73. "size": "80*72",
  74. "shape": "flow-rhombus",
  75. "color": "#13C2C2",
  76. "label": "Choice",
  77. "stateId": "Choice1",
  78. "stateType": "Choice",
  79. "x": 318.875,
  80. "y": 394.5,
  81. "id": "39859d0b"
  82. },
  83. {
  84. "type": "node",
  85. "size": "110*48",
  86. "shape": "flow-rect",
  87. "color": "#1890FF",
  88. "label": "SecondState",
  89. "stateId": "SecondState",
  90. "stateType": "ServiceTask",
  91. "stateProps": {
  92. "ServiceName": "demoService",
  93. "ServiceMethod": "bar",
  94. "Input": [
  95. {
  96. "barInput": "$.[fooResult]"
  97. }
  98. ],
  99. "Output": {
  100. "barResult": "$.#root"
  101. }
  102. },
  103. "x": 173.375,
  104. "y": 493.49999999999994,
  105. "id": "c65f1c20"
  106. },
  107. {
  108. "type": "node",
  109. "size": "110*48",
  110. "shape": "flow-rect",
  111. "color": "#1890FF",
  112. "label": "ThirdState",
  113. "stateId": "ThirdState",
  114. "stateType": "ServiceTask",
  115. "stateProps": {
  116. "ServiceName": "demoService",
  117. "ServiceMethod": "foo",
  118. "Input": [
  119. {
  120. "fooInput": "$.[fooResult]"
  121. }
  122. ],
  123. "Output": {
  124. "fooResult": "$.#root"
  125. }
  126. },
  127. "x": 318.875,
  128. "y": 492.99999999999994,
  129. "id": "5857047e"
  130. },
  131. {
  132. "type": "node",
  133. "size": "72*72",
  134. "shape": "flow-circle",
  135. "color": "#05A465",
  136. "label": "Succeed",
  137. "stateId": "Succeed1",
  138. "stateType": "Succeed",
  139. "x": 318.875,
  140. "y": 592,
  141. "id": "18bba9a0"
  142. },
  143. {
  144. "type": "node",
  145. "size": "72*72",
  146. "shape": "flow-circle",
  147. "color": "red",
  148. "label": "Fail",
  149. "stateId": "Fail1",
  150. "stateType": "Fail",
  151. "stateProps": {
  152. "ErrorCode": "",
  153. "Message": ""
  154. },
  155. "x": 474.57499999999993,
  156. "y": 499.99999999999994,
  157. "id": "95def921"
  158. },
  159. {
  160. "type": "node",
  161. "size": "39*39",
  162. "shape": "flow-circle",
  163. "color": "red",
  164. "label": "Catch",
  165. "stateId": "Catch1",
  166. "stateType": "Catch",
  167. "x": 374.375,
  168. "y": 315,
  169. "id": "e264be2d"
  170. }
  171. ],
  172. "edges": [
  173. {
  174. "source": "9e56dbe7",
  175. "sourceAnchor": 2,
  176. "target": "d1d71346",
  177. "targetAnchor": 0,
  178. "id": "594d5078"
  179. },
  180. {
  181. "source": "d1d71346",
  182. "sourceAnchor": 2,
  183. "target": "898649d3",
  184. "targetAnchor": 0,
  185. "id": "e1f56d5c"
  186. },
  187. {
  188. "source": "898649d3",
  189. "sourceAnchor": 2,
  190. "target": "39859d0b",
  191. "targetAnchor": 0,
  192. "id": "d25b97b3"
  193. },
  194. {
  195. "source": "39859d0b",
  196. "sourceAnchor": 3,
  197. "target": "c65f1c20",
  198. "targetAnchor": 0,
  199. "id": "d957fcff",
  200. "stateProps": {
  201. "Expression": "[a] == 1",
  202. "Default": false
  203. },
  204. "label": "",
  205. "shape": "flow-smooth"
  206. },
  207. {
  208. "source": "39859d0b",
  209. "sourceAnchor": 2,
  210. "target": "5857047e",
  211. "targetAnchor": 0,
  212. "id": "d7053595",
  213. "stateProps": {
  214. "Expression": "[a] == 2",
  215. "Default": false
  216. },
  217. "label": "",
  218. "shape": "flow-smooth"
  219. },
  220. {
  221. "source": "e264be2d",
  222. "sourceAnchor": 1,
  223. "target": "95def921",
  224. "targetAnchor": 0,
  225. "id": "39925f4b",
  226. "stateProps": {
  227. "Exceptions": [
  228. "java.lang.Throwable"
  229. ]
  230. }
  231. },
  232. {
  233. "source": "39859d0b",
  234. "sourceAnchor": 1,
  235. "target": "95def921",
  236. "targetAnchor": 0,
  237. "id": "5500c8da",
  238. "stateProps": {
  239. "Expression": "",
  240. "Default": true
  241. },
  242. "label": "",
  243. "shape": "flow-smooth"
  244. },
  245. {
  246. "source": "c65f1c20",
  247. "sourceAnchor": 2,
  248. "target": "18bba9a0",
  249. "targetAnchor": 3,
  250. "id": "33832e0d"
  251. },
  252. {
  253. "source": "5857047e",
  254. "sourceAnchor": 2,
  255. "target": "18bba9a0",
  256. "targetAnchor": 0,
  257. "id": "1191f8f0"
  258. }
  259. ]
  260. }