AnsweredAssumed Answered

start a new process

Question asked by christian_wenz on Oct 31, 2013
Latest reply on Jun 20, 2015 by arak
Hi,

I try to start a new process via the public api on a 4.2 on-premise installation.
If I send a POST request with a REST client to the URL http://localhost:8080/alfresco/api/-default-/public/workflow/versions/1/processes
with this body
 
{
"processDefinitionKey": "activitiAdhoc",
"businessKey": "55",
"variables": [
            {
                "name": "bpm_priority",
                "value": 1,
                "type": "d:int"
                }
        ]
}


I get this response:

{
error: {
errorKey: "Could not read content from HTTP request body: Can not deserialize instance of java.util.LinkedHashMap out of START_ARRAY token at [Source: java.io.BufferedReader@3ac6cf75; line: 3, column: 20] (through reference chain: org.alfresco.rest.workflow.api.model.ProcessInfo["variables"])"
statusCode: 400
briefSummary: "09310034 Could not read content from HTTP request body: Can not deserialize instance of java.util.LinkedHashMap out of START_ARRAY token at [Source: java.io.BufferedReader@3ac6cf75; line: 3, column: 20] (through reference chain: org.alfresco.rest.workflow.api.model.ProcessInfo["variables"])"
stackTrace: "[org.alfresco.rest.framework.jacksonextensions.JacksonHelper.constructList(JacksonHelper.java:139), org.alfresco.rest.framework.webscripts.ResourceWebScriptHelper.extractJsonContentAsList(ResourceWebScriptHelper.java:301), org.alfresco.rest.framework.webscripts.ResourceWebScriptPost.extractObjFromJson(ResourceWebScriptPost.java:116), org.alfresco.rest.framework.webscripts.ResourceWebScriptPost.extractParams(ResourceWebScriptPost.java:58), org.alfresco.rest.framework.webscripts.AbstractResourceWebScript.execute(AbstractResourceWebScript.java:64), org.alfresco.rest.framework.webscripts.ApiWebScript.execute(ApiWebScript.java:127), org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:377), org.alfresco.rest.api.PublicApiRepositoryContainer.transactionedExecute(PublicApiRepositoryContainer.java:45), org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:529), org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:341), org.alfresco.rest.api.PublicApiRepositoryContainer.access$001(PublicApiRepositoryContainer.java:26), org.alfresco.rest.api.PublicApiRepositoryContainer$1.doWork(PublicApiRepositoryContainer.java:81), org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:119), org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:88), org.alfresco.rest.api.PublicApiRepositoryContainer.executeScript(PublicApiRepositoryContainer.java:77), org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378), org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209), org.alfresco.repo.web.scripts.TenantWebScriptServlet.service(TenantWebScriptServlet.java:74), org.alfresco.rest.api.PublicApiWebScriptServlet.service(PublicApiWebScriptServlet.java:53), javax.servlet.http.HttpServlet.service(HttpServlet.java:728), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210), org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210), org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222), org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123), org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502), org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171), org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99), org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953), org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118), org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408), org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023), org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589), org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:724)]"
descriptionURL: "http://developer.alfresco.com/ErrorsExplained.html#Could not read content from HTTP request body: Can not deserialize instance of java.util.LinkedHashMap out of START_ARRAY token at [Source: java.io.BufferedReader@3ac6cf75; line: 3, column: 20] (through reference chain: org.alfresco.rest.workflow.api.model.ProcessInfo["variables"])"
}-
}


Could anybody help solving my problem?

Outcomes