AnsweredAssumed Answered

unable to pass process payload using Rest api

Question asked by ganeshr on Oct 19, 2012
Latest reply on Oct 19, 2012 by frederikheremans1
I am trying to create a process instance with process payload using rest api.
Using http://localhost:8080/activiti-rest/service/process-instance able to create a process instance but task does not contain the data passed.
And In console it is showing the error as Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Could not find property processPayload in class java.lang.String

Code:
   String uri = REST_URI + "/process-instance";
      PayloadRequest payloadRequest  = new PayloadRequest();
       payloadRequest.setEmpName("Test");
        payloadRequest.setEmpCode("123");
         —

          JSONStringer jsRequest = new JSONStringer();
          jsRequest.object();
          jsRequest.key("processDefinitionKey").value(processDefinitionId);
          jsRequest.key("processPayloadData").value(payloadRequest);        
          jsRequest.endObject();
          Representation rep = new JsonRepresentation(jsRequest);
          rep.setMediaType(MediaType.APPLICATION_JSON);
          JSONObject jsObj = new JSONObject(getClientResource(uri).post(rep).getText());
          System.out.println("Returning processId " + jsObj.getString("id"));

  Does Rest api does not accept Java object as variables?

Outcomes