[
  {
    "query-name": "task-assigning-tasks-with-potential-owners-and-planning-task",
    "query-source": "${org.kie.server.persistence.ds}",
    "query-expression": "select t.taskId, t.createdOn, t.activationTime, t.actualOwner, t.deploymentId, t.dueDate, t.name, t.priority, t.processId, t.processInstanceId, t.status, t.lastModificationDate, pt.taskId pttaskId, pt.assigneduser, pt.taskIndex, pt.published, oe.id as potentialOwner, oe.dtype as potentialOwnerType from AuditTaskImpl t left join PlanningTask pt on t.taskId = pt.taskId left join PeopleAssignments_PotOwners po on t.taskId=po.task_id left join OrganizationalEntity oe on po.entity_id=oe.id",
    "query-target": "CUSTOM"
  },

  {
    "query-name": "task-assigning-tasks-with-planning-task-optimized",
    "query-source": "${org.kie.server.persistence.ds}",
    "query-expression": "select t.taskId, t.actualOwner, t.status, t.deploymentId, t.lastModificationDate, pt.taskId pttaskId, pt.assigneduser, pt.taskIndex, pt.published from AuditTaskImpl t left join PlanningTask pt on t.taskId = pt.taskId",
    "query-target": "CUSTOM"
  },

  {
    "query-name": "task-assigning-jbpmHumanTasksWithUser",
    "query-source": "${org.kie.server.persistence.ds}",
    "query-expression": "select t.activationTime, t.actualOwner, t.createdBy, t.createdOn, t.deploymentId, t.description, t.dueDate, t.name, t.parentId, t.priority, t.processId, t.processInstanceId, t.processSessionId, t.status, t.taskId, t.workItemId, t.lastModificationDate, pil.correlationKey, pil.processInstanceDescription, oe.id, eo.entity_id, nil.sla_due_date, nil.slaCompliance, pt.taskId as pttaskId, pt.assignedUser, pt.taskIndex, pt.published from AuditTaskImpl t left join PlanningTask pt on (pt.taskId = t.taskId and pt.assignedUser = t.actualOwner) left join PeopleAssignments_PotOwners po on t.taskId=po.task_id left join OrganizationalEntity oe on po.entity_id=oe.id left join ProcessInstanceLog pil on pil.processInstanceId=t.processInstanceId left join PeopleAssignments_ExclOwners eo on t.taskId=eo.task_id left join NodeInstanceLog nil on (nil.workItemId=t.workItemId and nil.type = 0)",
    "query-target": "FILTERED_PO_TASK"
  },

  {
    "query-name": "task-assigning-jbpmHumanTasks",
    "query-source": "${org.kie.server.persistence.ds}",
    "query-expression": "select t.activationTime, t.actualOwner, t.createdBy, t.createdOn, t.deploymentId, t.description, t.dueDate, t.name, t.parentId, t.priority, t.processId, t.processInstanceId, t.processSessionId, t.status, t.taskId, t.workItemId, t.lastModificationDate, pil.correlationKey, pil.processInstanceDescription, nil.sla_due_date, nil.slaCompliance, pt.taskId as pttaskId, pt.assignedUser, pt.taskIndex, pt.published from AuditTaskImpl t left join PlanningTask pt on (pt.taskId = t.taskId and pt.assignedUser = t.actualOwner) left join ProcessInstanceLog pil on pil.processInstanceId=t.processInstanceId left join NodeInstanceLog nil on (nil.workItemId=t.workItemId and nil.type = 0)",
    "query-target": "CUSTOM"
  }
]