com.ibm.openpages.api.service

## Interface IProcessService

-     public interface IProcessService

  Provides service for OpenPages long running processes specific features. The service provides API for the following features: Long Running Processes. For all operations it is assumed that the user performing the operations has necessary permissions to do so. If not, the system will return appropriate exception messages.

  >      Use this service to perform operations on Long Running Processes.

  >      --- Snippet Code ----
  >        // Create Process Service
  >        IProcessService processService = serviceFactory.createProcessService();
  >        // Get all process types
  >        List processTypes = processService.getProcessTypes();

  Since:
    7.4.0.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `IProcessInfo` | `getLatestProcess(Id processTypeId)` Get latest process information of a specific process type.
    `IProcessInfo` | `getProcess(Id processId)` Get the process information of a specific process.
    `java.util.List<IProcessInfo>` | `getProcessList(ProcessQueryOptions options)` Query a list of processes.
    `java.util.List<IProcessLog>` | `getProcessLogs(Id processId, ProcessLogQueryOptions options)` Get process logs of a specific process.
    `java.util.List<IProcessType>` | `getProcessTypes()` Get process types.
    `void` | `terminateProcess(Id processId)` Terminate a specific process.

- - ### Method Detail

    - #### getProcessTypes

          java.util.List<IProcessType> getProcessTypes()

      Get process types.

    - #### getProcessList

          java.util.List<IProcessInfo> getProcessList(ProcessQueryOptions options)

      Query a list of processes.
      Parameters:
        `options` - the query options
      Returns:
        the list of processes

    - #### getProcess

          IProcessInfo getProcess(Id processId)

      Get the process information of a specific process.
      Parameters:
        `processId` - the process id
      Returns:
        the process information

    - #### getLatestProcess

          IProcessInfo getLatestProcess(Id processTypeId)

      Get latest process information of a specific process type.
      Parameters:
        `processTypeId` - the process type id
      Returns:
        the process information

    - #### getProcessLogs

          java.util.List<IProcessLog> getProcessLogs(Id processId,
                                                     ProcessLogQueryOptions options)

      Get process logs of a specific process.

      Limitations:

      - The maximum count of returned objects is limited to 10000.

      Parameters:
        `processId` - the process id
        `options` - the query options
      Returns:
        the list of process logs
        Example The following code snippet illustrates getting process logs with pagination options

                     IProcessService ps = serviceFactory.createProcessService();
                     int pageRowCount = 10000;
                     int startRow = 1;
                     int totalCount = 0;
                     boolean hasMorePages = true;

                     while (hasMorePages) {
                         // prepare paging options
                         ProcessLogQueryOptions options = new ProcessLogQueryOptions();
                         options.setStartRow(startRow);
                         options.setEndRow(startRow + pageRowCount - 1);

                         // query process logs
                         List processLogs = ps.getProcessLogs(processId, options);

                         // handle process logs
                         for (IProcessLog log : processLogs) {
                             // handle a process log
                         }
                         totalCount += processLogs.size();

                         // prepare next page
                         hasMorePages = (processLogs.size() == pageRowCount);
                         startRow += pageRowCount;
                     }

    - #### terminateProcess

          void terminateProcess(Id processId)

      Terminate a specific process.
      Parameters:
        `processId` - the process id

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.