Skip to content

Instantly share code, notes, and snippets.

@tijsrademakers
Created December 20, 2016 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tijsrademakers/2c0b74935d53674ce16921e769406974 to your computer and use it in GitHub Desktop.
Save tijsrademakers/2c0b74935d53674ce16921e769406974 to your computer and use it in GitHub Desktop.
@Test
public testIntroProcess() {
....
HistoricVariableInstance historicVariable = historyService.createHistoricVariableInstanceQuery()
.processInstanceId(processInstance.getId())
.singleResult();
assertEquals("variablePresent", historicVariable.getVariableName());
assertEquals(false, historicVariable.getValue());
processInstance = runtimeService.startProcessInstanceByKey("intro", Collections.singletonMap("intro", (Object) "a test intro value"));
List<HistoricVariableInstance> historicVariables = historyService
.createHistoricVariableInstanceQuery()
.processInstanceId(processInstance.getId())
.orderByVariableName()
.asc()
.list();
assertEquals("intro", historicVariables.get(0).getVariableName());
assertEquals("a test intro value", historicVariables.get(0).getValue());
assertEquals("variablePresent", historicVariables.get(1).getVariableName());
assertEquals(true, historicVariables.get(1).getValue());
processEngine.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment