AnsweredAssumed Answered

Pooled Workflow-tasks sorting

Question asked by ijava on Nov 20, 2015
Hello guys,

I faced some strange problem, couldn't google it out, so came here.

So, I have workflows, for  single user and group of users,  and I sort workflows by state (IN_PROGRESS, COMPLETED).

Everything works fine with single user WF(workflows), if WF has state = IN_PROGRESS it goes to one list, if COMPLETED it goes to another list ( Works as it should )

BUT… if I add  pooled WF, to a group of peaople, it goes to both lists.

I thought I had bug, because of my code, but I tested it on browser or SoapUi and I get same results.

This is my Java code I use:

**load method**

public List<WorkflowTask> load(int first, int pageSize, String sortField, SortOrder sortOrder,
            Map<String, Object> filters) {
        String state = null;
        List<WorkflowTask> services = null;

         // just sorts workflows
        if (controller.isCompleted() == true) {
            state = "IN_PROGRESS";

        if (controller.isCompleted() == false) {
            state = "COMPLETED";

        try {
            InboxData inboxData = taskManager.getTasks(first, pageSize, state);
            services = inboxData.getData();
            // rowCount

        } catch (CmisObjectNotFoundException e) {
            log.error("Could not load registry records", e);
            String errorMessage = MessageUtil.translate("failedToLoadDataBecause") + "\\n"
                    + MessageUtil.translate("calendarNotConfigured");
            RequestContext.getCurrentInstance().execute("alert('" + errorMessage + "')");

        return services;

** And my get() method **

public InboxData getTasks(int page, int pageSize, String state) {
        Response response = getTargetApi()
                .queryParam("alf_ticket", getTicket())
                .queryParam("maxItems", pageSize)
                .queryParam("skipCount", page)
                .queryParam("state", state)
                .queryParam("properties", "bpm_status,bpm_description,bpm_startDate")

InboxData is just class, where I have workflow properties.