AnsweredAssumed Answered

Passing complex objects to instantiate process

Question asked by justaname on Jul 7, 2011
Latest reply on May 13, 2013 by frederikheremans1
Hello all,

I have a problem with passing complex objects to instantiate a process. The HTTP call and instantiation works fine if a pass the following message:
{"customerid":"cid_1234","ordervalue":4000,","processDefinitionId":"ReferenceProcessSimple:1:120"}
(although the process instance fails because of missing arguments ;-) )


but when I send this JSON:

{"order":{"article":[{"articleid":"artid_4444","articleprice":500,"articleamount":2,"articlename":"computer"},{"articleid":"artid_5555","articleprice":1000,"articleamount":3,"articlename":"laptop"}],"customerid":"cid_1234","ordervalue":4000,"customertel":"0176/765764","customername":"somename"},"processDefinitionId":"ReferenceProcessSimple:1:120"}

the following error is thrown:

1448

{
    "status" :
  {
    "code" : 500,
    "name" : "Internal Error",
    "description" : "An error inside the HTTP server which prevented it from fulfilling the request."
  }, 
 
  "message" : "06070013 Wrapped Exception (with status template): couldn't find type for {\"customerid\":\"cid_1234\",\"article\":[{\"articleid\":\"artid_4444\",\"articleprice\":500,\"articleamount\":2,\"articlename\":\"computer\"},{\"articleid\":\"artid_5555\",\"articleprice\":1000,\"articleamount\":3,\"articlename\":\"laptop\"}],\"ordervalue\":4000,\"customertel\":\"0176\/765764\",\"customername\":\"somename\"}", 
  "exception" : "org.springframework.extensions.webscripts.WebScriptException - 06070013 Wrapped Exception (with status template): couldn't find type for {\"customerid\":\"cid_1234\",\"article\":[{\"articleid\":\"artid_4444\",\"articleprice\":500,\"articleamount\":2,\"articlename\":\"computer\"},{\"articleid\":\"artid_5555\",\"articleprice\":1000,\"articleamount\":3,\"articlename\":\"laptop\"}],\"ordervalue\":4000,\"customertel\":\"0176\/765764\",\"customername\":\"somename\"}",
 
  "callstack" :
  [
       ""      ,"org.activiti.engine.ActivitiException: couldn't find type for {\"customerid\":\"cid_1234\",\"article\":[{\"articleid\":\"artid_4444\",\"articleprice\":500,\"articleamount\":2,\"articlename\":\"computer\"},{\"articleid\":\"artid_5555\",\"articleprice\":1000,\"articleamount\":3,\"articlename\":\"laptop\"}],\"ordervalue\":4000,\"customertel\":\"0176\/765764\",\"customername\":\"somename\"}"
      ,"org.activiti.engine.impl.variable.DefaultVariableTypes.findVariableType(DefaultVariableTypes.java:62)"
      ,"org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:212)"
      ,"org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:164)"
      ,"org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariables(VariableScopeImpl.java:253)"


I have tried different alternatives to create the JSON-File (manually, XML.toJSONObject, JSONObject) and structures of the message but all of them fail with the same error message.

Since I have defined some custom logging in the process, I would at least recognize if the instance would have been started and the assignment of a variable would fail.


Help is very appreciated.

Thanks in advance!

Outcomes