Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-45034

API:WorkflowTaskManagerUtil.getWorkflowTasksBySubmittingUser() returns no rows

    Details

      Description

      com.liferay.portal.workflow.kaleo.service.impl.WorkflowTaskManagerUtil.getWorkflowTasksBySubmittingUser() and getWorkflowTaskCountBySubmittingUser() doesn't never return any rows and total.

      in KaleoTaskInstanceTokenLocalServiceImpl.getWorkflowTaskCountBySubmittingUser(), we use the below code "dynamicQuery.add(workflowContextProperty.like("\"userId\":" + userId));" and the code was matched with the sql grammar
      ##
      select count from kaleotaskinstancetoken where workflowContext like '"userId":10196'
      ##

      in kaleotaskinstancetoken table, the field workflowContext vaule is the below:
      ##

      {"map":..."workflowAction":1,"userId":10205,"...,"entryClassName":"com.liferay.portlet.blogs.model.BlogsEntry","groupId":"10186","entryType":"Blogs Entry","userId":"10205","taskComments":"","companyId":"10156","entryClassPK":"11486"}

      ,"javaClass":"java.util.HashMap"}
      ##

      So use keyword "like '"userId":10196'" as sql query, we can't get any result.

      The test method:
      I didn't find the api was invoked by liferay action(UI). I think the api only was provided for customer to custom workflow. So I invoked the api in workflow_search_results.jspf and added the below code.

      ###
      int countHai = WorkflowTaskManagerUtil.getWorkflowTaskCountBySubmittingUser(company.getCompanyId(), user.getUserId(), false);

      System.out.println("countHai:" + countHai);
      ###

      And then do the below steps:
      1. Use Admin login.
      2. Enable Blogs Entry workflow.
      3. Create one blog to "submit for publication".

      Actual behavior: we can see the info "countHai:0" printed in log.
      Expected behavior: we should see the info "countHai:1" printed in log.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 5 weeks, 3 days ago

                Packages

                Version Package
                7.0.0 M7