cancel
Showing results for 
Search instead for 
Did you mean: 

Task actions strange error message via REST call

augustus
Champ in-the-making
Champ in-the-making
I've been testing task actions via REST call (complete, delegate, claim, resolve) but I'm getting strange error message back.

JSON request (this is for delegate, but I get the same message with any action):

{"action":"delegate","assignee":"kermit"}


Here is the response:

{"errorMessage":"Invalid action: 'null'.","statusCode":400}


The uri: service/runtime/tasks/{taskId}

Any idea?
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
Are you sure you're passing in a non-null value for the "action"?

We have test-coverage for this: https://github.com/Activiti/Activiti/blob/83e80219c4f79dd446e68ed9f6fccbb4647c1ce3/modules/activiti-...


/**
   * Test delegating a single task and all exceptional cases related to delegation.
   * POST runtime/tasks/{taskId}
   */
  public void testDelegateTask() throws Exception {
    try {

          …
          ObjectNode requestNode = objectMapper.createObjectNode();
          requestNode.put("action", "delegate");

augustus
Champ in-the-making
Champ in-the-making
The posted json is what I pass right before calling the rest service. Is there a way to log all calls on the rest app side? Haven't checked the code to see if there is such detailed log option. It would be good to see what was received on the server side.

frederikherema1
Star Contributor
Star Contributor
I'm not sure if the actual body of request will be logged but you can try lowering the log-lever for org.restlet classes. (http://restlet.org/learn/guide/2.1/editions/jse/logging). Another option is to attach a debugger and debug in the class org.activiti.rest.api.runtime.task.TaskActionRequest, this is where the JSON is turned into a POJO used in the restlet-service. If you move a bit up in the stack, you'll be able to see the actual JSON that Jackson is using…