use of org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity in project camunda-bpm-platform by camunda.
the class HistoricVariableInstanceTest method testParallel.
@Deployment
public void testParallel() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProc");
TaskQuery taskQuery = taskService.createTaskQuery();
Task userTask = taskQuery.singleResult();
assertEquals("userTask1", userTask.getName());
taskService.complete(userTask.getId(), CollectionUtil.singletonMap("myVar", "test789"));
assertProcessEnded(processInstance.getId());
List<HistoricVariableInstance> variables = historyService.createHistoricVariableInstanceQuery().orderByVariableName().asc().list();
assertEquals(2, variables.size());
HistoricVariableInstanceEntity historicVariable = (HistoricVariableInstanceEntity) variables.get(0);
assertEquals("myVar", historicVariable.getName());
assertEquals("test789", historicVariable.getTextValue());
HistoricVariableInstanceEntity historicVariable1 = (HistoricVariableInstanceEntity) variables.get(1);
assertEquals("myVar1", historicVariable1.getName());
assertEquals("test456", historicVariable1.getTextValue());
assertEquals(8, historyService.createHistoricActivityInstanceQuery().count());
if (isFullHistoryEnabled()) {
assertEquals(5, historyService.createHistoricDetailQuery().count());
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity in project camunda-bpm-platform by camunda.
the class HistoricVariableInstanceTest method testHistoricVariableInstanceRevisionAsync.
@Deployment
public void testHistoricVariableInstanceRevisionAsync() {
// given:
// a finished process instance
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
// when
executeAvailableJobs();
// then
assertProcessEnded(processInstance.getId());
HistoricVariableInstance variable = historyService.createHistoricVariableInstanceQuery().singleResult();
assertNotNull(variable);
HistoricVariableInstanceEntity variableEntity = (HistoricVariableInstanceEntity) variable;
// the revision has to be 2
assertEquals(2, variableEntity.getRevision());
if (isFullHistoryEnabled()) {
List<HistoricDetail> details = historyService.createHistoricDetailQuery().orderByVariableRevision().asc().list();
int i = 0;
for (HistoricDetail detail : details) {
HistoricVariableUpdate variableDetail = (HistoricVariableUpdate) detail;
assertEquals(i, variableDetail.getRevision());
i++;
}
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity in project camunda-bpm-platform by camunda.
the class HistoricVariableInstanceTest method testSimple.
@Deployment
public void testSimple() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProc");
TaskQuery taskQuery = taskService.createTaskQuery();
Task userTask = taskQuery.singleResult();
assertEquals("userTask1", userTask.getName());
taskService.complete(userTask.getId(), CollectionUtil.singletonMap("myVar", "test789"));
assertProcessEnded(processInstance.getId());
List<HistoricVariableInstance> variables = historyService.createHistoricVariableInstanceQuery().list();
assertEquals(1, variables.size());
HistoricVariableInstanceEntity historicVariable = (HistoricVariableInstanceEntity) variables.get(0);
assertEquals("test456", historicVariable.getTextValue());
assertEquals(5, historyService.createHistoricActivityInstanceQuery().count());
if (isFullHistoryEnabled()) {
assertEquals(3, historyService.createHistoricDetailQuery().count());
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity in project camunda-bpm-platform by camunda.
the class HistoricVariableInstanceTest method testSimpleNoWaitState.
@Deployment
public void testSimpleNoWaitState() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProc");
assertProcessEnded(processInstance.getId());
List<HistoricVariableInstance> variables = historyService.createHistoricVariableInstanceQuery().list();
assertEquals(1, variables.size());
HistoricVariableInstanceEntity historicVariable = (HistoricVariableInstanceEntity) variables.get(0);
assertEquals("test456", historicVariable.getTextValue());
assertEquals(4, historyService.createHistoricActivityInstanceQuery().count());
if (isFullHistoryEnabled()) {
assertEquals(2, historyService.createHistoricDetailQuery().count());
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity in project camunda-bpm-platform by camunda.
the class HistoricVariableInstanceTest method testTwoSubProcessInParallelWithinSubProcess.
@Deployment
public void testTwoSubProcessInParallelWithinSubProcess() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("twoSubProcessInParallelWithinSubProcess");
assertProcessEnded(processInstance.getId());
List<HistoricVariableInstance> variables = historyService.createHistoricVariableInstanceQuery().orderByVariableName().asc().list();
assertEquals(2, variables.size());
HistoricVariableInstanceEntity historicVariable = (HistoricVariableInstanceEntity) variables.get(0);
assertEquals("myVar", historicVariable.getName());
assertEquals("test101112", historicVariable.getTextValue());
assertEquals("string", historicVariable.getVariableTypeName());
assertEquals("string", historicVariable.getTypeName());
HistoricVariableInstanceEntity historicVariable1 = (HistoricVariableInstanceEntity) variables.get(1);
assertEquals("myVar1", historicVariable1.getName());
assertEquals("test789", historicVariable1.getTextValue());
assertEquals("string", historicVariable1.getVariableTypeName());
assertEquals("string", historicVariable1.getTypeName());
assertEquals(18, historyService.createHistoricActivityInstanceQuery().count());
if (isFullHistoryEnabled()) {
assertEquals(7, historyService.createHistoricDetailQuery().count());
}
}
Aggregations