AnsweredAssumed Answered

problems starting a process using rest api

Question asked by new@ctivitiuser on Feb 25, 2014
Latest reply on Mar 4, 2014 by new@ctivitiuser
Hi,
   I am trying to start a process using the rest api. Here is my code

DefaultHttpClient dhc = new DefaultHttpClient();
dhc.getCredentialsProvider().setCredentials(new AuthScope("localhost", 8080), new UsernamePasswordCredentials("kermit", "kermit"));
HttpPost hp = new HttpPost("http://localhost:8080/activiti-rest/service/runtime/process-instance");
StringEntity se = new StringEntity("{\"processDefinitionId\":\"myProcess:1:1234\"}", "UTF-8");
se.setContentType("application/json");
hp.setEntity(se);
HttpResponse processResponse = dhc.execute(hp);
System.out.println(IOUtils.toString(processResponse.getEntity().getContent()));
dhc.getConnectionManager().shutdown();

i get an error {"errorMessage":"Method Not Allowed", "statusCode":405}

But when I use the same url and test it in postman with basic Authentication it says

{
    "errorMessage":"no deployed process definition found with id 'myProcess:1:1358'.",
    "statusCode": 400
}

Please help. This is an urgent issue. The rest api is not working either way.

Outcomes