Error 404 with REST API /bonita/API/bpm/activity/{activity_id} trying to execute a task

Hi experts,

I’m testing with Bonita Community 7.2.3 and the Travel Requests sample.

This is my Human Task activity I’m trying to reject using REST API. I get its details with a GET call to http://localhost:8080/bonita/API/bpm/activity/120009:

{
“displayDescription”: “”,
“executedBy”: “0”,
“rootContainerId”: “5004”,
“assigned_date”: “2016-05-17 11:22:01.813”,
“displayName”: “Manager Review”,
“executedBySubstitute”: “0”,
“dueDate”: “2016-05-17 12:22:01.799”,
“description”: “”,
“type”: “USER_TASK”,
“priority”: “normal”,
“actorId”: “401”,
“processId”: “6234868444427837933”,
“caseId”: “5004”,
“name”: “Manager Review”,
“reached_state_date”: “2016-05-17 11:22:01.814”,
“rootCaseId”: “5004”,
“id”: “120009”,
“state”: “ready”,
“parentCaseId”: “5004”,
“last_update_date”: “2016-05-17 11:22:01.814”,
“assigned_id”: “1”
}

If I do a PUT call to: http://localhost:8080/bonita/API/bpm/activity/120009, using this payload:
{“state”: “completed”}

I get this error:
“exception”: “class org.bonitasoft.web.toolkit.client.common.exception.api.APIException”,
“message”: "org.bonitasoft.engine.bpm.flownode.FlowNodeExecutionException: USERNAME=william.jobs | org.bonitasoft.engine.bpm.contract.ContractViolationException: Error while validating expected inputs: [Expected input [status] is missing, Expected input [refusalReason] is missing]"

But when trying to set values to the variables using this payload:
{“state”: “completed”,
“variables”: [{“name”: “status”, “value”: “refused”},
{“name”: “refusalReason”, “value”: “NO WAY”}
]
}

I get a 404 error.

What am I doing wrong?

Regards,
Jose.

Hi all,

Using Membrane Monitor (http://www.membrane-soa.org/soap-monitor/) I’ve captured the REST operation done when approving the Travel Request via the form. I was confused by the doc, trying to use /bonita/API/bpm/activity/{id}/ when it’s actually:

POST:/bonita/API/bpm/userTask/{userTaskId}/execution
Payload:
{“status”:“refused”,“refusalReason”:“NO WAY”}

Hope it helps to someone!

Hi, could you resolve this?

Any help on this? Thanks!

Hi Jose, I have the same respone in both services.
I can modify the value of variables using this service /API/bpm/caseVariable/{caseId}/{variableName} but I not way to excecute the task by any rest api service.

Thanks for your help!