cancel
Showing results for 
Search instead for 
Did you mean: 

Start Example-Report via REST

cocojack42
Champ in-the-making
Champ in-the-making
I want to start the "task-duration-report" via the rest service, but it won't start. I was able to start one of the other processes, but this one always fails:

Header:

POST /activiti-webapp-explorer2/rest/runtime/process-instances HTTP/1.1
Host: localhost:8080
Authorization: Basic a2VybWl0Omtlcm1pdA==
Accept: application/json
Content-Type: application/json
Cache-Control: no-cache

Data:


{
  "processDefinitionId":"task-duration-report:1:46",
  "variables":[
    {
      "name":"processDefinition",
      "value":"reviewSaledLead:1:38"
    },
    {
      "name":"chartType",
      "value":"pieChart"
    }
  ],
}


reply


{
    "errorMessage": "The server understands the content type of the request entity and the syntax of the request entity is correct but was unable to process the contained instructions",
    "statusCode": 422
}


what do I do wrong?

P.S.
I've started the REST servlet with the activiti-webapp-explorer2 mapped to the /rest pattern
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

The request body which I use for starting the process with variables

{
   "processDefinitionKey":"vacationRequest",
   "businessKey":"myBusinessKey",
"employeeName":"gonzo",
        "numberOfDays":"10",
        "startDate":"01-01-2015 12:00",
        "vacationMotivation":"I need to."
}

More info:
org.activiti.rest.service.api.legacy.StartProcessInstanceResourceTest#testStartInstanceWithVariables

Regards
Martin