Source:
public void testStartProcessInDifferentDeploymentWithAlias() throws Exception { Object person = createPersonInstance(USER_JOHN); Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("test", USER_MARY); parameters.put("number", new Integer(12345)); List<Object> list = new ArrayList<Object>(); list.add("item"); parameters.put("list", list); parameters.put("person", person); Long processInstanceIdV1 = null; Long processInstanceIdV2 = null; try { processInstanceIdV1 = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION, parameters); assertNotNull(processInstanceIdV1); assertTrue(processInstanceIdV1.longValue() > 0); ProcessInstance processInstance = processClient.getProcessInstance(CONTAINER_ALIAS, processInstanceIdV1); assertNotNull(processInstance); assertEquals(CONTAINER_ID, processInstance.getContainerId()); List<TaskSummary> tasks = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, 0, 10); assertEquals(1, tasks.size()); TaskSummary task = tasks.get(0); assertEquals(CONTAINER_ID, task.getContainerId()); taskClient.completeAutoProgress(CONTAINER_ALIAS, task.getId(), USER_YODA, null); createExtraContainer(); processInstanceIdV2 = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION, parameters); assertNotNull(processInstanceIdV2); assertTrue(processInstanceIdV2.longValue() > 0); processInstance = processClient.getProcessInstance(CONTAINER_ALIAS, processInstanceIdV2); assertNotNull(processInstance); assertEquals(CONTAINER_ID_101, processInstance.getContainerId()); tasks = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, 0, 10); assertEquals(1, tasks.size()); task = tasks.get(0); assertEquals(CONTAINER_ID_101, task.getContainerId()); taskClient.completeAutoProgress(CONTAINER_ALIAS, task.getId(), USER_YODA, null); } finally { if (processInstanceIdV1 != null) { processClient.abortProcessInstance(CONTAINER_ALIAS, processInstanceIdV1); } if (processInstanceIdV2 != null) { processClient.abortProcessInstance(CONTAINER_ALIAS, processInstanceIdV2); } } }

Target:
public void testStartProcessInDifferentDeploymentWithAlias() throws Exception { Object person = createPersonInstance(USER_JOHN); Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("test", USER_MARY); parameters.put("number", new Integer(12345)); List<Object> list = new ArrayList<Object>(); list.add("item"); parameters.put("list", list); parameters.put("person", person); Long processInstanceIdV1 = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION, parameters); assertNotNull(processInstanceIdV1); assertTrue(processInstanceIdV1.longValue() > 0); ProcessInstance processInstance = processClient.getProcessInstance(CONTAINER_ALIAS, processInstanceIdV1); assertNotNull(processInstance); assertEquals(CONTAINER_ID, processInstance.getContainerId()); List<TaskSummary> tasks = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, 0, 10); assertEquals(1, tasks.size()); TaskSummary task = tasks.get(0); assertEquals(CONTAINER_ID, task.getContainerId()); taskClient.completeAutoProgress(CONTAINER_ALIAS, task.getId(), USER_YODA, null); createExtraContainer(); Long processInstanceIdV2 = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION, parameters); assertNotNull(processInstanceIdV2); assertTrue(processInstanceIdV2.longValue() > 0); processInstance = processClient.getProcessInstance(CONTAINER_ALIAS, processInstanceIdV2); assertNotNull(processInstance); assertEquals(CONTAINER_ID_101, processInstance.getContainerId()); tasks = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, 0, 10); assertEquals(1, tasks.size()); task = tasks.get(0); assertEquals(CONTAINER_ID_101, task.getContainerId()); taskClient.completeAutoProgress(CONTAINER_ALIAS, task.getId(), USER_YODA, null); }