AnsweredAssumed Answered

Passing complex process variable via REST

Question asked by gant on Feb 6, 2011
Hi,

I tried to start a process instance via REST (using JSON). This works. No I want to pass e complex Java object as a process variable. The object is a bean with all getters and setters.

Following exception occurs:


20:23:46,524  ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status templat
e error: 01050003 Wrapped Exception (with status template): couldn't find type for {"message":"asdf","dueDate":{"time":1
298329200000,"minutes":0,"seconds":0,"hours":0,"month":1,"year":111,"timezoneOffset":-60,"day":2,"date":22},"recipient":
"","requestor":""}
org.springframework.extensions.webscripts.WebScriptException: 01050003 Wrapped Exception (with status template): couldn'
t find type for {"message":"asdf","dueDate":{"time":1298329200000,"minutes":0,"seconds":0,"hours":0,"month":1,"year":111
,"timezoneOffset":-60,"day":2,"date":22},"recipient":"","requestor":""}
        at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:742)

        at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:167)
        at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
        at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.activiti.engine.ActivitiException: couldn't find type for {"message":"asdf","dueDate":{"time":12983292000
00,"minutes":0,"seconds":0,"hours":0,"month":1,"year":111,"timezoneOffset":-60,"day":2,"date":22},"recipient":"","reques
tor":""}
        at org.activiti.engine.impl.variable.DefaultVariableTypes.findVariableType(DefaultVariableTypes.java:62)
        at org.activiti.engine.impl.runtime.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:213)
        at org.activiti.engine.impl.runtime.VariableScopeImpl.setVariable(VariableScopeImpl.java:165)
        at org.activiti.engine.impl.runtime.VariableScopeImpl.setVariables(VariableScopeImpl.java:254)
        at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:63)
        at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:29)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:22)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:37)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceById(RuntimeServiceImpl.java:69)
        at org.activiti.rest.api.process.ProcessInstancePost.executeWebScript(ProcessInstancePost.java:49)
        at org.activiti.rest.util.ActivitiWebScript.executeImpl(ActivitiWebScript.java:68)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)
        … 17 more

How can I put a JavaBean into a process variable using REST?

Regards,
michael

Outcomes