AnsweredAssumed Answered

Process Variables, Activiti REST

Question asked by anjan on Mar 26, 2015
Latest reply on Mar 28, 2015 by nekojiru
I am using the latest version of Activiti (5.17.0).  I have deployed Activiti REST and Activiti Explorer (as separate web apps) in Tomcat.  Both the apps are configured to use the same MySQL database.  I created a Process definition and successfully deployed it through activiti-explorer.

Now using the Activiti REST API, I started a process instance.

<pre>
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"
       }
    ]
}
</pre>

and I got the below successful response:
<pre>
    {
       "id": "10001",
       "url": "http://localhost:8080/activiti-rest/service/runtime/process-instances/10001",
       "businessKey": null,
       "suspended": false,
       "ended": false,
       "processDefinitionId": "Review:1:2508",
       "processDefinitionUrl": "http://localhost:8080/activiti-rest/service/repository/process-definitions/Review:1:2508",
       "activityId": "reviewTask",
       "variables":
       [
       ],
       "tenantId": "",
       "completed": false
    }
</pre>
Here I don't see the process variables (variables is an empty array in the json response).

I also tried to get this information by adding the request paramer "includeProcessVariables" (tried with yes/true for the value), but the URL http://localhost:8080/activiti-rest/service/runtime/process-instances/10001?includeProcessVariables=yes
doesn't return the process variables.

My objective is to show all the Process Variables injected at the start of the workflow at all the User Tasks in the workflow.  Am I missing something here?  Please advice.

Outcomes