cancel
Showing results for 
Search instead for 
Did you mean: 

REST API Bugs/Changes 'kermit' hardcoded

ruben1
Champ in-the-making
Champ in-the-making
Hi,

a few days ago I updated to Activiti 5.7. The reimplemented REST API doesn't behave like the old one (I had Activiti 5.6 before the update).

I had the problem that claiming tasks wouldn't work. I checked and discovered that the "Perform Task Operation" (REST call 'PUT /task/{taskId}/[claim|complete]') should return with '{"success": true}' (if successful). In the current version however only an HTTP 200 without a body is returned. No problem, fixed my app (though you could update the docs to the lates changes in the API, maybe there are more responses which have changed). But where have all the claimed tasks gone (since the error was only client side)?
Every claimed task got somehow magically assigned to 'kermit', regardless that I was working with my own user. So I digged a little deeper and soon found the following code in the REST webapp:



package org.activiti.rest.api.task;
[…]
public class TaskOperationResource extends SecuredResource {
 
  @Put
  public void executeTaskOperation(Representation entity) {
[…]
      String currentUserId = "kermit";
      if ("claim".equals(operation)) {
        ActivitiUtil.getTaskService().claim(taskId, currentUserId);
      }
[…]
  }
}

After a few swearwords (and maybe a few more Smiley Wink) I decided to build my own REST API since it is clearly listed as <EXPERIMENTAL/> in the documentation and this was proof enough for me. Anyways, the integration in SPRING is very easy and the documentation did suffice and I got it set up and running in almost no time.

I just wanted to let you and other users know about this hardcoded 'kermit' in the REST API.

Ruben
1 REPLY 1

trademak
Star Contributor
Star Contributor
Hi,

That's certainly a bug 😉
It's been fixed in the trunk.

Best regards,