As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<br> /**<br> * Test starting a process instance using procDefinitionId, key procDefinitionKey business-key.<br> */<br> @Deployment(resources = {"org/activiti/rest/service/api/runtime/ProcessInstanceResourceTest.process-one.bpmn20.xml"})<br> public void testStartProcess() throws Exception {<br> ClientResource client = getAuthenticatedClient(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE_COLLECTION));<br> ObjectNode requestNode = objectMapper.createObjectNode();<br> <br> // Start using process definition key<br> requestNode.put("processDefinitionKey", "processOne");<br> Representation response = client.post(requestNode);<br> assertEquals(Status.SUCCESS_CREATED, client.getResponse().getStatus());<br> <br> ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();<br> assertNotNull(processInstance);<br> <br> JsonNode responseNode = objectMapper.readTree(response.getStream());<br> assertNotNull(responseNode);<br> assertEquals(processInstance.getId(), responseNode.get("id").getTextValue());<br> assertTrue(responseNode.get("businessKey").isNull());<br> assertEquals("processTask", responseNode.get("activityId").getTextValue());<br> assertFalse(responseNode.get("suspended").getBooleanValue());<br>