Search in sources :

Example 1 with HistoricFormField

use of org.camunda.bpm.engine.history.HistoricFormField in project camunda-bpm-platform by camunda.

the class HistoricDetailDto method fromHistoricDetail.

public static HistoricDetailDto fromHistoricDetail(HistoricDetail historicDetail) {
    HistoricDetailDto dto = null;
    if (historicDetail instanceof HistoricFormField) {
        HistoricFormField historicFormField = (HistoricFormField) historicDetail;
        dto = HistoricFormFieldDto.fromHistoricFormField(historicFormField);
    } else if (historicDetail instanceof HistoricVariableUpdate) {
        HistoricVariableUpdate historicVariableUpdate = (HistoricVariableUpdate) historicDetail;
        dto = HistoricVariableUpdateDto.fromHistoricVariableUpdate(historicVariableUpdate);
    }
    dto.id = historicDetail.getId();
    dto.processDefinitionKey = historicDetail.getProcessDefinitionKey();
    dto.processDefinitionId = historicDetail.getProcessDefinitionId();
    dto.processInstanceId = historicDetail.getProcessInstanceId();
    dto.activityInstanceId = historicDetail.getActivityInstanceId();
    dto.executionId = historicDetail.getExecutionId();
    dto.taskId = historicDetail.getTaskId();
    dto.caseDefinitionKey = historicDetail.getCaseDefinitionKey();
    dto.caseDefinitionId = historicDetail.getCaseDefinitionId();
    dto.caseInstanceId = historicDetail.getCaseInstanceId();
    dto.caseExecutionId = historicDetail.getCaseExecutionId();
    dto.tenantId = historicDetail.getTenantId();
    dto.userOperationId = historicDetail.getUserOperationId();
    dto.time = historicDetail.getTime();
    return dto;
}
Also used : HistoricVariableUpdate(org.camunda.bpm.engine.history.HistoricVariableUpdate) HistoricFormField(org.camunda.bpm.engine.history.HistoricFormField)

Example 2 with HistoricFormField

use of org.camunda.bpm.engine.history.HistoricFormField in project camunda-bpm-platform by camunda.

the class MockProvider method createMockHistoricFormField.

public static HistoricFormField createMockHistoricFormField(String tenantId) {
    HistoricFormField historicFromField = mock(HistoricFormField.class);
    when(historicFromField.getId()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_ID);
    when(historicFromField.getProcessDefinitionKey()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_PROC_DEF_KEY);
    when(historicFromField.getProcessDefinitionId()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_PROC_DEF_ID);
    when(historicFromField.getProcessInstanceId()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_PROC_INST_ID);
    when(historicFromField.getActivityInstanceId()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_ACT_INST_ID);
    when(historicFromField.getExecutionId()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_EXEC_ID);
    when(historicFromField.getTaskId()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_TASK_ID);
    when(historicFromField.getTime()).thenReturn(DateTimeUtil.parseDate(EXAMPLE_HISTORIC_FORM_FIELD_TIME));
    when(historicFromField.getFieldId()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_FIELD_ID);
    when(historicFromField.getFieldValue()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_VALUE);
    when(historicFromField.getCaseDefinitionKey()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_CASE_DEF_KEY);
    when(historicFromField.getCaseDefinitionId()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_CASE_DEF_ID);
    when(historicFromField.getCaseInstanceId()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_CASE_INST_ID);
    when(historicFromField.getCaseExecutionId()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_CASE_EXEC_ID);
    when(historicFromField.getTenantId()).thenReturn(tenantId);
    when(historicFromField.getUserOperationId()).thenReturn(EXAMPLE_HISTORIC_FORM_FIELD_OPERATION_ID);
    return historicFromField;
}
Also used : HistoricFormField(org.camunda.bpm.engine.history.HistoricFormField)

Example 3 with HistoricFormField

use of org.camunda.bpm.engine.history.HistoricFormField in project camunda-bpm-platform by camunda.

the class FullHistoryTest method testHistoricFormFieldProcessDefinitionProperty.

@Test
@Deployment(resources = "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml")
public void testHistoricFormFieldProcessDefinitionProperty() {
    // given
    String key = "oneTaskProcess";
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(key);
    String taskId = taskService.createTaskQuery().singleResult().getId();
    formService.submitTaskForm(taskId, Variables.createVariables().putValue("aVariable", "aValue"));
    // when
    HistoricFormField instance = (HistoricFormField) historyService.createHistoricDetailQuery().formFields().singleResult();
    // then
    assertNotNull(instance.getProcessDefinitionKey());
    assertEquals(key, instance.getProcessDefinitionKey());
    assertNotNull(instance.getProcessDefinitionId());
    assertEquals(processInstance.getProcessDefinitionId(), instance.getProcessDefinitionId());
    assertNull(instance.getCaseDefinitionKey());
    assertNull(instance.getCaseDefinitionId());
}
Also used : HistoricFormField(org.camunda.bpm.engine.history.HistoricFormField) HistoricProcessInstance(org.camunda.bpm.engine.history.HistoricProcessInstance) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

HistoricFormField (org.camunda.bpm.engine.history.HistoricFormField)3 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)1 HistoricVariableUpdate (org.camunda.bpm.engine.history.HistoricVariableUpdate)1 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)1 Deployment (org.camunda.bpm.engine.test.Deployment)1 Test (org.junit.Test)1