11{
2- "id" : " applicantrequest" ,
3- "version" : " 1.0" ,
4- "name" : " Applicant Request Decision Workflow" ,
5- "description" : " Determine if applicant request is valid" ,
6- "start" : " CheckApplication" ,
7- "specVersion" : " 0.7" ,
8- "auth" : [{
9- "name" : " testAuth" ,
10- "scheme" : " bearer" ,
11- "properties" : {
12- "token" : " test_token"
13- }
14- }],
15- "functions" : [
16- {
17- "name" : " sendRejectionEmailFunction" ,
18- "operation" : " http://myapis.org/applicationapi.json#emailRejection"
19- }
20- ],
21- "retries" : [
22- {
23- "name" : " TimeoutRetryStrategy" ,
24- "delay" : " PT1M" ,
25- "maxAttempts" : " 5"
26- }
27- ],
28- "states" : [
29- {
30- "name" : " CheckApplication" ,
31- "type" : " switch" ,
32- "dataConditions" : [
2+ "id" : " applicantrequest" ,
3+ "version" : " 1.0" ,
4+ "specVersion" : " 0.8" ,
5+ "name" : " Applicant Request Decision Workflow" ,
6+ "description" : " Determine if applicant request is valid" ,
7+ "start" : " CheckApplication" ,
8+ "functions" : [
339 {
34- "condition" : " ${ .applicants | .age >= 18 }" ,
35- "transition" : {
36- "nextState" : " StartApplication"
37- }
38- },
39- {
40- "condition" : " ${ .applicants | .age < 18 }" ,
41- "transition" : {
42- "nextState" : " RejectApplication"
43- }
10+ "name" : " sendRejectionEmailFunction" ,
11+ "operation" : " http://myapis.org/applicationapi.json#emailRejection"
4412 }
45- ],
46- "default" : {
47- "transition" : {
48- "nextState" : " RejectApplication"
13+ ],
14+ "auth" : [
15+ {
16+ "name" : " testAuth" ,
17+ "scheme" : " bearer" ,
18+ "properties" : {
19+ "token" : " test_token"
20+ }
4921 }
50- }
51- },
52- {
53- "name" : " StartApplication" ,
54- "type" : " operation" ,
55- "actions" : [
22+ ],
23+ "retries" : [
5624 {
57- "subFlowRef " : {
58- "workflowId " : " startApplicationWorkflowId "
59- }
25+ "name " : " TimeoutRetryStrategy " ,
26+ "delay " : " PT1M " ,
27+ "maxAttempts" : " 5 "
6028 }
61- ],
62- "end" : {
63- "terminate" : true
64- }
65- },
66- {
67- "name" : " RejectApplication" ,
68- "type" : " operation" ,
69- "actionMode" : " sequential" ,
70- "actions" : [
29+ ],
30+ "states" : [
7131 {
72- "functionRef" : {
73- "refName" : " sendRejectionEmailFunction" ,
74- "parameters" : {
75- "applicant" : " ${ .applicant }"
32+ "name" : " CheckApplication" ,
33+ "type" : " switch" ,
34+ "dataConditions" : [
35+ {
36+ "condition" : " ${ .applicants | .age >= 18 }" ,
37+ "transition" : " StartApplication"
38+ },
39+ {
40+ "condition" : " ${ .applicants | .age < 18 }" ,
41+ "transition" : " RejectApplication"
42+ }
43+ ],
44+ "defaultCondition" : {
45+ "transition" : " RejectApplication"
7646 }
77- }
47+ },
48+ {
49+ "name" : " StartApplication" ,
50+ "type" : " operation" ,
51+ "actions" : [
52+ {
53+ "subFlowRef" : " startApplicationWorkflowId"
54+ }
55+ ],
56+ "end" : true
57+ },
58+ {
59+ "name" : " RejectApplication" ,
60+ "type" : " operation" ,
61+ "actionMode" : " sequential" ,
62+ "actions" : [
63+ {
64+ "functionRef" : {
65+ "refName" : " sendRejectionEmailFunction" ,
66+ "arguments" : {
67+ "applicant" : " ${ .applicant }"
68+ }
69+ }
70+ }
71+ ],
72+ "end" : true
7873 }
79- ],
80- "end" : {
81- "terminate" : true
82- }
83- }
84- ]
74+ ]
8575}
0 commit comments