AnsweredAssumed Answered

Unable to retrieve tasks using Rest api

Question asked by ganeshr on Jan 9, 2013
Latest reply on Jan 9, 2013 by trademak
I have been trying to retrieve tasks using rest api, using uri - http://localhost:9090/activiti-rest/service/tasks?[assignee={userid}|candidate={userid}|candidate-group={groupid}]"
  For that candidate group tasks are available but still it is giving empty data. When checked in tomcat cosole it has the folowing errors,

Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'taskPayloadData'
        at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83)
        at org.activiti.engine.impl.juel.AstProperty.eval(AstProperty.java:52)
        at org.activiti.engine.impl.juel.AstProperty.eval(AstProperty.java:52)
        at org.activiti.engine.impl.juel.AstEval.eval(AstEval.java:50)
        at org.activiti.engine.impl.juel.AstNode.getValue(AstNode.java:26)
        at org.activiti.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114)
        at org.activiti.engine.impl.delegate.ExpressionGetInvocation.invoke(ExpressionGetInvocation.java:33)
        at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)
        at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25)
        at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:50)

I have assigned task fields in this way.
    <userTask id="gnHumanTask" name="Erm HumanTask" activiti:candidateGroups="BRMManager">
      <extensionElements>
        <activiti:formProperty id="Id" name=" Id" type="string" expression="#{taskPayloadData.processPayload.id}" writable="true"></activiti:formProperty>
          —–

Using client program I have created a process and  process is created with user task.
  Here is sample program for invoking process
   PayloadRequest processPaylaod = new PayloadRequest ();
      processPaylaod.setId(1001);
               ———–
  Map<String, Object> payloadRequest = new HashMap<String, Object>();
         payloadRequest.put("taskPayloadData", processPaylaod);
         ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(
               "brmQueueProcess",payloadRequest);

  Using the above java code, able to invoke instance and task is getting created and able to see the tasks in explorer.

But when trying to retrieve tasks using rest api getting the above exception. how to resolve the above issue?

Outcomes