Hi,
I am using the REST Api to communicate with Camunda. Many Rest calls are working fine but I have a problem to claim a task. In the docu is the following link described.
POST /task/{id}/claim
For me it is new that the ID is somewhere in the middle of the url? Is it a query Param or just a real text?
Anyway… I am getting everytime a Bad Request.
Can someone give me a hint?
I implemented the folowing client using JERSEY.
public void claimTask(TaskDto taskDto) throws TaskedNotClaimedException {
String taskId = taskDto.getId();
String camundaMethod = "task/"+taskId+"/claim";
String url = REST_URI + camundaMethod;
WebTarget webTarget = client.target(url);
ClientResponse response = webTarget.request().post(Entity.entity(user.getUserName(), MediaType.APPLICATION_JSON),
ClientResponse.class);
if (response.getStatus() >= 204) {
throw new TaskedNotClaimedException("Request Not Successful. TaskId = " + taskId + "and UserID = " + user
.getUserName() + " Response = " +response.toString());
}
}
I call the method with the following unit tests…
@Test
public void claimTask() throws TaskedNotClaimedException {
Mockito.when(user.getUserName()).thenReturn("demo");
TaskDto task = new TaskDto();
task.setId("dd270476-9275-11e7-a125-b2fc20524153");
sut.claimTask(task);
}
The jersey call is returns a Bad Request Exception
Thanks