https://docs.camunda.org/rest/camunda-bpm-platform/7.19/
#!/bin/sh
function task_var_get() {
curl -s -v 1 -X GET -H 'Content-Type: application/json' \\
<http://127.0.0.1:8080/engine-rest/task/$1/variables/$2>
}
function task_complete() {
curl -s -v 1 -X POST -H 'Content-Type: application/json' \\
-d "$2" \\
<http://127.0.0.1:8080/engine-rest/task/$1/complete>
}
function proc_inst_modify() {
curl -s -v 1 -X POST -H 'Content-Type: application/json' \\
-d "{\\"skipCustomListeners\\": true, \\"skipIoMappings\\":true, \\"instructions\\": [{\\"type\\": \\"startBeforeActivity\\", \\"activityId\\": \\"$2\\"}] }" \\
<http://127.0.0.1:8080/engine-rest/process-instance/$1/modification>
}
function msg_deliver() {
curl -s -v 1 -X POST -H 'Content-Type: application/json' \\
-d "{\\"processInstanceId\\": \\"$1\\", \\"messageName\\": \\"$2\\"}" \\
<http://127.0.0.1:8080/engine-rest/message>
}
function proc_def_suspended() {
curl -s -v 1 -X PUT -H 'Content-Type: application/json' \\
-d "{\\"processDefinitionKey\\": \\"$1\\", \\"suspended\\": true, \\"includeProcessInstances\\": true}" \\
<http://127.0.0.1:8080/engine-rest/process-definition/suspended>
}
function proc_def_del() {
curl -s -v 1 -X DELETE -H 'Content-Type: application/x-www-form-urlencoded' \\
"<http://127.0.0.1:8080/engine-rest/process-definition/$1?cascade=true&skipCustomListeners=true&skipIoMappings=true>"
}
function proc_def_del_by_key() {
curl -s -v 1 -X DELETE -H 'Content-Type: application/x-www-form-urlencoded' \\
"<http://127.0.0.1:8080/engine-rest/process-definition/key/$1?cascade=true&skipCustomListeners=true&skipIoMappings=true>"
}
case $1 in
task_var_get)
task_var_get $2 $3;;
task_complete)
task_complete $2 $3;;
proc_inst_modify)
proc_inst_modify $2 $3;;
msg_deliver)
msg_deliver $2 $3;;
proc_def_suspended)
proc_def_suspended $2;;
proc_def_del)
proc_def_del $2;;
proc_def_del_by_key)
proc_def_del_by_key $2;;
esac