// set requester as current user
identityService.setAuthenticatedUserId(requester.getId());
// assert that the process definition does exist in the current
// environment
ProcessDefinition definition = activitiRule.getRepositoryService()
.createProcessDefinitionQuery()
.processDefinitionKey("issueRequestProcess").singleResult();
assertThat(definition, notNullValue());
// get a handle on the form-service
FormService formService = activitiRule.getFormService();
// assert that our start form has four form fields
List<FormProperty> formProps = formService.getStartFormData(
definition.getId()).getFormProperties();
assertThat(formProps.size(), equalTo(4));
// fill out the first form's fields
Map<String, String> requestFormProps = new HashMap<String, String>();
requestFormProps.put(SUMMARY_KEY, SUMMARY_VALUE);
requestFormProps.put(DESCRIPTION_KEY, DESCRIPTION_VALUE);
requestFormProps.put("email", "someguy@hascode.com");
requestFormProps.put("priority", "critical");
Date startDate = new Date();
// create a new process instance with given form params
ProcessInstance processInstance = formService.submitStartFormData(
definition.getId(), requestFormProps);
assertThat(processInstance, notNullValue());
// test the audit process, fetch historic data
List<HistoricDetail> historicFormProps = activitiRule
.getHistoryService().createHistoricDetailQuery()