3 Replies Latest reply: Feb 29, 2012 7:56 AM by DyonisosDD2 RSS

    TaskManagerQueryService.processInstanceList(...) doesn't return instances started with LC API

    luca.depetrillo Community Member

      Hi,

      I'm having troubles trying to retrieve instances of processes when they are created with LiveCycle API using ServiceClient.invoke(invocationRequest).

      As far that I can see, process instances are created correctly (I can manage them in LiveCycle AdminUI and in LiveCycle Workspace), but I can't retrieve them using TaskManagerQueryService.processInstanceList(...) or TaskManagerQueryService.processSearch(...), as process instances are simply missing... the strange thing is that process instances created with LiveCycle Workspace are returned correctly.

       

      Someone could help me to figure out the problem?

       

      Thanks,

      Luca.

        • 1. Re: TaskManagerQueryService.processInstanceList(...) doesn't return instances started with LC API
          luca.depetrillo Community Member

          I found some additional information: debugging sql queries performed by LiveCycle apis, I found that TaskManagerQueryService.processSearch(...) always applies a filter to check if the user used to perform the search, has performed at least a task for an instance (it apply an sql filter on tb_queue.workflow_user_id joining it on tb_assignment, tb_task and tb_process_instance), even if this behavior isn't documented on javadoc. This means that, in contrast with workspace that starts a process using a human task, if the process is started using api, the initial human task isn't created, and TaskManagerQueryService.processSearch(...) will never return the started instance until the user has performed some other task on it...

          Is there a workaround that could allow me to skip the "user interaction" check performed by the api, or at least, a way to start a process like the workspace using the initial human task?

           

          Thanks,

          Luca.

          • 2. Re: TaskManagerQueryService.processInstanceList(...) doesn't return instances started with LC API
            illiptic42 Community Member

            Hi

             

            I'm kind of late on the reply, but one alternative could be to query the DB directly...

             

            But I'm not too keen on using that solution, did you find any other way around this problem?

             

            Best regards

            • 3. Re: TaskManagerQueryService.processInstanceList(...) doesn't return instances started with LC API
              DyonisosDD2 Community Member

              I'm also interrested on the solution. I have to find all process instances for a given serviceName having a given valriable to a defined value.

              The API seams to ansmwer, but in fact, the function procesSearch never find any process, probably because of the fact that no user are participating to the searched process.

              In an old pos, I have found a solution based on POF api. Does this api exit for ADEP - 10.0.1?

               

              Searching for a task, the property filter.setAdminIgnoreAllAcls(true); does the work. But this property does not exists in ProcessSearchFilter...

               

              Thanks

               

              Used code for info:

               

                   ServiceConnectionHelper connHelper = new ServiceConnectionHelper(

                      livecycleServerAddress, userName, password);

                  TaskManagerQueryService queryService = connHelper

                      .getTaskManagerQueryService();

               

                  // Yet, we are building the process search on the variable

                  ProcessSearchFilter pSearch = new ProcessSearchFilter();

                  pSearch.setServiceName(processName);

                  pSearch.addCondition("procVar." + variableName, Operator.CONTAINS,

                      variableValue);

               

               

                  List<ProcessInstanceRow> allProcesses = queryService

                      .processSearch(pSearch);

                  List<ProcessInstanceRow> toReturn = new ArrayList<ProcessInstanceRow>();

                  for (ProcessInstanceRow row : allProcesses) {

                      if (row.getProcessInstanceStatus() == ProcessInstanceRow.STATUS_RUNNING) {

                      toReturn.add(row);

                      }

                  }

               

              Denis