cancel
Showing results for 
Search instead for 
Did you mean: 

cannot complete user task http 400 bad request

shailk
Champ in-the-making
Champ in-the-making
I am unable to complete user task with the activiti rest api and always gets the http 400 bad request error (whether I run this from rest client or my .net code.

I am using http://localhost:8082/activiti-rest/service/runtime/tasks/49 to post the json body for completing the task.
Authorization: Basic a2VybWl0Omtlcm1pdA==
action: complete

I can view the task with the same GET url and receives the below response:

{"id":"49","url":"http://localhost:8082/activiti-rest/service/runtime/tasks/49','owner':'kermit','assignee':'kermit','... form","description":null,"createTime":"2015-06-08T17:59:08.813+01:00","dueDate":"2015-06-08T18:29:08.906+01:00","priority":50,"suspended":false,"taskDefinitionKey":"theTask","tenantId":"","category":null,"formKey":"http://localhost:8082/orbeon/fr/TestWorkflow/TestWorkflow/new','parentTaskId':null,'parentTaskUrl':n...":[]}

please see below process definition deployed :
<?xml version="1.0" encoding="UTF-8"?>
<definitions
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:activiti="http://activiti.org/bpmn"
  targetNamespace="Examples">

  <process id="oneTaskProcess" name="Famous One Task Process">
 
    <startEvent id="theStart" activitiSmiley Surprisedwner="${initiator}" activiti:initiator="initiator" />
    <sequenceFlow id="flow1" sourceRef="theStart" targetRef="theTask" />
    <userTask id="theTask" name="Capture form" activitiSmiley Surprisedwner="${initiator}" activiti:assignee="${initiator}" activiti:formKey="http://localhost:8082/orbeon/fr/TestWorkflow/TestWorkflow/new"  activiti:dueDate="PT30M" />

    <sequenceFlow id="flow2" sourceRef="theTask" targetRef="handleRequest" />
   
    <userTask id="handleRequest" activitiSmiley Surprisedwner="${initiator}" activiti:assignee="${initiator}"  name="Approve Form"  >
      <documentation>
        ${initiator} would like to request for your approval for (${process}).
      </documentation>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression>management</formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>        
    </userTask>
   
    <sequenceFlow id="flow3" sourceRef="handleRequest" targetRef="theEnd" />
    <endEvent id="theEnd" />
   
  </process>

</definitions>
3 REPLIES 3

shailk
Champ in-the-making
Champ in-the-making
I have attached the BPMN process definition here

jbarrez
Star Contributor
Star Contributor
>  http 400 bad request error

Means your body of the POST is most likely wrong.

shailk
Champ in-the-making
Champ in-the-making
I have found the problem myself. The next task was expecting variables and I was not passing right variables hence unable to complete the task…Activiti rocks. 🙂