02-05-2011 10:41 AM
public void startProcessInstance(String processDefinitionId, Object processVariable) {
JSONObject requestObject = new JSONObject();
requestObject.put("processDefinitionId", "AdhocTaskProcess:1");
requestObject.put("processVariable", processVariable);
// TODO Handling RestClientException
login();
template.postForEntity("http://localhost:15000/activiti-rest/service/process-instance", requestObject, JSONObject.class);
}
private void login(){
Credentials credentials = new UsernamePasswordCredentials("kermit", "kermit");
CommonsClientHttpRequestFactory factory = (CommonsClientHttpRequestFactory) template.getRequestFactory();
HttpClient client = factory.getHttpClient();
client.getState().setCredentials(AuthScope.ANY, credentials);
}
16:17:01,719 ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status templat
e error: 01050001 Wrapped Exception (with status template): no deployed process definition found with id 'AdhocTaskProce
ss:1'
org.springframework.extensions.webscripts.WebScriptException: 01050001 Wrapped Exception (with status template): no depl
oyed process definition found with id 'AdhocTaskProcess:1'
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: no deployed process definition found with id 'AdhocTaskProcess:1'
at org.activiti.engine.impl.db.DbRepositorySession.findDeployedProcessDefinitionById(DbRepositorySession.java:18
1)
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:47)
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
(ID_, CATEGORY_, NAME_, KEY_, VERSION_, DEPLOYMENT_ID_, RESOURCE_NAME_, DGRM_RESOURCE_NAME_, HAS_START_FORM_KEY_) VALUES
('AdhocTaskProcess:1:815', 'http://www.signavio.com/bpmn20', 'AdhocTaskProcess', 'AdhocTaskProcess', 1, '810', 'AdhocTaskProcess.bpmn20.xml', 'AdhocTaskProcess.AdhocTaskProcess.png', 0),
02-05-2011 12:23 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.