File tree Expand file tree Collapse file tree 12 files changed +182
-212
lines changed
api/src/test/resources/features
custom-generator/src/main/java/io/serverlessworkflow/generator Expand file tree Collapse file tree 12 files changed +182
-212
lines changed Original file line number Diff line number Diff line change 11document :
22 dsl : 1.0.0-alpha1
33 namespace : default
4- name : http-call-with-content -output
4+ name : http-call-with-response -output
55do :
6- getFirstAvailablePet :
7- call : http
8- with :
9- method : get
10- endpoint :
11- uri : https://petstore.swagger.io/v2/pet/findByStatus?status={status}
12- output :
13- from : .[0]
6+ - getPet :
7+ call : http
8+ with :
9+ method : get
10+ endpoint :
11+ uri : https://petstore.swagger.io/v2/pet/{petId}
12+ output : response
Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ document:
33 namespace : default
44 name : openapi-call-with-content-output
55do :
6- getPetsByStatus :
7- call : openapi
8- with :
9- document :
10- uri : https://petstore.swagger.io/v2/swagger.json
11- operation : findPetsByStatus
12- parameters :
13- status : ${ .status }
14- output :
15- from : . | length
6+ - findPet :
7+ call : openapi
8+ with :
9+ document :
10+ uri : " https://petstore.swagger.io/v2/swagger.json"
11+ operation : findPetsByStatus
12+ parameters :
13+ status : ${ .status }
14+ output :
15+ from : . | length
Original file line number Diff line number Diff line change 11document :
2- dsl : 1.0.0-alpha1
3- namespace : default
4- name : composite-sequential
2+ dsl : 1.0.0-alpha1
3+ namespace : default
4+ name : do
55do :
6- setRGB :
7- execute :
8- sequentially :
9- setRed :
10- set :
11- colors : ${ .colors + ["red"] }
12- setGreen :
13- set :
14- colors : ${ .colors + ["green"] }
15- setBlue :
16- set :
17- colors : ${ .colors + ["blue"] }
6+ - compositeExample :
7+ do :
8+ - setRed :
9+ set :
10+ colors : ${ .colors + ["red"] }
11+ - setGreen :
12+ set :
13+ colors : ${ .colors + ["green"] }
14+ - setBlue :
15+ set :
16+ colors : ${ .colors + ["blue"] }
Original file line number Diff line number Diff line change 11document :
22 dsl : 1.0.0-alpha1
33 namespace : default
4- name : non-object- output
4+ name : output-filtering
55do :
6- getPetById1 :
7- call : http
8- with :
9- method : get
10- endpoint :
11- uri : https://petstore.swagger.io/v2/pet/{petId} # simple interpolation, only possible with top level variables
12- output :
13- from : .id
14- getPetById2 :
15- call : http
16- with :
17- method : get
18- endpoint :
19- uri : https://petstore.swagger.io/v2/pet/2
20- output :
21- from : ' { ids: [ $input, .id ] }'
6+ - getPet :
7+ call : http
8+ with :
9+ method : get
10+ endpoint :
11+ uri : https://petstore.swagger.io/v2/pet/{petId} # simple interpolation, only possible with top level variables
12+ output :
13+ as : .id # filters the output of the http call, using only the id of the returned object
Original file line number Diff line number Diff line change 11document :
2- dsl : 1.0.0-alpha1
3- namespace : default
4- name : emit
2+ dsl : 1.0.0-alpha1
3+ namespace : default
4+ name : emit
55do :
6- emitUserGreeted :
7- emit :
8- event :
9- with :
10- source : https://fake-source.com
11- type : com.fake-source.user.greeted.v1
12- data :
13- greetings : ${ "Hello \(.user.firstName) \(.user.lastName)!" }
6+ - emitEvent :
7+ emit :
8+ event :
9+ with :
10+ source : https://fake-source.com
11+ type : com.fake-source.user.greeted.v1
12+ data :
13+ greetings : ${ "Hello \(.user.firstName) \(.user.lastName)!" }
Original file line number Diff line number Diff line change 11document :
2- dsl : 1.0.0-alpha1
3- namespace : default
4- name : implicit-sequence
2+ dsl : 1.0.0-alpha1
3+ namespace : default
4+ name : implicit-sequence
55do :
6- setRed :
7- set :
8- colors : ' ${ .colors + [ "red" ] }'
9- setGreen :
10- set :
11- colors : ' ${ .colors + [ "green" ] }'
12- setBlue :
13- set :
14- colors : ' ${ .colors + [ "blue" ] }'
6+ - setRed :
7+ set :
8+ colors : ' ${ .colors + [ "red" ] }'
9+ - setGreen :
10+ set :
11+ colors : ' ${ .colors + [ "green" ] }'
12+ - setBlue :
13+ set :
14+ colors : ' ${ .colors + [ "blue" ] }'
Original file line number Diff line number Diff line change 11document :
2- dsl : 1.0.0-alpha1
3- namespace : default
4- name : for
2+ dsl : 1.0.0-alpha1
3+ namespace : default
4+ name : for
55do :
6- forEachColor :
7- for :
8- each : color
9- in : ' .colors'
10- do :
11- set :
12- processed : ' ${ { colors: (.processed.colors + [ $color ]), indexes: (.processed.indexes + [ $index ])} }'
6+ - loopColors :
7+ for :
8+ each : color
9+ in : ' .colors'
10+ do :
11+ - markProcessed :
12+ set :
13+ processed : ' ${ { colors: (.processed.colors + [ $color ]), indexes: (.processed.indexes + [ $index ])} }'
Original file line number Diff line number Diff line change 11document :
2- dsl : 1.0.0-alpha1
3- namespace : default
4- name : raise-custom-error
2+ dsl : 1.0.0-alpha1
3+ namespace : default
4+ name : raise-custom-error
55do :
6- raiseComplianceError :
7- raise :
8- error :
9- status : 400
10- type : https://serverlessworkflow.io/errors/types/compliance
11- title : Compliance Error
6+ - raiseError :
7+ raise :
8+ error :
9+ status : 400
10+ type : https://serverlessworkflow.io/errors/types/compliance
11+ title : Compliance Error
Original file line number Diff line number Diff line change 11document :
2- dsl : 1.0.0-alpha1
3- namespace : default
4- name : set
2+ dsl : 1.0.0-alpha1
3+ namespace : default
4+ name : set
55do :
6- initialize :
7- set :
8- shape : circle
9- size : ${ .configuration.size }
10- fill : ${ .configuration.fill }
6+ - setShape :
7+ set :
8+ shape : circle
9+ size : ${ .configuration.size }
10+ fill : ${ .configuration.fill }
Original file line number Diff line number Diff line change 11document :
2- dsl : 1.0.0-alpha1
3- namespace : default
4- name : switch-match
2+ dsl : 1.0.0-alpha1
3+ namespace : default
4+ name : switch-match
55do :
6- switchColor :
7- switch :
8- red :
9- when : ' .color == "red"'
10- then : setRed
11- green :
12- when : ' .color == "green"'
13- then : setGreen
14- blue :
15- when : ' .color == "blue"'
16- then : setBlue
17- setRed :
18- set :
19- colors : ' ${ .colors + [ "red" ] }'
20- then : end
21- setGreen :
22- set :
23- colors : ' ${ .colors + [ "green" ] }'
24- then : end
25- setBlue :
26- set :
27- colors : ' ${ .colors + [ "blue" ] }'
28- then : end
6+ - switchColor :
7+ switch :
8+ - red :
9+ when : ' .color == "red"'
10+ then : setRed
11+ - green :
12+ when : ' .color == "green"'
13+ then : setGreen
14+ - blue :
15+ when : ' .color == "blue"'
16+ then : setBlue
17+ - setRed :
18+ set :
19+ colors : ' ${ .colors + [ "red" ] }'
20+ then : end
21+ - setGreen :
22+ set :
23+ colors : ' ${ .colors + [ "green" ] }'
24+ then : end
25+ - setBlue :
26+ set :
27+ colors : ' ${ .colors + [ "blue" ] }'
28+ then : end
You can’t perform that action at this time.
0 commit comments