Interface IWorkflowSession

  • All Superinterfaces:
    org.eclipse.core.runtime.IAdaptable, IAttributeStore<Object>, ISession, IUserToken

    public interface IWorkflowSession
    extends ISession
    A workflow session extends a security session with workflow functionality. Gives access to all workflow objects (task and cases) that belongs to the user of this session. A workflow object belongs to a user if:
    • A task is assigned to him or a role he owns.
    • A task he is currently working on.
    • A task he worked on in the past (needs permission).
    • A task that a member of a role he owns has worked on in the past (needs permission).
    • A case he has started (needs permission).
    • A case that have been started by a member of a role he owns (needs permission),
    • A case that has a task which he worked on (needs permission).
    • A case that has a task which a member of a role he owns has worked on in the past (needs permission).
    Since:
    17.05.2006
    API:
    This is a public API.
    • Method Detail

      • getWorkflowContext

        IWorkflowContext getWorkflowContext()
        Gets the workflow context
        Returns:
        workflow context
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • getStartableProcessStarts

        List<IProcessStart> getStartableProcessStarts()
        Returns all process start elements which the current user can start.
        Returns:
        process starts
        Throws:
        PersistencyException - if persistency access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
        Security:
        SESSION MATCHES THIS AND (MATCHES THIS.UserUnknown OR (MATCHES THIS.UserKnown AND OWNS ProcessStartReadAllOwnStartable PERMISSION))
      • getStartables

        List<IWebStartable> getStartables()
        Returns all startables which the current user can start.
        Returns:
        startables
        Since:
        6.6.2
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • findWorkingTask

        ITask findWorkingTask​(long taskIdentifier)
        Finds a task the current session user is working on (task state TaskState.RESUMED or TaskState.CREATED) with its identifier. Returns null if task does not exists or is not in state TaskState.RESUMED or TaskState.CREATED.
        Parameters:
        taskIdentifier - ITask identifier
        Returns:
        ITask or null
        Throws:
        PersistencyException - if persistency access fails
        API:
        This public API is available in Java.
        Security:
        SESSION MATCHES THIS AND OWNS TaskReadAllOwnWorking PERMISSION
      • findWorkTasks

        IQueryResult<ITask> findWorkTasks​(IPropertyFilter<TaskProperty> filter,
                                          List<PropertyOrder<TaskProperty>> order,
                                          int startIndex,
                                          int count,
                                          boolean returnAllCount,
                                          EnumSet<TaskState> includeTaskStates)

        Gets all tasks the workflow session user can work on.

        If includeTaskStates contains state TaskState.SUSPENDED all tasks in state TaskState.SUSPENDED that the workflow session user can resume are also included in the result.

        If includeTaskStates contains state TaskState.CREATED all tasks in state TaskState.CREATED that the workflow session user are working on are also included in the result.

        If includeTaskStates contains state TaskState.RESUMED all tasks in state TaskState.RESUMED that the workflow session user are working on are also included in the result.

        If includeTaskStates contains state TaskState.PARKED all tasks in state TaskState.PARKED that the workflow session user can resume are also included in the result.

        Consider to use the TaskQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         TaskQuery query = TaskQuery.create()
            .where().currentUserCanWorkOn();
         List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);

        Parameters:
        filter - filter criteria to specify which tasks should be read
        order - how to order the result
        startIndex - the index of the first task of all tasks found returned
        count - how many tasks found are returned. -1 for all.
        returnAllCount - if true the query result method IQueryResult.getAllCount() returns the overall cases that have been found, if false it returns -1
        includeTaskStates - set of task states that should be included.
        Returns:
        query result with the found tasks
        Throws:
        PersistencyException - if persistency access fails.
        See Also:
        TaskQuery, IWorkflowContext.getTaskQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
        Security:
        SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
      • findSuspendedWorkTasks

        List<ITask> findSuspendedWorkTasks​(int startIndex,
                                           int count)
        Gets all tasks the workflow session user can work on that are in state TaskState.SUSPENDED. This is a user convenience method. The method calls internal the method findWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet). The tasks are not filtered. They are sorted as follows priority ascending (higher priority first), start timestamp ascending (older first), id ascending. If you want to filter or order your result you should use directly the method findWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet).

        Consider to use the TaskQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         TaskQuery query = TaskQuery.create()
            .where().currentUserCanWorkOn()
            .and().state().isEqual(TaskState.SUSPENDED);
         List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);

        Parameters:
        startIndex - the index of the first task of all tasks found that will be returned
        count - how many tasks should be returned. -1 for all.
        Returns:
        list with the found tasks
        Throws:
        PersistencyException - if persistency access fails.
        See Also:
        TaskQuery, IWorkflowContext.getTaskQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
        Security:
        SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
      • findSuspendedAndParkedWorkTasks

        List<ITask> findSuspendedAndParkedWorkTasks​(int startIndex,
                                                    int count)
        Gets all tasks the workflow session user can work on that are in state TaskState.SUSPENDED or TaskState.PARKED. This is a user convenience method. The method calls internal the method findWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet). The tasks are not filtered. They are sorted as follows priority ascending (higher priority first), start timestamp ascending (older first), id ascending. If you want to filter or order your result you should use directly the method findWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet).

        Consider to use the TaskQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         TaskQuery query = TaskQuery.create()
            .where().currentUserCanWorkOn()
            .and(
                TaskQuery.create()
                .where().state().isEqual(TaskState.SUSPENDED)
                .or().state().isEqual(TaskState.PARKED)
             );
         List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);

        Parameters:
        startIndex - the index of the first task of all tasks found that will be returned
        count - how many tasks should be returned. -1 for all.
        Returns:
        list with the found tasks
        Throws:
        PersistencyException - if persistency access fails.
        See Also:
        TaskQuery, IWorkflowContext.getTaskQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
        Security:
        SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
      • findParkedWorkTasks

        List<ITask> findParkedWorkTasks​(int startIndex,
                                        int count)
        Gets all tasks the workflow session user can work on that are in state TaskState.PARKED. This is a user convenience method. The method calls internal the method findWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet). The tasks are not filtered. They are sorted as follows priority ascending (higher priority first), start timestamp ascending (older first), id ascending. If you want to filter or order your result you should use directly the method findWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet).

        Consider to use the TaskQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         TaskQuery query = TaskQuery.create()
            .where().currentUserCanWorkOn()
            .and().state().isEqual(TaskState.PARKED);
         List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);

        Parameters:
        startIndex - the index of the first task of all tasks found that will be returned
        count - how many tasks should be returned. -1 for all.
        Returns:
        list with the found tasks
        Throws:
        PersistencyException - if persistency access fails.
        See Also:
        TaskQuery, IWorkflowContext.getTaskQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
        Security:
        SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
      • findResumedWorkTasks

        List<ITask> findResumedWorkTasks​(int startIndex,
                                         int count)
        Gets all tasks the workflow session user can work on that are in state TaskState.RESUMED. This is a user convenience method. The method calls internal the method findWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet). The tasks are not filtered. They are sorted as follows priority ascending (higher priority first), start timestamp ascending (older first), id ascending. If you want to filter or order your result you should use directly the method findWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet).

        Consider to use the TaskQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         TaskQuery query = TaskQuery.create()
            .where().currentUserCanWorkOn()
            .and().state().isEqual(TaskState.RESUMED);
         List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);

        Parameters:
        startIndex - the index of the first task of all tasks found that will be returned
        count - how many tasks should be returned. -1 for all.
        Returns:
        list with the found tasks
        Throws:
        PersistencyException - if persistency access fails.
        See Also:
        TaskQuery, IWorkflowContext.getTaskQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
        Security:
        SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
      • findCreatedAndResumedWorkTasks

        List<ITask> findCreatedAndResumedWorkTasks​(int startIndex,
                                                   int count)
        Gets all tasks the workflow session user can work on that are in state TaskState.RESUMED or TaskState.CREATED. This is a user convenience method. The method calls internal the method findWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet). The tasks are not filtered. They are sorted as follows priority ascending (higher priority first), start timestamp ascending (older first), id ascending. If you want to filter or order your result you should use directly the method findWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet).

        Consider to use the TaskQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         TaskQuery query = TaskQuery.create()
            .where().currentUserCanWorkOn()
            .and(
                TaskQuery.create()
                .where().state().isEqual(TaskState.CREATED)
                .or().state().isEqual(TaskState.RESUMED)
            )
         List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);

        Parameters:
        startIndex - the index of the first task of all tasks found that will be returned
        count - how many tasks should be returned. -1 for all.
        Returns:
        list with the found tasks
        Throws:
        PersistencyException - if persistency access fails.
        See Also:
        TaskQuery, IWorkflowContext.getTaskQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
        Security:
        SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
      • findLockedWorkTasks

        IQueryResult<ITask> findLockedWorkTasks​(IPropertyFilter<TaskProperty> filter,
                                                List<PropertyOrder<TaskProperty>> order,
                                                int startIndex,
                                                int count,
                                                boolean returnAllCount,
                                                EnumSet<TaskState> includeTaskStates)

        Gets all tasks the workflow session user could work if they were in state TaskState.SUSPENDED but are currently in state TaskState.RESUMED or TaskState.PARKED because other users are working on them.

        If includeTaskStates contains state TaskState.RESUMED all tasks in state TaskState.RESUMED that the workflow session user could resume are also included in the result.

        If includeTaskStates contains state TaskState.PARKED all tasks in state TaskState.PARKED that the workflow session user could resume are also included in the result.

        Parameters:
        filter - filter criteria to specify which tasks should be read
        order - how to order the result
        startIndex - the index of the first task of all tasks found returned
        count - how many tasks found are returned. -1 for all.
        returnAllCount - if true the query result method IQueryResult.getAllCount() returns the overall cases that have been found, if false it returns -1
        includeTaskStates - set of task states that should be included.
        Returns:
        query result with the found tasks
        Throws:
        PersistencyException - if persistency access fails.
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
        Security:
        SESSION MATCHES THIS AND OWNS TaskReadAllOwnLocked PERMISSION
      • findStartedCases

        IQueryResult<ICase> findStartedCases​(IPropertyFilter<CaseProperty> filter,
                                             List<PropertyOrder<CaseProperty>> order,
                                             int startIndex,
                                             int count,
                                             boolean returnAllCount)
        Finds all cases that the session users has started.

        Consider to use the CaseQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         CaseQuery query = CaseQuery.create()
            .where().currentUserHasStarted();
         List<ICase> cases = ivy.wf.getCaseQueryExecutor().getResults(query, startIndex, count);

        Parameters:
        filter - filter criteria to specify which cases should be in the result
        order - how to order the result
        startIndex - the index of the first case of all cases found returned
        count - how many cases found are returned. -1 for all.
        returnAllCount - if true the query result method IQueryResult.getAllCount() returns the overall cases that have been found, if false it returns -1
        Returns:
        query result with the cases
        Throws:
        PersistencyException - if persistency access fails
        See Also:
        CaseQuery, IWorkflowContext.getCaseQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
        Security:
        SESSION MATCHES THIS AND OWNS CaseReadAllOwnStarted PERMISSION
      • findStartedCases

        List<ICase> findStartedCases​(int startIndex,
                                     int count,
                                     Date caseStartTimestampFilter)
        Finds all cases that the session users has started. This is a user convenience method. The method calls internal the method findStartedCases(IPropertyFilter, List, int, int, boolean). The cases are only filtered by the case start timestamp. They are sorted as follows: start timestamp descending (younger first), id descending. If you want to filter or order your result you should use directly the method findStartedCases(IPropertyFilter, List, int, int, boolean).

        Consider to use the CaseQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         CaseQuery query = CaseQuery.create()
            .where().currentUserHasStarted()
            .and().startTimestamp().isLowerOrEqualThan(caseStartTimestampFilter);
         List<ICase> cases = ivy.wf.getCaseQueryExecutor().getResults(query, startIndex, count);

        Parameters:
        startIndex - the index of the first case of all cases found that will be returned
        count - how many cases should be returned. -1 for all.
        caseStartTimestampFilter - case start timestamp filter. Can be null if filter should be deactivated. Cases returned have start timestamps that are equal or earlier
        Returns:
        list with the cases
        Throws:
        PersistencyException - if persistency access fails
        See Also:
        CaseQuery, IWorkflowContext.getCaseQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
        Security:
        SESSION MATCHES THIS AND OWNS CaseReadAllOwnStarted PERMISSION
      • findStartedCasesByRole

        IQueryResult<ICase> findStartedCasesByRole​(List<IRole> roles,
                                                   IPropertyFilter<CaseProperty> filter,
                                                   List<PropertyOrder<CaseProperty>> order,
                                                   int startIndex,
                                                   int count,
                                                   boolean returnAllCount)
        Gets all cases somebody has started who needs a role to start the case which the current session user also owns.
        Parameters:
        roles - the roles that one must had to start the case
        filter - filter criteria to specify which cases should be in the result
        order - how to order the result
        startIndex - the index of the first case of all cases found returned
        count - how many cases found are returned. -1 for all.
        returnAllCount - if true the query result method IQueryResult.getAllCount() returns the overall cases that have been found, if false it returns -1
        Returns:
        query result with the cases
        Throws:
        PersistencyException - if persistency access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
        Security:
        SESSION MATCHES THIS AND OWNS CaseReadAllOwnRoleStarted PERMISSION
      • findWorkedOnTasks

        IQueryResult<ITask> findWorkedOnTasks​(IPropertyFilter<TaskProperty> filter,
                                              List<PropertyOrder<TaskProperty>> order,
                                              int startIndex,
                                              int count,
                                              boolean returnAllCount)
        Finds all tasks that the session user has ever worked on

        Consider to use the TaskQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         TaskQuery query = TaskQuery.create()
            .where().currentUserHasWorkedOn();
         List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);

        Parameters:
        filter - filter criteria to specify which tasks should be in the result
        order - how to order the result
        startIndex - the index of the first task of all tasks found returned
        count - how many tasks found are returned. -1 for all.
        returnAllCount - if true the query result method IQueryResult.getAllCount() returns the overall cases that have been found, if false it returns -1
        Returns:
        query result with the tasks
        See Also:
        TaskQuery, IWorkflowContext.getTaskQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
        Security:
        SESSION MATCHES THIS AND OWNS TaskReadAllOwnWorkedOn PERMISSION
      • findWorkedOnTasks

        List<ITask> findWorkedOnTasks​(int startIndex,
                                      int count,
                                      Date taskEndTimestampFilter)
        Finds all tasks that the session users has ever worked on. This is a user convenience method. The method calls internal the method findWorkedOnTasks(IPropertyFilter, List, int, int, boolean). The tasks are only filtered by the task end timestamp. They are sorted as follows: end timestamp descending (younger first), id descending. If you want to filter or order your result you should use directly the method findWorkedOnTasks(IPropertyFilter, List, int, int, boolean).

        Consider to use the TaskQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         TaskQuery query = TaskQuery.create()
            .where().currentUserHasWorkedOn()
            .and().endTimestamp().isLowerOrEqualThan(taskEndTimestampFilter);
         List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);

        Parameters:
        startIndex - the index of the first case of all cases found that will be returned
        count - how many cases should be returned. -1 for all.
        taskEndTimestampFilter - task end timestamp filter. Can be null if filter should be deactivated. Tasks returned have end timestamps that are equal or earlier
        Returns:
        list with the tasks
        See Also:
        TaskQuery, IWorkflowContext.getTaskQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
        Security:
        SESSION MATCHES THIS AND OWNS TaskReadAllOwnWorkedOn PERMISSION
      • findWorkedOnTasksByRole

        IQueryResult<ITask> findWorkedOnTasksByRole​(List<IRole> roles,
                                                    IPropertyFilter<TaskProperty> filter,
                                                    List<PropertyOrder<TaskProperty>> order,
                                                    int startIndex,
                                                    int count,
                                                    boolean returnAllCount)
        Returns all tasks the session user has worked on or could have worked on as member of the given roles.

        Example:

         import ch.ivyteam.ivy.security.IRole;
         import ch.ivyteam.ivy.workflow.PropertyOrder;
         import ch.ivyteam.ivy.workflow.TaskProperty;
         import ch.ivyteam.ivy.workflow.IPropertyFilter;
         import ch.ivyteam.ivy.persistence.OrderDirection;
         import ch.ivyteam.logicalexpression.RelationalOperator;
         
         List<IRole> roleList;
         roleList.add(ivy.session.getSecurityContext().findRole("RoleName"));
         
         IPropertyFilter<TaskProperty> filter = ivy.wf.createTaskPropertyFilter(TaskProperty.END_TIMESTAMP, RelationalOperator.EQUAL_OR_LARGER, new Date() - '10h0m');
         
         List<PropertyOrder<TaskProperty>> order;
         order.add(new PropertyOrder<TaskProperty>(TaskProperty.PRIORITY, OrderDirection.DESCENDING));
         
         ivy.session.findWorkedOnTasksByRole(roleList, filter, order, 0, -1, false);
         
        Parameters:
        roles - the roles that one must had to work on the case
        filter - filter criteria to specify which tasks should be in the result
        order - how to order the result
        startIndex - the index of the first task of all tasks found returned
        count - how many tasks found are returned. -1 for all.
        returnAllCount - if true the query result method IQueryResult.getAllCount() returns the overall cases that have been found, if false it returns -1
        Returns:
        query result with the tasks
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
        Security:
        SESSION MATCHES THIS AND OWNS TaskReadAllOwnRoleWorkedOn PERMISSION
      • createTaskAndCase

        ITask createTaskAndCase​(IProcessStart processStart)
        Starts a new task and creates a case for a process. The returned task is in state TaskState.CREATED and the workerUser is set to the current user. This method can be used to create a non persistent case and task that is started by the calling user right now.
        Parameters:
        processStart - process start from which the created case and task starts
        Returns:
        new created task
        Throws:
        PersistencyException - If persistency access fails
        API:
        This public API is available in Java.
        Security:
        SESSION IS SYSTEM
      • resumeTask

        ITask resumeTask​(long taskIdentifier)

        Resumes a suspended or parked task with its identifier.

        Returns null if:

        A session user is allowed to resume a task if he is member of the task activator and the task is in state TaskState.SUSPENDED or he is the task worker user and the task is in state TaskState.PARKED.

        Parameters:
        taskIdentifier - ITask identifier
        Returns:
        ITask or null.
        Throws:
        PersistencyException - if persistency access fails
        See Also:
        resumeTask(long, String)
        API:
        This public API is available in Java.
        Security:
        SESSION IS SYSTEM
      • findStartedCaseCategories

        @Deprecated
        List<IGroup<ICase>> findStartedCaseCategories​(IPropertyFilter<CaseProperty> categoryFilter,
                                                      CaseProperty categoryProperty,
                                                      OrderDirection categoryPropertyOrder)
        Deprecated.
        Finds started cases categories. Each category found is returned as a group. A group knows the number of objects contained in the group and one example object of the group.

        Consider to use the CaseQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         CaseQuery query = CaseQuery.create()
            .where().currentUserHasStarted()
            .and().processCategoryCode().isEqual("MY_CATEGORY_CODE")
            .groupBy().processCode()
            .aggregate().countRows();
         Recordset rs = ivy.wf.getCaseQueryExecutor().getRecordset(query);

        Parameters:
        categoryFilter - filters the categories
        categoryProperty - a case property that is used to build the categories (E.g. CaseProperty.PROCESS_CATEGORY_CODE, CaseProperty.PROCESS_CODE, CaseProperty.TYPE_CODE, CaseProperty.SUB_TYPE_CODE)
        categoryPropertyOrder - the order in which categoryProperty should be ordered in.
        Returns:
        a list of started case categories
        Throws:
        PersistencyException - if persistency access fails
        See Also:
        CaseQuery, IWorkflowContext.getCaseQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
        Security:
        SESSION MATCHES THIS AND OWNS CaseCategoriesReadAllOwnStarted PERMISSION
      • findInvolvedCases

        IQueryResult<ICase> findInvolvedCases​(IPropertyFilter<CaseProperty> filter,
                                              List<PropertyOrder<CaseProperty>> order,
                                              int startIndex,
                                              int count,
                                              boolean returnAllCount)
        Finds cases in which the session user is involved. The session user may be involved in a case if:
        • he is the creator of the case
        • he has worked or is working on a task of the case.
        • he can work on a task of the case. Either because he is the activator of the task or the activator of the task is a role he owns.

        Consider to use the CaseQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         CaseQuery query = CaseQuery.create()
            .where().currentUserIsInvolved();
         List<ICase> cases = ivy.wf.getCaseQueryExecutor().getResults(query, startIndex, count);

        Parameters:
        filter - filter criteria to specify which cases should be in the result
        order - how to order the result
        startIndex - the index of the first case of all cases found returned
        count - how many cases found are returned. -1 for all.
        returnAllCount - if true the query result method IQueryResult.getAllCount() returns the overall cases that have been found, if false it returns -1
        Returns:
        query result with the cases
        Throws:
        PersistencyException - if persistency access fails
        See Also:
        CaseQuery, IWorkflowContext.getCaseQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
        Security:
        SESSION MATCHES THIS AND OWNS CaseReadAllOwnInvolved PERMISSION
      • findInvolvedCasesCategories

        @Deprecated
        List<IGroup<ICase>> findInvolvedCasesCategories​(IPropertyFilter<CaseProperty> categoryFilter,
                                                        CaseProperty categoryProperty,
                                                        OrderDirection categoryPropertyOrder)
        Deprecated.
        Finds case categories of cases in which the session user is involved. The session user may be involved in a case if:
        • he is the creator of the case
        • he has worked or is working on a task of the case.
        • he can work on a task of the case. Either because he is the activator of the task or the activator of the task is a role he owns.

        Consider to use the CaseQuery API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:

         CaseQuery query = CaseQuery.create()
            .where().currentUserIsInvolved()
            .and().processCategoryCode().isEqual("MY_CATEGORY_CODE")
            .groupBy().processCode()
            .aggregate().countRows();
         Recordset rs = ivy.wf.getCaseQueryExecutor().getRecordset(query);

        Parameters:
        categoryFilter - filters the categories
        categoryProperty - a case property that is used to build the categories (E.g. CaseProperty.PROCESS_CATEGORY_CODE, CaseProperty.PROCESS_CODE, CaseProperty.TYPE_CODE, CaseProperty.SUB_TYPE_CODE)
        categoryPropertyOrder - the order in which categoryProperty should be ordered in.
        Returns:
        a list of involved case categories
        Throws:
        PersistencyException - if persistency access fails
        See Also:
        CaseQuery, IWorkflowContext.getCaseQueryExecutor()
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
        Security:
        SESSION MATCHES THIS AND OWNS CaseCategoriesReadAllOwnInvolved PERMISSION
      • findInvolvedCasesByRole

        IQueryResult<ICase> findInvolvedCasesByRole​(List<IRole> roles,
                                                    IPropertyFilter<CaseProperty> filter,
                                                    List<PropertyOrder<CaseProperty>> order,
                                                    int startIndex,
                                                    int count,
                                                    boolean returnAllCount)
        Finds cases in which the session user is involved. The session user may be involved in a case if:
        • he is the creator of the case
        • one of his colleagues has started the case but he would have been also able to start the case
        • he has worked or is working on a task of the case.
        • one of his colleagues has worked or is working on a task of the case and he would have been also able to work on the task because the activator of the task was a role that is in the roles parameter list.
        • he can work on a task of the case. Either because he is the activator of the task or the activator of the task is a role he owns.
        Parameters:
        roles - filters the roles. Only roles are allowed that the workflow users owns.
        filter - filter criteria to specify which cases should be in the result
        order - how to order the result
        startIndex - the index of the first case of all cases found returned
        count - how many cases found are returned. -1 for all.
        returnAllCount - if true the query result method IQueryResult.getAllCount() returns the overall cases that have been found, if false it returns -1
        Returns:
        query result with the cases
        Throws:
        PersistencyException - if persistency access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
        Security:
        SESSION MATCHES THIS AND OWNS CaseReadAllOwnRoleInvolved PERMISSION
      • findInvolvedCasesByRoleCategories

        @Deprecated
        List<IGroup<ICase>> findInvolvedCasesByRoleCategories​(List<IRole> roles,
                                                              IPropertyFilter<CaseProperty> categoryFilter,
                                                              CaseProperty categoryProperty,
                                                              OrderDirection categoryPropertyOrder)
        Deprecated.
        Finds case categories of cases in which the session user is involved. The session user may be involved in a case if:
        • he is the creator of the case
        • one of his colleagues has started the case but he would have been also able to start the case
        • he has worked or is working on a task of the case.
        • one of his colleagues has worked or is working on a task of the case and he would have been also able to work on the task because the activator of the task was a role that is in the roles parameter list.
        • he can work on a task of the case. Either because he is the activator of the task or the activator of the task is a role he owns.
        Parameters:
        roles - filters the roles. Only roles are allowed that the workflow users owns.
        categoryFilter - filters the categories
        categoryProperty - a case property that is used to build the categories (E.g. CaseProperty.PROCESS_CATEGORY_CODE, CaseProperty.PROCESS_CODE, CaseProperty.TYPE_CODE, CaseProperty.SUB_TYPE_CODE)
        categoryPropertyOrder - the order in which categoryProperty should be ordered in.
        Returns:
        a list of involved case categories
        Throws:
        PersistencyException - if persistency access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
        Security:
        SESSION MATCHES THIS AND OWNS CaseCategoriesReadAllOwnRoleInvolved PERMISSION