when(mockVariable.getActivityInstanceId()).thenReturn(activityInstanceId); when(mockVariable.getCaseDefinitionKey()).thenReturn(caseDefinitionKey); when(mockVariable.getCaseDefinitionId()).thenReturn(caseDefinitionId); when(mockVariable.getCaseInstanceId()).thenReturn(caseInstanceId); when(mockVariable.getCaseExecutionId()).thenReturn(caseExecutionId);
protected void assertCaseVariable(String key, CaseInstance caseInstance, HistoricVariableInstance instance) { assertNotNull(instance.getCaseDefinitionKey()); assertEquals(key, instance.getCaseDefinitionKey()); assertNotNull(instance.getCaseDefinitionId()); assertEquals(caseInstance.getCaseDefinitionId(), instance.getCaseDefinitionId()); assertNull(instance.getProcessDefinitionKey()); assertNull(instance.getProcessDefinitionId()); }
public static HistoricVariableInstanceDto fromHistoricVariableInstance(HistoricVariableInstance historicVariableInstance) { HistoricVariableInstanceDto dto = new HistoricVariableInstanceDto(); dto.id = historicVariableInstance.getId(); dto.name = historicVariableInstance.getName(); dto.processDefinitionKey = historicVariableInstance.getProcessDefinitionKey(); dto.processDefinitionId = historicVariableInstance.getProcessDefinitionId(); dto.processInstanceId = historicVariableInstance.getProcessInstanceId(); dto.executionId = historicVariableInstance.getExecutionId(); dto.activityInstanceId = historicVariableInstance.getActivityInstanceId(); dto.caseDefinitionKey = historicVariableInstance.getCaseDefinitionKey(); dto.caseDefinitionId = historicVariableInstance.getCaseDefinitionId(); dto.caseInstanceId = historicVariableInstance.getCaseInstanceId(); dto.caseExecutionId = historicVariableInstance.getCaseExecutionId(); dto.taskId = historicVariableInstance.getTaskId(); dto.tenantId = historicVariableInstance.getTenantId(); dto.state = historicVariableInstance.getState(); dto.createTime = historicVariableInstance.getCreateTime(); dto.removalTime = historicVariableInstance.getRemovalTime(); dto.rootProcessInstanceId = historicVariableInstance.getRootProcessInstanceId(); if(historicVariableInstance.getErrorMessage() == null) { VariableValueDto.fromTypedValue(dto, historicVariableInstance.getTypedValue()); } else { dto.errorMessage = historicVariableInstance.getErrorMessage(); dto.type = VariableValueDto.toRestApiTypeName(historicVariableInstance.getTypeName()); } return dto; }
public static HistoricVariableInstanceDto fromHistoricVariableInstance(HistoricVariableInstance historicVariableInstance) { HistoricVariableInstanceDto dto = new HistoricVariableInstanceDto(); dto.id = historicVariableInstance.getId(); dto.name = historicVariableInstance.getName(); dto.processDefinitionKey = historicVariableInstance.getProcessDefinitionKey(); dto.processDefinitionId = historicVariableInstance.getProcessDefinitionId(); dto.processInstanceId = historicVariableInstance.getProcessInstanceId(); dto.executionId = historicVariableInstance.getExecutionId(); dto.activityInstanceId = historicVariableInstance.getActivityInstanceId(); dto.caseDefinitionKey = historicVariableInstance.getCaseDefinitionKey(); dto.caseDefinitionId = historicVariableInstance.getCaseDefinitionId(); dto.caseInstanceId = historicVariableInstance.getCaseInstanceId(); dto.caseExecutionId = historicVariableInstance.getCaseExecutionId(); dto.taskId = historicVariableInstance.getTaskId(); dto.tenantId = historicVariableInstance.getTenantId(); dto.state = historicVariableInstance.getState(); dto.createTime = historicVariableInstance.getCreateTime(); dto.removalTime = historicVariableInstance.getRemovalTime(); dto.rootProcessInstanceId = historicVariableInstance.getRootProcessInstanceId(); if(historicVariableInstance.getErrorMessage() == null) { VariableValueDto.fromTypedValue(dto, historicVariableInstance.getTypedValue()); } else { dto.errorMessage = historicVariableInstance.getErrorMessage(); dto.type = VariableValueDto.toRestApiTypeName(historicVariableInstance.getTypeName()); } return dto; }
public void testStandaloneTaskDefinitionProperties() { // given String taskId = "myTask"; Task task = taskService.newTask(taskId); taskService.saveTask(task); taskService.setVariable(taskId, "aVariable", "anotherValue"); // when (1) HistoricVariableInstance instance = historyService .createHistoricVariableInstanceQuery() .taskIdIn(taskId) .variableName("aVariable") .singleResult(); // then (1) assertNull(instance.getProcessDefinitionKey()); assertNull(instance.getProcessDefinitionId()); assertNull(instance.getCaseDefinitionKey()); assertNull(instance.getCaseDefinitionId()); taskService.deleteTask(taskId, true); }
assertNull(instance.getCaseDefinitionId()); assertNull(instance.getCaseDefinitionId());
protected void assertCaseVariable(String key, CaseInstance caseInstance, HistoricVariableInstance instance) { assertNotNull(instance.getCaseDefinitionKey()); assertEquals(key, instance.getCaseDefinitionKey()); assertNotNull(instance.getCaseDefinitionId()); assertEquals(caseInstance.getCaseDefinitionId(), instance.getCaseDefinitionId()); assertNull(instance.getProcessDefinitionKey()); assertNull(instance.getProcessDefinitionId()); }
public static HistoricVariableInstanceDto fromHistoricVariableInstance(HistoricVariableInstance historicVariableInstance) { HistoricVariableInstanceDto dto = new HistoricVariableInstanceDto(); dto.id = historicVariableInstance.getId(); dto.name = historicVariableInstance.getName(); dto.processDefinitionKey = historicVariableInstance.getProcessDefinitionKey(); dto.processDefinitionId = historicVariableInstance.getProcessDefinitionId(); dto.processInstanceId = historicVariableInstance.getProcessInstanceId(); dto.executionId = historicVariableInstance.getExecutionId(); dto.activityInstanceId = historicVariableInstance.getActivityInstanceId(); dto.caseDefinitionKey = historicVariableInstance.getCaseDefinitionKey(); dto.caseDefinitionId = historicVariableInstance.getCaseDefinitionId(); dto.caseInstanceId = historicVariableInstance.getCaseInstanceId(); dto.caseExecutionId = historicVariableInstance.getCaseExecutionId(); dto.taskId = historicVariableInstance.getTaskId(); dto.tenantId = historicVariableInstance.getTenantId(); dto.state = historicVariableInstance.getState(); dto.createTime = historicVariableInstance.getCreateTime(); dto.removalTime = historicVariableInstance.getRemovalTime(); dto.rootProcessInstanceId = historicVariableInstance.getRootProcessInstanceId(); if(historicVariableInstance.getErrorMessage() == null) { VariableValueDto.fromTypedValue(dto, historicVariableInstance.getTypedValue()); } else { dto.errorMessage = historicVariableInstance.getErrorMessage(); dto.type = VariableValueDto.toRestApiTypeName(historicVariableInstance.getTypeName()); } return dto; }
public void testStandaloneTaskDefinitionProperties() { // given String taskId = "myTask"; Task task = taskService.newTask(taskId); taskService.saveTask(task); taskService.setVariable(taskId, "aVariable", "anotherValue"); // when (1) HistoricVariableInstance instance = historyService .createHistoricVariableInstanceQuery() .taskIdIn(taskId) .variableName("aVariable") .singleResult(); // then (1) assertNull(instance.getProcessDefinitionKey()); assertNull(instance.getProcessDefinitionId()); assertNull(instance.getCaseDefinitionKey()); assertNull(instance.getCaseDefinitionId()); taskService.deleteTask(taskId, true); }
assertNull(instance.getCaseDefinitionId()); assertNull(instance.getCaseDefinitionId());