I’ve followed the getting started tutorial at https://documentation.bonitasoft.com/?page=getting-started-tutorial and now I’m trying to start a case using the REST API.
After calling loginservice, I’m sending a POST and getting and error 500, with the following message:
{“exception”:“class org.bonitasoft.web.toolkit.client.common.exception.api.APIException”,“message”:“Data definition travelRequest doesn\u0027t exists for process 7525863855240002967”,“api”:“bpm”,“resource”:“case”}
The body of my request looks like this:
{
“processDefinitionId”:“7525863855240002967”,
“variables”:[
{
“name”:“travelRequestInput”,
“value”:
{
“userId”: 4,
“destination”: “LONDON”,
“departureDate”: “2017-12-09”,
“numberOfNights”: 8,
“hotelNeeded”: true,
“reason”: “”,
“status”: “pending”,
“refusalReason”: “”
}
}
]
}
I’ve also tried with this:
{
“processDefinitionId”:“7525863855240002967”,
“variables”:[
{
“travelRequestInput” :
{
“userId”: 4,
“destination”: “LONDON”,
“departureDate”: “2017-12-09”,
“numberOfNights”: 8,
“hotelNeeded”: true,
“reason”: “”,
“status”: “pending”,
“refusalReason”: “”
}
}
]
}
and this:
{
“processDefinitionId”:“7525863855240002967”,
“travelRequestInput” :
{
“userId”: 4,
“destination”: “LONDON”,
“departureDate”: “2017-12-09”,
“numberOfNights”: 8,
“hotelNeeded”: true,
“reason”: “”,
“status”: “pending”,
“refusalReason”: “”
}
}
And the exceptions turns into:
{“exception”:“class org.bonitasoft.web.toolkit.client.common.exception.api.APIException”,“message”:“Error occured when starting process 7525863855240002967”,“cause”:{“exception”:“class org.bonitasoft.engine.bpm.process.ProcessExecutionException”,“message”:“USERNAME=walter.bates | org.bonitasoft.engine.bpm.contract.ContractViolationException: Error while validating expected inputs: [Expected input [travelRequestInput] is missing]”},“api”:“bpm”,“resource”:“case”}
I can’t figure out if its a problem in the API call or in the process definition.
Thanks in advance