cancel
Showing results for 
Search instead for 
Did you mean: 

Access process variables

jemclaurin2022
Champ in-the-making
Champ in-the-making
I have created a process using REST APIs as such:
http://localhost:8080/activiti-rest/service/runtime/process-instances
POST
{
    "processDefinitionId": "Review:1:2508",
    "variables": [
        {
            "name": "assignTo",
            "value": "admin"
        },
        {
            "name": "taskPriority",
            "value": "taskPNormal"
        },
        {
            "name": "workflowDescription",
            "value": "desc"
        },
       {
           "name":"dueDate",
           "value":"2015-04-15T00:42:12Z",
           "type":"date"
       }
    ]
}

How do I access these variables in a task?
3 REPLIES 3

hari
Star Contributor
Star Contributor
Hi,

If you want to access the process instance variables, you can use the below REST call
GET runtime/process-instances/{processInstanceId}/variables

If you want to get the value of a specific variable, you can use the below call
GET runtime/process-instances/{processInstanceId}/variables/{variableName}

Please refer to the user guide for more information.
http://activiti.org/userguide/index.html#_rest_api

jemclaurin2022
Champ in-the-making
Champ in-the-making
Hari … thanks but not what I was looking for.  My process is created by the REST call only,  I want to access the variable in a user task, email task or make a decision based on the value of the initial variable supplied.

jemclaurin2022
Champ in-the-making
Champ in-the-making
I found the answer:  Listener Configuration/Expression using the command execution.getVariable(joey); on the "start" event.