samedi 11 avril 2015

Create native query using Activiti

Hi I'm working with activiti workflow.I want to get all tasks along with all the candidate user in a primefaces datatable. So I'm writing a native query to get these values but I'm having a null value on managementService. Do I need to implement this class?or is there a library I need to import? How should I proceed?



@Autowired
private static ManagementService managementService;

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