AnsweredAssumed Answered

Start a process instance using REST

Question asked by signjoy on Jul 25, 2017
Latest reply on Jul 26, 2017 by naveenv449

I have Springboot app that talks to Alfresco Enterprise Activiti using REST calls.


I want to start the process instance using REST call but I am getting 400 bed request. however the same request works with postman.


String url = "http://localhost:9091/activiti-app/api/enterprise/process-instances";
RestTemplate restTemplate = new RestTemplate();
restTemplate.getInterceptors().add(new BasicAuthorizationInterceptor("", "admin"));
HttpHeaders headers = new HttpHeaders();
HttpEntity<String> entity = new HttpEntity<String>("parameters", headers);
CreateProcessInstanceRepresentation cpir = new CreateProcessInstanceRepresentation ();
ObjectMapper mapper = mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
json = mapper.writeValueAsString(cpir);
JsonNode jsonNode = mapper.readTree(json);, HttpMethod.POST, entity, Object.class, jsonNode); // Throws 400 Bad Request

Please help..
Thank you in advance...