BPMS script task (scriptTask)
Camunda's default option that allows creating simple, quick scripts without the need to create Java/ScriptCode handlers
Available languages include e.g. Groovy/JavaScript
Documentation
https://docs.camunda.org/manual/7.21/reference/bpmn20/tasks/script-task/
https://docs.camunda.org/manual/7.22/user-guide/process-engine/scripting/
Attaching a ScriptTask to the process
We select Task and subtype ScriptTask:
Format: Language e.g. Groovy/JavaScript
Type: Inline Script
Script: the script we want to invoke

Common methods
execution.getVariable("variableName") - Retrieves a process variable
execution.setVariable("variableName", value) - Sets a process variable
execution.removeVariable("variableName") - Removes a variable from the process
execution.hasVariable("variableName") - Checks whether a variable exists in the process
execution.getProcessInstanceId() || execution.getId() - gets the process IDMore information about JSON: https://docs.camunda.org/manual/7.7/reference/spin/json/01-reading-json/
Last updated
Was this helpful?
