AnsweredAssumed Answered

cannot complete user task http 400 bad request

Question asked by shailk on Jun 8, 2015
Latest reply on Jun 12, 2015 by shailk
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','delegationState':null,'name':'Capture 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':null,'executionId':'40','executionUrl':'http://localhost:8082/activiti-rest/service/runtime/executions/40','processInstanceId':'40','processInstanceUrl':'http://localhost:8082/activiti-rest/service/runtime/process-instances/40','processDefinitionId':'oneTaskProcess:1:34','processDefinitionUrl':'http://localhost:8082/activiti-rest/service/repository/process-definitions/oneTaskProcess:1:34','variables":[]}

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" activiti:owner="${initiator}" activiti:initiator="initiator" />
    <sequenceFlow id="flow1" sourceRef="theStart" targetRef="theTask" />
    <userTask id="theTask" name="Capture form" activiti:owner="${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" activiti:owner="${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>

Outcomes