File tree 12 files changed +177
-213
lines changed
api/src/test/resources/features
custom-generator/src/main/java/io/serverlessworkflow/generator 12 files changed +177
-213
lines changed Original file line number Diff line number Diff line change 1
1
document :
2
2
dsl : 1.0.0-alpha1
3
3
namespace : default
4
- name : http-call-with-content -output
4
+ name : http-call-with-response -output
5
5
do :
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:
3
3
namespace : default
4
4
name : openapi-call-with-content-output
5
5
do :
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 1
1
document :
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
5
5
do :
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 1
1
document :
2
2
dsl : 1.0.0-alpha1
3
3
namespace : default
4
- name : non-object- output
4
+ name : output-filtering
5
5
do :
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 1
1
document :
2
- dsl : 1.0.0-alpha1
3
- namespace : default
4
- name : emit
2
+ dsl : 1.0.0-alpha1
3
+ namespace : default
4
+ name : emit
5
5
do :
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 1
1
document :
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
5
5
do :
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 1
1
document :
2
- dsl : 1.0.0-alpha1
3
- namespace : default
4
- name : for
2
+ dsl : 1.0.0-alpha1
3
+ namespace : default
4
+ name : for
5
5
do :
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 1
1
document :
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
5
5
do :
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 1
1
document :
2
- dsl : 1.0.0-alpha1
3
- namespace : default
4
- name : set
2
+ dsl : 1.0.0-alpha1
3
+ namespace : default
4
+ name : set
5
5
do :
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 1
1
document :
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
5
5
do :
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
Original file line number Diff line number Diff line change 1
1
document :
2
- dsl : 1.0.0-alpha1
3
- namespace : default
4
- name : try-catch-404
2
+ dsl : 1.0.0-alpha1
3
+ namespace : default
4
+ name : try-catch-404
5
5
do :
6
- tryGetPet :
7
- try :
8
- call : http
9
- with :
10
- method : get
11
- endpoint :
12
- uri : https://petstore.swagger.io/v2/pet/getPetByName/{petName}
13
- catch :
14
- errors :
15
- with :
16
- type : https://serverlessworkflow.io/dsl/errors/types/communication
17
- status : 404
18
- as : err
19
- do :
20
- set :
21
- error : ${ $err }
6
+ - tryGetPet :
7
+ try :
8
+ - getPet :
9
+ call : http
10
+ with :
11
+ method : get
12
+ endpoint :
13
+ uri : https://petstore.swagger.io/v2/pet/getPetByName/{petName}
14
+ catch :
15
+ errors :
16
+ with :
17
+ type : https://serverlessworkflow.io/dsl/errors/types/communication
18
+ status : 404
19
+ as : err
20
+ do :
21
+ - setError :
22
+ set :
23
+ error : ${ $err }
You can’t perform that action at this time.
0 commit comments