-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_process_scenario_01.sh
executable file
·58 lines (41 loc) · 2.32 KB
/
run_process_scenario_01.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
echo ""
echo Conditional Event: Start Process
curl --location --request POST 'http://localhost:8080/rest/condition' --header 'Content-Type: application/json' --data-raw '{
"variables" : {
"processStarted" : {"value" : true, "type": "boolean"},
"userTask1Started" : {"value" : "false", "type": "boolean"},
"userTask2Started" : {"value" : "false", "type": "boolean"},
"processContinue" : {"value" : "false", "type": "boolean"},
"conditionalEventSubProcess1": {"value" : "false", "type": "boolean"},
"conditionalEventSubProcess2": {"value" : "false", "type": "boolean"}
},
"businessKey": "process-key-123"
}'
sleep 5
echo ""
echo Conditional Event: Conditional Boundary Event Non-Interrupting
PROCESS_ID=$(curl --location --fail --silent --request GET 'http://localhost:8080/rest/process-instance' --header 'Content-Type: application/json' --data-raw '{ "businessKey": "process-key-123"}' | jq -r '.[0].id')
curl --location --fail --silent --request POST "http://localhost:8080/rest/process-instance/$PROCESS_ID/variables" --header 'Content-Type: application/json' --data-raw '{
"modifications":
{"userTask1Started": {"value" : true, "type": "boolean"}},
"deletions": []
}'
sleep 5
echo Conditional Event: Complete User Task 1
TASK_ID=$(curl --location --fail --silent --request POST 'http://localhost:8080/rest/task' --header 'Content-Type: application/json' --data-raw '{ "processInstanceBusinessKey": "process-key-123", "taskDefinitionKey": "user-task-1"}' | jq -r '.[0].id')
curl --location --fail --silent --request POST "http://localhost:8080/rest/task/$TASK_ID/complete" --header 'Content-Type: application/json'
sleep 5
echo Conditional Event: Conditional Intermediate Catch Event
curl --location --fail --silent --request POST "http://localhost:8080/rest/process-instance/$PROCESS_ID/variables" --header 'Content-Type: application/json' --data-raw '{
"modifications":
{"processContinue": {"value" : true, "type": "boolean"}},
"deletions": []
}'
echo Conditional Event: Conditional Boundary Event Interrupting
curl --location --fail --silent --request POST "http://localhost:8080/rest/process-instance/$PROCESS_ID/variables" --header 'Content-Type: application/json' --data-raw '{
"modifications":
{"userTask2Started": {"value" : true, "type": "boolean"}},
"deletions": []
}'
sleep 5