Search in sources :

Example 1 with ProcessInstanceHistoryLog

use of org.activiti.engine.history.ProcessInstanceHistoryLog in project Activiti by Activiti.

the class ProcessInstanceLogQueryAndByteArrayTypeVariableTest method testIncludeVariableUpdates.

public void testIncludeVariableUpdates() {
    if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.FULL)) {
        HistoricVariableInstance historicVariableInstance = historyService.createHistoricVariableInstanceQuery().processInstanceId(processInstanceId).variableName("var").singleResult();
        assertEquals(historicVariableInstance.getValue(), LARGE_STRING_VALUE);
        ProcessInstanceHistoryLog log = historyService.createProcessInstanceHistoryLogQuery(processInstanceId).includeVariableUpdates().singleResult();
        List<HistoricData> events = log.getHistoricData();
        assertEquals(1, events.size());
        for (HistoricData event : events) {
            assertTrue(event instanceof HistoricVariableUpdate);
            assertEquals(((HistoricDetailVariableInstanceUpdateEntity) event).getValue(), LARGE_STRING_VALUE);
        }
    }
}
Also used : HistoricVariableUpdate(org.activiti.engine.history.HistoricVariableUpdate) HistoricData(org.activiti.engine.history.HistoricData) ProcessInstanceHistoryLog(org.activiti.engine.history.ProcessInstanceHistoryLog) HistoricVariableInstance(org.activiti.engine.history.HistoricVariableInstance)

Example 2 with ProcessInstanceHistoryLog

use of org.activiti.engine.history.ProcessInstanceHistoryLog in project Activiti by Activiti.

the class ProcessInstanceLogQueryAndByteArrayTypeVariableTest method testIncludeVariables.

public void testIncludeVariables() {
    if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.FULL)) {
        HistoricVariableInstance historicVariableInstance = historyService.createHistoricVariableInstanceQuery().processInstanceId(processInstanceId).variableName("var").singleResult();
        assertEquals(historicVariableInstance.getValue(), LARGE_STRING_VALUE);
        ProcessInstanceHistoryLog log = historyService.createProcessInstanceHistoryLogQuery(processInstanceId).includeVariables().singleResult();
        List<HistoricData> events = log.getHistoricData();
        assertEquals(1, events.size());
        for (HistoricData event : events) {
            assertTrue(event instanceof HistoricVariableInstance);
            assertEquals(((HistoricVariableInstanceEntity) event).getValue(), LARGE_STRING_VALUE);
        }
    }
}
Also used : HistoricData(org.activiti.engine.history.HistoricData) ProcessInstanceHistoryLog(org.activiti.engine.history.ProcessInstanceHistoryLog) HistoricVariableInstance(org.activiti.engine.history.HistoricVariableInstance)

Example 3 with ProcessInstanceHistoryLog

use of org.activiti.engine.history.ProcessInstanceHistoryLog in project Activiti by Activiti.

the class ProcessInstanceLogQueryTest method testIncludeVariables.

public void testIncludeVariables() {
    if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.FULL)) {
        ProcessInstanceHistoryLog log = historyService.createProcessInstanceHistoryLogQuery(processInstanceId).includeVariables().singleResult();
        List<HistoricData> events = log.getHistoricData();
        assertThat(events).hasSize(2);
        for (HistoricData event : events) {
            assertThat(event).isInstanceOf(HistoricVariableInstance.class);
        }
    }
}
Also used : HistoricData(org.activiti.engine.history.HistoricData) ProcessInstanceHistoryLog(org.activiti.engine.history.ProcessInstanceHistoryLog)

Example 4 with ProcessInstanceHistoryLog

use of org.activiti.engine.history.ProcessInstanceHistoryLog in project Activiti by Activiti.

the class ProcessInstanceLogQueryTest method testIncludeVariableUpdates.

public void testIncludeVariableUpdates() {
    if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.FULL)) {
        ProcessInstanceHistoryLog log = historyService.createProcessInstanceHistoryLogQuery(processInstanceId).includeVariableUpdates().singleResult();
        List<HistoricData> events = log.getHistoricData();
        assertThat(events).hasSize(3);
        for (HistoricData event : events) {
            assertThat(event).isInstanceOf(HistoricVariableUpdate.class);
        }
    }
}
Also used : HistoricData(org.activiti.engine.history.HistoricData) ProcessInstanceHistoryLog(org.activiti.engine.history.ProcessInstanceHistoryLog)

Example 5 with ProcessInstanceHistoryLog

use of org.activiti.engine.history.ProcessInstanceHistoryLog in project Activiti by Activiti.

the class ProcessInstanceLogQueryTest method testIncludeComments.

public void testIncludeComments() {
    ProcessInstanceHistoryLog log = historyService.createProcessInstanceHistoryLogQuery(processInstanceId).includeComments().singleResult();
    List<HistoricData> events = log.getHistoricData();
    assertThat(events).hasSize(3);
    for (HistoricData event : events) {
        assertThat(event).isInstanceOf(Comment.class);
    }
}
Also used : HistoricData(org.activiti.engine.history.HistoricData) ProcessInstanceHistoryLog(org.activiti.engine.history.ProcessInstanceHistoryLog)

Aggregations

ProcessInstanceHistoryLog (org.activiti.engine.history.ProcessInstanceHistoryLog)14 HistoricData (org.activiti.engine.history.HistoricData)13 HistoricVariableInstance (org.activiti.engine.history.HistoricVariableInstance)3 HashMap (java.util.HashMap)2 Task (org.activiti.engine.task.Task)2 Deployment (org.activiti.engine.test.Deployment)2 HistoricVariableUpdate (org.activiti.engine.history.HistoricVariableUpdate)1 HistoricDetailVariableInstanceUpdateEntity (org.activiti.engine.impl.persistence.entity.HistoricDetailVariableInstanceUpdateEntity)1 HistoricVariableInstanceEntity (org.activiti.engine.impl.persistence.entity.HistoricVariableInstanceEntity)1