Interface CaseQuery.IFilterableColumns

All Known Subinterfaces:
CaseQuery.IFilterQuery
All Known Implementing Classes:
CaseQuery.FilterQuery
Enclosing class:
CaseQuery

public static interface CaseQuery.IFilterableColumns
Provides filter functionality for ICase

Example:

CaseQuery.businessCases().where().customVarCharField1().isEqual("Hello World").and().customDecimalField2().isGreaterThan(15.3);
Corresponds to SQL:
SELECT * FROM IWA_IWA_Case WHERE CustomVarCharField1 = 'Hello World' AND CustomDecimalField1 > 15.3

API:
This is a public API.
  • Method Details

    • isBusinessCase

      CaseQuery.FilterLink isBusinessCase()
      Selects only cases that are business cases.

      For performance reasons you should prefer CaseQuery.businessCases() to restrict your query to business cases.

      Example:
      Get all business cases
       import ch.ivyteam.ivy.workflow.ICase;
       import ch.ivyteam.ivy.workflow.query.CaseQuery;
      
       CaseQuery query = CaseQuery.create().where().isBusinessCase();
       List<ICase> businessCases = ivy.wf.getCaseQueryExecutor().getResults(query);
       
      Returns:
      the query for further composition
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • isNotBusinessCase

      CaseQuery.FilterLink isNotBusinessCase()
      Selects only cases that are not business cases (e.g. sub cases).

      For performance reasons you should prefer CaseQuery.subCases() to restrict your query to sub cases (technical cases).

      Example:
      Get all sub cases
       import ch.ivyteam.ivy.workflow.ICase;
       import ch.ivyteam.ivy.workflow.query.CaseQuery;
      
       CaseQuery query = CaseQuery.create().where().isNotBusinessCase();
       List<ICase> subCases = ivy.wf.getCaseQueryExecutor().getResults(query);
       
      Returns:
      the query for further composition
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • tasks

      CaseQuery.FilterLink tasks(TaskQuery taskQuery)

      Adds an expression to the where clause that selects those cases that have at least one matching task for the given taskQuery.

      This method considers only the where clause of the given taskQuery. All other parts are ignored.

      Example:
      Get all cases that have tasks in state PARKED

       import ch.ivyteam.ivy.workflow.ICase;
       import ch.ivyteam.ivy.workflow.TaskState;
       import ch.ivyteam.ivy.workflow.query.TaskQuery;
       import ch.ivyteam.ivy.workflow.query.CaseQuery;
      
       CaseQuery query = CaseQuery.businessCases().where().tasks(TaskQuery.create().where().state().isEqual(TaskState.PARKED));
       List<ICase> casesWithParkedTasks = ivy.wf.getCaseQueryExecutor().getResults(query);
       
      Parameters:
      taskQuery - task query with where clause to filter the tasks
      Returns:
      the where query builder, for further building
      Throws:
      IllegalArgumentException - If the given taskQuery is null
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • triggeredByTasks

      CaseQuery.FilterLink triggeredByTasks(TaskQuery taskQuery)

      Adds an expression to the where clause that selects those cases that have been created with a Trigger process element by tasks which matches the given taskQuery.

      Cases can be triggered by tasks by using the Trigger process element.

      This method considers only the where clause of the given taskQuery. All other parts are ignored.

      Example:
      Get all cases that were created by tasks with kind code "Order"

       import ch.ivyteam.ivy.workflow.ICase;
       import ch.ivyteam.ivy.workflow.TaskState;
       import ch.ivyteam.ivy.workflow.query.TaskQuery;
       import ch.ivyteam.ivy.workflow.query.CaseQuery;
      
       CaseQuery query = CaseQuery.businessCases().where().triggeredByTasks(TaskQuery.create().where().kindCode().isEqual("Order"));
       List<ICase> casesCreatedByTasksOfProcessOrder = ivy.wf.getCaseQueryExecutor().getResults(query);
       
      Parameters:
      taskQuery - task query with where clause to filter the tasks
      Returns:
      the where query builder, for further building
      Throws:
      IllegalArgumentException - If the given taskQuery is null
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • isInvolved

      Filters all cases the security member is involved in.
      Parameters:
      member -
      Returns:
      the query for further composition
      Throws:
      IllegalArgumentException - If the given member is null
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • isInvolved

      CaseQuery.FilterLink isInvolved(String memberName, String applicationName)
      Filters all cases where the security member with given member name (user or role) in the given application is involved in.
      Compared to the method isInvolved(ISecurityMember), this method evaluates the corresponding ISecurityMember on query execution.

      Example:
      Get all tasks where the current user or the user 'Joe' is involved in:

       import ch.ivyteam.ivy.workflow.ICase;
       import ch.ivyteam.ivy.workflow.query.CaseQuery;
      
       CaseQuery query = CaseQuery.businessCases()
         .where().isInvolved("#Joe", "MyApp") // note: to convert a user name to a member name a '#' is added as prefix
            .or().isInvolved(ivy.session.getSessionUser().getMemberName(), "MyApp");
      
       List<ICase> cases = ivy.wf.getCaseQueryExecutor().getResults(query);
       
      Parameters:
      memberName - e.g. a role "TopManagementRole", e.g. a user must be prefixed with # "#Joe"
      applicationName - e.g. "MyApplication"
      Returns:
      the query for further composition
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • canWorkOn

      Filters all cases where the security member (user or role) can work on at least one task.
      Parameters:
      member - the security member (user or role)
      Returns:
      the query for further composition
      Throws:
      IllegalArgumentException - If the given member is null
      Since:
      6.7
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • canWorkOn

      CaseQuery.FilterLink canWorkOn(IUserToken userToken)
      Filters all cases where the user token can work on at least one task.
      Parameters:
      userToken - the user token
      Returns:
      the query for further composition
      Throws:
      IllegalArgumentException - If the given member is null
      Since:
      6.7
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • roleIsInvolved

      CaseQuery.FilterLink roleIsInvolved(IRole role)

      Filters all cases the role is involved in. A role is involved in a case if the role is involved in at least one task of the case.

      A role is involved in a task if

      • the task is assigned to the role. Either before or after the expiry.
      A role is not involved in a task if
      • the role becomes responsible for a task after expiry but the task has not yet expired.
      • the task is assigned to the role but is delayed
      • the task is assigned to a sub or parent role of the role

      Example:

       import ch.ivyteam.ivy.workflow.query.CaseQuery;
       import ch.ivyteam.ivy.workflow.ITask;
       import ch.ivyteam.ivy.security.IRole;
      
       IRole role = ivy.session.getSecurityContext().findRole("Admin");
       CaseQuery query = CaseQuery.businessCases().where().roleIsInvolved(role);
       List<ICase> userInvolvedCases = ivy.wf.getCaseQueryExecutor().getResults(query);
      Parameters:
      role -
      Returns:
      the query for further composition
      Throws:
      IllegalArgumentException - If the given role is null
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • roleIsInvolved

      CaseQuery.FilterLink roleIsInvolved(String roleName, String applicationName)
      Filters all cases where the role with given name in the given application is involved in.

      Compared to the method roleIsInvolved(IRole), this method evaluates the corresponding IRole on query execution.

      This method is equivalent to isInvolved(String, String)

      Parameters:
      roleName - e.g. "TopManagementRole"
      applicationName -
      Returns:
      the query for further composition
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • userIsInvolved

      CaseQuery.FilterLink userIsInvolved(IUser user)

      Filters all cases the user is involved in. A user is involved in a case if

      • the user is the creator of the case
      • the user is involved in at least one task of the case
        The user is involved in a task if

        • the user could work on the task
        • the user is working at the task right now
        • the user has completed the task
        The user is not involved in a task if
        • the user has worked on the task without completing it and now it is no longer accessible for him. Either because the task was completed by someone else, was reassigned, ...
        • the user can work on the task but it is delayed

      Example:

       import ch.ivyteam.ivy.workflow.query.CaseQuery;
       import ch.ivyteam.ivy.workflow.ICase;
       import ch.ivyteam.ivy.security.IUser;
      
       IUser user = ivy.session.getSessionUser();
       CaseQuery query = CaseQuery.businessCases().where().userIsInvolved(user);
       List<ICase> userInvolvedCases = ivy.wf.getCaseQueryExecutor().getResults(query);
      Parameters:
      user -
      Returns:
      the query for further composition
      Throws:
      IllegalArgumentException - If the given user is null
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • userIsInvolved

      CaseQuery.FilterLink userIsInvolved(String userName, String applicationName)
      Filters all cases where the user with given name in the given application is involved in.

      Compared to the method userIsInvolved(IUser), this method evaluates the corresponding IUser on query execution.

      This method is equivalent to isInvolved("#" + userName, appName)

      Parameters:
      userName - e.g. "Joe"
      applicationName -
      Returns:
      the query for further composition
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • currentUserIsInvolved

      CaseQuery.FilterLink currentUserIsInvolved()

      Filters all cases the current session user is involved in. The current session user is involved in a case if

      • the current session user is the creator of the case
      • the current session user is involved in at least one task of the case
        The current session user is involved in a task if

        • the current session user could work on the task
        • the current session user is working at the task right now
        • the current session user has completed the task
        The current session user is not involved in a task if
        • the current session user has worked on the task without completing it and now it is no longer accessible for him. Either because the task was completed by someone else, was reassigned, ...
        • the current session user can work on the task but it is delayed

      Example:

       import ch.ivyteam.ivy.workflow.query.CaseQuery;
       import ch.ivyteam.ivy.workflow.ICase;
      
       CaseQuery query = CaseQuery.businessCases().where().currentUserIsInvolved();
       List<ICase> sessionInvolvedCases = ivy.wf.getCaseQueryExecutor().getResults(query);
      Returns:
      the query for further composition
      Throws:
      IllegalStateException - If there is no current session available
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • userCanWorkOn

      CaseQuery.FilterLink userCanWorkOn(IUser user)
      Filters all cases where the user can work on at least one task.
      Parameters:
      user -
      Returns:
      the query for further composition
      Throws:
      IllegalArgumentException - If the given member is null
      Since:
      6.7
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • roleCanWorkOn

      CaseQuery.FilterLink roleCanWorkOn(IRole role)
      Filters all cases where the role can work on at least one task.
      Parameters:
      role -
      Returns:
      the query for further composition
      Throws:
      IllegalArgumentException - If the given member is null
      Since:
      6.7
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • hasStarted

      Filters all cases the given security member has started. A role is considered to have started a case if the given role is allowed to start a new case at the same process start the case was started on.

      Example:

       import ch.ivyteam.ivy.workflow.query.CaseQuery;
       import ch.ivyteam.ivy.workflow.ICase;
       import ch.ivyteam.ivy.security.IUser;
      
       IUser user = ivy.wf.getSecurityContext().findUser("Somebody");
       CaseQuery query = CaseQuery.businessCases().where().hasStarted(user);
       List<ICase> casesStartedByUser = ivy.wf.getCaseQueryExecutor().getResults(query);
      Parameters:
      member -
      Returns:
      the query for further composition
      Throws:
      IllegalArgumentException - If the given member is null
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • hasStarted

      CaseQuery.FilterLink hasStarted(String memberName, String applicationName)
      Filters all cases where the security member with given member name (user or role) in the given application has started.

      Compared to the method hasStarted(ISecurityMember), this method evaluates the corresponding ISecurityMember on query execution.

      Get all tasks where the current user or the user 'Joe' has started:

       import ch.ivyteam.ivy.workflow.ICase;
       import ch.ivyteam.ivy.workflow.query.CaseQuery;
      
       CaseQuery query = CaseQuery.businessCases()
         .where().hasStarted("#Joe", "MyApp") // note: to convert a user name to a member name a '#' is added as prefix
            .or().hasStarted(ivy.session.getSessionUser().getMemberName(), "MyApp");
      
       List<ICase> cases = ivy.wf.getCaseQueryExecutor().getResults(query);
       
      Parameters:
      memberName - e.g. a role "TopManagementRole", e.g. a user must be prefixed with # "#Joe"
      applicationName - e.g. "MyApplication"
      Returns:
      the query for further composition
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • currentUserHasStarted

      CaseQuery.FilterLink currentUserHasStarted()

      Filters all cases the user of the current session has started.

      Example:

       import ch.ivyteam.ivy.workflow.query.CaseQuery;
       import ch.ivyteam.ivy.workflow.ICase;
      
       CaseQuery query = CaseQuery.businessCases().where().currentUserHasStarted();
       List<ICase> casesStartedByUser = ivy.wf.getCaseQueryExecutor().getResults(query);
      Returns:
      the query for further composition
      Throws:
      IllegalStateException - If there is no current session available
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • isOwner

      Filters all cases the security member is owner of.

      Example:

       import ch.ivyteam.ivy.workflow.query.CaseQuery;
       import ch.ivyteam.ivy.workflow.ICase;
      
       CaseQuery query = CaseQuery.businessCases().where().isOwner(ivy.session.getSessionUser());
       List<ICase> casesCurrentUserIsOwnerOf = ivy.wf.getCaseQueryExecutor().getResults(query);
      Parameters:
      member - can not be null
      Returns:
      the query for further composition
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • currentUserIsOwner

      CaseQuery.FilterLink currentUserIsOwner()

      Filters all cases the current user is owner of.

      Example:

       import ch.ivyteam.ivy.workflow.query.CaseQuery;
       import ch.ivyteam.ivy.workflow.ICase;
      
       CaseQuery query = CaseQuery.businessCases().where().currentUserIsOwner();
       List<ICase> casesCurrentUserIsOwnerOf = ivy.wf.getCaseQueryExecutor().getResults(query);
      Returns:
      the query for further composition
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • isOwner

      CaseQuery.FilterLink isOwner(String memberName, String applicationName)

      Filters all cases the member of the application is owner of.

      Example:

       import ch.ivyteam.ivy.workflow.query.CaseQuery;
       import ch.ivyteam.ivy.workflow.ICase;
      
       CaseQuery query = CaseQuery.businessCases().where().isOwner("#Joe", "myApplication"); // note: to convert a user name to a member name a '#' is added as prefix
       List<ICase> casesCurrentUserIsOwnerOf = ivy.wf.getCaseQueryExecutor().getResults(query);
      Parameters:
      memberName - e.g. a role "TopManagementRole", e.g. a user must be prefixed with # "#Joe"
      applicationName - e.g. "MyApplication"
      Returns:
      the query for further composition
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • customField

      Prepares a where statement for a custom field.
      Must be followed by a call to a field value type.

      Example:

       import ch.ivyteam.ivy.workflow.ICase;
       import ch.ivyteam.ivy.workflow.query.CaseQuery;
      
       CaseQuery query = CaseQuery.businessCases().where().customField().stringField("myCustomField").isEqualTo("valueToFind")";
       List<ICase> casesWithMatchingField = ivy.wf.getCaseQueryExecutor().getResults(query);
      Returns:
      the query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • additionalProperty

      Deprecated.
      Prepares a where statement for an additional property value.
      Must be followed by a call to a condition method.
      Parameters:
      key - the additional property key
      Returns:
      the query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • not

      Adds a condition, which negates a set of where conditions given by the otherQuery with a NOT expression.
      Only the where clause of the given otherQuery is considered. All other parts are ignored.

      SQL part: NOT([otherSqlExpression])

      Example:

      CaseQuery subQuery = CaseQuery.businessCases().where()
            .customVarCharField1().equals("a").or()
            .customVarCharField2().equals("b")
      CaseQuery query = CaseQuery.businessCases().where()
            .not(subQuery)
      Corresponds to SQL:
      SELECT * FROM IWA_IWA_Case
        WHERE NOT(
          customVarCharField1 = 'a'
          OR customVarCharField2 = 'b')

      Parameters:
      otherQuery - Query from which the negated where part will be added to the current query.
      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • caseId

      Prepares a where statement for the column CaseId.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • businessCaseId

      Prepares a where statement for the column BusinessCaseId.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • securitySystemId

      Prepares a where statement for the column SecuritySystemId.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • applicationId

      Prepares a where statement for the column ApplicationId.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • processModelId

      Prepares a where statement for the column ProcessModelId.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • taskStartId

      Prepares a where statement for the column TaskStartId.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • activatorId

      Prepares a where statement for the column ActivatorId.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • creatorId

      Prepares a where statement for the column CreatorId.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • creatorUserName

      Prepares a where statement for the column CreatorUserName.
      Must be followed by a call to a condition method.

      This is a virtual column. It contains the same value as the column Name of the referenced Creator.


      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • creatorUserDisplayName

      CaseQuery.IStringColumnFilterQuery creatorUserDisplayName()

      Prepares a where statement for the column CreatorUserDisplayName.
      Must be followed by a call to a condition method.

      This is a virtual column. It contains the same value as the column DisplayName of the referenced Creator.


      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • creatorTaskId

      Prepares a where statement for the column CreatorTaskId.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • environment

      Prepares a where statement for the column Environment.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • name

      Prepares a where statement for the column Name.
      Must be followed by a call to a condition method.

      This is a virtual column. It contains the same value as the column Name of the referenced CaseLocalized.


      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • description

      Prepares a where statement for the column Description.
      Must be followed by a call to a condition method.

      This is a virtual column. It contains the same value as the column Description of the referenced CaseLocalized.


      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • startTimestamp

      Prepares a where statement for the column StartTimestamp.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • endTimestamp

      Prepares a where statement for the column EndTimestamp.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • businessCalendar

      Prepares a where statement for the column BusinessCalendar.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • workingTime

      Prepares a where statement for the column WorkingTime.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • businessRuntime

      Prepares a where statement for the column BusinessRuntime.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • state

      Prepares a where statement for the column State.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • priority

      Prepares a where statement for the column Priority.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • stage

      Prepares a where statement for the column Stage.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • ownerId

      Prepares a where statement for the column OwnerId.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • ownerName

      Prepares a where statement for the column OwnerName.
      Must be followed by a call to a condition method.

      This is a virtual column. It contains the same value as the column MemberName of the referenced Owner.


      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • ownerDisplayName

      Prepares a where statement for the column OwnerDisplayName.
      Must be followed by a call to a condition method.

      This is a virtual column. It contains the same value as the column DisplayName of the referenced Owner.


      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • category

      Prepares a where statement for the column Category.
      Must be followed by a call to a condition method.

      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • languageId

      Prepares a where statement for the column LanguageId.
      Must be followed by a call to a condition method.

      This is a virtual column. It contains the same value as the column LanguageId of the referenced CaseLocalized.


      Returns:
      query for further composition
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.