Integrate > Case Exchange framework > Case Exchange reference material > Edit the query and pagination query

Edit the query and pagination query strings

This topic provides specifications to explain how to configure the strings for the query parameter and pagination query parameter under the Inbound tab when you set up a Case Exchange integration instance. This topic includes the following collections:

  • Filter

    The filter query parameter specifies a filtering condition for a resource collection. The service must return only resources that meet the specified condition. The following table lists the operators.

    Operator/VariableLogical operatorBoolean operatorDescriptionExample
    General Variables${object}${object}

    A placeholder for all parameters in SMIS configuration, in which the value cannot be predefined but during running time or depends on other parameters.

    The object placeholder can be sm, ep, param, context,or vars. For more information about these objects, see Placeholder objects.

    ${param.lastPullingTime}

    ${vars.$epfieldsAlias}

    Service Manager recordssmQuery the record in Service Manager.

    Get the description of an incident in Service Manager:

    ${sm.action}

    End pointepQuery the record in the end point.

    Get the description of an incident in the end point:

    ${ep[‘properties.description’]}

    ParametersparamQuery all parameters defined in the Service Manager configuration.

    Get the object defined in the Service Manager configuration:

    ${param.object}

    Context informationcontextQuery all task-related information such as internal ID and external ID. For more information, see Placeholder objects.

    Get the incident Id in Service Manager:

    ${context.internalId}

    VariablesvarsQuery all variables in Service Manager.

    Get the current login users:

    ${vars.$lo_operator}

    Special variables for Case ExchangeCurrent page offset$currentPageOffsetQuery the index of the first record on the current page in all records. This variable is defined in the Case Exchange framework and is only used by the pagination parameter.${vars.$currentPageOffset}
    Logical OperatorsAnd

    and

     

    Evaluates to true if the left and right operands evaluate to true, otherwise evaluates to false.

    http://domain/resource?filter=Id gt 1000 and Name eq ‘Jake’

    http://domain/resource?filter=Id > 1000 and Name = ‘Jake’

    OrorEvaluates to true if at least one of the left and right operands evaluates to true, otherwise evaluates to false.

    http://domain/resource?filter=Id gt 1000 or Name eq ‘Jane’

    http://domain/resource?filter=Id > 1000 or Name = ‘Jane’

    Comparison OperatorsEquals

    eq

    =

    Evaluates to true if the left and right operands are equal, otherwise evaluates to false.http://domain/resource?filter=Rank eq 2 http://domain/resource?filter=Rank = 2
    Not Equals

    ne

    !=

    Evaluates to true if the left and right operands are not equal, otherwise evaluates to false.http://domain/resource?filter=Rank ne 2 http://domain/resource?filter=Rank != 2
    Greater Than

    gt

    >

    Evaluates to true if the left operand is greater than the right operand, otherwise evaluates to false.http://domain/resource?filter=Rank gt 2 http://domain/resource?filter=Rank > 2
    Greater or Equals

    ge

    >=

    Evaluates to true if the left operand is greater than or equals to the right operand, otherwise evaluates to false.http://domain/resource?filter=Rank ge 2 http://domain/resource?filter=Rank >= 2
    Less Than

    lt

    <

    Evaluates to true if the left operand is less than the right operand, otherwise evaluates to false.

    http://domain/resource?filter=Rank lt 2

    http://domain/resource?filter=Rank < 2

    Less or Equal

    le

    <=

    Evaluates to true if the left operand is less than or equals to the right operand, otherwise evaluates to false.

    http://domain/resource?filter=Rank le 2

    http://domain/resource?filter=Rank <= 2

    BetweenbtwEvaluates to true if the leftmost operand is in the range defined by the two comma-separated operands in the parenthesis, otherwise evaluates to false. The first operand in the parenthesis represents the low limit of the range and the second operand represents the high limit of the range.http://domain/resource?filter=LastUpdate btw(2012.01.01, 2013.01.01)
    Not Betweennot btwEvaluates to true if the leftmost operand is not in the range defined by the two comma-separated operands in the parenthesis, otherwise evaluates to false. The first operand in the parenthesis represents the low limit of the range and the second operand represents the high limit of the range. Range boundaries are inclusive.http://domain/resource?filter=LastUpdate not btw(2012.01.01, 2013.01.01)
    IninEvaluates to true if the leftmost operand is equal to one of the expressions in the parenthesis, otherwise evaluates to false.http://domain/resource?filter=Id in(1,2,3)
    Not Innot inEvaluates to true if the leftmost operand is not equal to any of the expressions in the parenthesis, otherwise evaluates to false.http://domain/resource?filter=Id not in(1, 2, 3)
    Arithmetic OperatorsAdd

    add

    +

    Evaluates to the sum of the left operand and the right operand in the parenthesis.

    http://domain/resource?filter=PreviousRank gt (CurrentRank add 3)

    http://domain/resource?filter=PreviousRank > (CurrentRank + 3)

    Subtract

    sub

    -

    Evaluates to the value that the left operand minus the right operand in the parenthesis.

    http://domain/resource?filter=PreviousRank gt (CurrentRank sub 3)

    http://domain/resource?filter=PreviousRank > (CurrentRank - 3)

    Multiply

    mul

    *

    Evaluates to the product that the left operand multiplies the right operand in the parenthesis.http://domain/resource?filter=PreviousRank lt (CurrentRank mul 3) http://domain/resource?filter=PreviousRank < (CurrentRank * 3)
    Modulo

    mod

    %

    Evaluates to the remainder that the left operand divides the right operand in the parenthesis.

    http://domain/resource?filter=Actual gt Planned and (Planned mod Actual) gt 5

    http://domain/resource?filter=Actual > Planned and (Planned % Actual) > 5

    Divide

    div

    /

    Evaluates to the value that the left operand divides the right operand in the parenthesis.http://domain/resource?filter=PlannedHours div 10 http://domain/resource?filter=PlannedHours / 10
    Parenthesis OperatorParenthesis()Like in math, parenthesis can be used around conditions and expressions to define priority.

    http://domain/resource?filter=(x add y) mul (x sub z)

    http://domain/resource?filter=(x + y) * (x - z)

    Unary OperatorsUnary Plus+

    Syntax: +number

    N/A
    Unary Minus -

    Syntax: -number

    N/A
  • Layout

    The layout query parameter specifies which properties or sub-structure of a data resource should be returned by a service. Similar to SQL, this parameter provides a comma-separated list of properties or multipart properties. The following table lists the operators.

    OperatorDescriptionExample
    Selecting Resource PropertiesResource properties are specified by a property name directly. http://domain/resource?layout=Id,Name,Description
    Selecting Related Resource PropertiesRelated resource properties are specified by a relationship name and a property name.http://domain/Person?layout=PrimaryAddress.City
    Selecting a Sub-Structure Using Multipart PropertiesResources that hold complex object structures can be queried for a sub-structure using multi-part property conventions.

    Query a resource named “UserSetting” for a “Select” object, which is a sub-structure of a “Filter” object, which is a sub-structure of a “UserSetting” object.

    http://domain/UserSetting?layout=Settings.Filter.Select

    Selecting Calculated Values

    The query protocol supports function and Arithmetic operators.

    Note Functions listed in examples below have to be supported by concrete services in order to be valid – these are only examples.

    • Query a “Formula” resource for the product of a property named “X” and a property named “Y”:

      http://domain/Formula?layout=X mul Y

    • Query a “Person” resource for “FirstName” and “LastName” and return a concatenation so “FirstName”, space (“ “) and “LastName”:

      http://domain/Person?layout=Concat(FirstName, Concat(‘ ’, LastName))

  • Size

    The size parameter specifies the maximum number of resources requested to be returned.

    Syntax: size=<integer>

    Example: Fetch the first 10 persons with age lower than 30 in ascending order.

    http://domain/Person?layout=FirstName,LastName,Email&filter=Age<30&order=Age asc&size=10

  • Skip

    The skip parameter specifies how many resources should be skipped. In other words, it specifies the starting index of the returned result. When not specified, it is assumed to be zero, meaning that the first resource returned from the data-store is the first resource returned by the queried service.

    Syntax: skip=<integer>

    Example: Fetch persons, starting from person number 51.

    http://domain/Person?layout=FirstName,LastName,Email&skip=50