samedi 11 avril 2015

Get all tasks along with all candidate users in Activiti

I'm having issue with this sql. I want to retrieve all tasks along with task id and user id. Apparently this sql statement is not returning the user id. it returns only the task id and task name from the table Task. I execute this sql in sqldeveloper, and I get all values from table task and table Identity Link. Do you know why I don't get the values of the table identity Link in groupTasks?



public static List<Task> retrieveAllTasks(){
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
TaskService taskService = processEngine.getTaskService();

String taskTable = managementService.getTableName(TaskEntity.class);
String identityLinkTable = managementService.getTableName(IdentityLinkEntity.class);

List<Task> groupTasks = taskService.createNativeTaskQuery().sql("select _TASK.*" +
" from " + taskTable + " _TASK" +
" join " + identityLinkTable + " _LINK on _TASK.ID_ = _LINK.TASK_ID_" +
" where _LINK.TYPE_ = 'candidate'").list();

return groupTasks;

Aucun commentaire:

Enregistrer un commentaire