Search in sources :

Example 1 with TaskExecuteLogQuery

use of org.apache.inlong.manager.common.pojo.workflow.TaskExecuteLogQuery in project incubator-inlong by apache.

the class WorkflowServiceImplTest method testListTaskExecuteLogs.

@Test
public void testListTaskExecuteLogs() {
    // insert process instance
    String groupId = "test_group";
    WorkflowProcessEntity process = new WorkflowProcessEntity();
    process.setId(1);
    process.setInlongGroupId(groupId);
    process.setName("CREATE_GROUP_RESOURCE");
    process.setDisplayName("Group-Resource");
    process.setHidden(1);
    process.setStatus(ProcessStatus.COMPLETED.name());
    processEntityMapper.insert(process);
    // insert task instance
    WorkflowTaskEntity task = new WorkflowTaskEntity();
    task.setId(1);
    task.setType("ServiceTask");
    task.setProcessId(1);
    taskEntityMapper.insert(task);
    // query execute logs
    TaskExecuteLogQuery query = new TaskExecuteLogQuery();
    query.setInlongGroupId(groupId);
    query.setProcessNames(Collections.singletonList("CREATE_GROUP_RESOURCE"));
    PageInfo<WorkflowExecuteLog> logPageInfo = workflowService.listTaskExecuteLogs(query);
    Assert.assertEquals(1, logPageInfo.getTotal());
}
Also used : TaskExecuteLogQuery(org.apache.inlong.manager.common.pojo.workflow.TaskExecuteLogQuery) WorkflowProcessEntity(org.apache.inlong.manager.dao.entity.WorkflowProcessEntity) WorkflowTaskEntity(org.apache.inlong.manager.dao.entity.WorkflowTaskEntity) Test(org.junit.Test) ServiceBaseTest(org.apache.inlong.manager.service.ServiceBaseTest)

Aggregations

TaskExecuteLogQuery (org.apache.inlong.manager.common.pojo.workflow.TaskExecuteLogQuery)1 WorkflowProcessEntity (org.apache.inlong.manager.dao.entity.WorkflowProcessEntity)1 WorkflowTaskEntity (org.apache.inlong.manager.dao.entity.WorkflowTaskEntity)1 ServiceBaseTest (org.apache.inlong.manager.service.ServiceBaseTest)1 Test (org.junit.Test)1