Search in sources :

Example 1 with HistoricData

use of org.activiti.engine.history.HistoricData 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 HistoricData

use of org.activiti.engine.history.HistoricData 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 HistoricData

use of org.activiti.engine.history.HistoricData 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();
        assertEquals(3, events.size());
        for (HistoricData event : events) {
            assertTrue(event instanceof HistoricVariableUpdate);
        }
    }
}
Also used : HistoricVariableUpdate(org.activiti.engine.history.HistoricVariableUpdate) HistoricData(org.activiti.engine.history.HistoricData) ProcessInstanceHistoryLog(org.activiti.engine.history.ProcessInstanceHistoryLog)

Example 4 with HistoricData

use of org.activiti.engine.history.HistoricData 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();
        assertEquals(2, events.size());
        for (HistoricData event : events) {
            assertTrue(event instanceof HistoricVariableInstance);
        }
    }
}
Also used : HistoricData(org.activiti.engine.history.HistoricData) ProcessInstanceHistoryLog(org.activiti.engine.history.ProcessInstanceHistoryLog) HistoricVariableInstance(org.activiti.engine.history.HistoricVariableInstance)

Example 5 with HistoricData

use of org.activiti.engine.history.HistoricData 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();
    assertEquals(3, events.size());
    for (HistoricData event : events) {
        assertTrue(event instanceof Comment);
    }
}
Also used : Comment(org.activiti.engine.task.Comment) HistoricData(org.activiti.engine.history.HistoricData) ProcessInstanceHistoryLog(org.activiti.engine.history.ProcessInstanceHistoryLog)

Aggregations

HistoricData (org.activiti.engine.history.HistoricData)12 ProcessInstanceHistoryLog (org.activiti.engine.history.ProcessInstanceHistoryLog)11 HistoricVariableInstance (org.activiti.engine.history.HistoricVariableInstance)4 HistoricVariableUpdate (org.activiti.engine.history.HistoricVariableUpdate)3 HashMap (java.util.HashMap)2 HistoricActivityInstance (org.activiti.engine.history.HistoricActivityInstance)2 HistoricTaskInstance (org.activiti.engine.history.HistoricTaskInstance)2 HistoricVariableInstanceEntity (org.activiti.engine.impl.persistence.entity.HistoricVariableInstanceEntity)2 Comment (org.activiti.engine.task.Comment)2 Task (org.activiti.engine.task.Task)2 Deployment (org.activiti.engine.test.Deployment)2 HistoricDetailVariableInstanceUpdateEntity (org.activiti.engine.impl.persistence.entity.HistoricDetailVariableInstanceUpdateEntity)1 HistoricProcessInstanceEntity (org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceEntity)1 CacheableVariable (org.activiti.engine.impl.variable.CacheableVariable)1