Information Management IBM InfoSphere MDM Custom Domain Hub, Version 10.1

Examples of substitution

The following examples show valid syntax that can be used in substitution expressions.
  • Example 1:
    {id.123.response.TCRMPersonBObj.PartyId}

    Gets the PartyId from the TCRMPersonBObj object. The TCRMPersonBObj object comes from the response that has a correlator ID 123.

  • Example 2: This example shows the most basic form of substitution expression.
    {id.222.response.TCRMPersonBObj.TCRMPersonNameBObj[where NameUsageType = 1].
         PersonNameIdPK}

    Gets the PersonNameIdPK from the TCRMPersonNameBObj object where the NameUsageType equals 1. The TCRMPersonBObj object comes from the response that has a correlator ID 222.

  • Example 3: This example shows the use of criteria to compare a numeric value.
    {transactionCorrelatorId.222.TCRMPersonBObj.TCRMPersonNameBObj
    [where LastName = 'Smith'].PersonNameIdPK}

    Similar to above. When the ".response" symbol is omitted, the response object is assumed. Also, you can use transactionCorrelatorId instead of id. The symbol transactionCorrelatorId is retained for backwards compatibility purposes.

  • Example 4: This example shows the use of criteria to compare a string value.
    {id.111.request.TCRMPersonBObj.TCRMPartyAddressBObj[2].StartDate}

    Gets the StartDate from the third TCRMPartyAddressBObj object. The TCRMPersonBObj object comes from the request that has a correlator ID 111.

  • Example 5: This example shows the use of criteria by index.
    {id.333.response.TCRMPersonBObj.TCRMPartyContactMethodBObj[where 
         PartyContactMethodIdPK = 9900].TCRMPartyContactMethodPrivPrefBObj
    [where EndDate = date('2005-12-31 12:00:00.000')].StartDate}

    Gets the StartDate from the TCRMPartyContactMethodPrivPrefBObj object whose end date is equal to the date specified. The TCRMPartyContactMethodPrivPrefBObj object belongs to the TCRMPartyContactMethodBObj object whose PartyContactMethodIdPK equals 9900. The TCRMPersonBObj object comes from the response that has a correlator ID 333.

  • Example 6: This example shows the use of criteria in more than one object in the object hierarchy. It also shows the use of criteria to compare a date value.
    {id.444.response.TCRMPersonBObj.TCRMPersonNameBObj[where NameUsageType != 1 and 
         PrefixType = 12].LastName}

    Gets the LastName from the TCRMPersonNameBObj object where the NameUsageType does not equal 1 and PrefixType equals 12. The TCRMPersonBObj object comes from the response that has a correlator ID 444.

  • Example 7: This example shows the use of boolean and comparison operators to create more complex criteria.
    {id.555.response.TCRMPersonBObj.TCRMPersonNameBObj[where NameUsageType = 
         id.200.request.TCRMPersonBObj.TCRMPersonNameBObj.NameUsageType].LastName}
    Gets the LastName from the TCRMPersonNameBObj object where the NameUsageType equals the NameUsageType from the TCRMPersonNameBObj object in the request that has a correlator ID 200. The TCRMPersonNameBObj is a part of the TCRMPersonBObj object from the response that has a correlator ID 555.

    This example shows that the right-hand side of a comparison operator can be a fully qualified name that refers to another part of the composite transaction. In previous examples, the right-hand side value is a constant.

  • Examples 8-12: The following are some examples of invalid substitution, which will cause exception to be thrown either during parsing or transaction.
    {id.555.response.TCRMPersonBObj.TCRMPersonNameBObj[where 
         id.200.request.TCRMPersonBObj.TCRMPersonNameBObj.NameUsageType = 
         NameUsageType].LastName}

    This example is similar to the last valid example given above, except that the left-hand side and right-hand side values of the comparison operator are reversed. The syntax requires that the left-hand side value be an attribute of the object being qualified. By definition, an attribute name cannot contain any period, hence an exception will be thrown during parsing time.

    {id.234.response.TCRMPersonBObj.TCRMPartyAddressBObj[2]}

    This example is syntactically incorrect because the last symbol in the substitution cannot be qualified with an index. An exception will be thrown during parsing time.

    {id.234.response.TCRMPersonBObj.TCRMFinancialProfileBObj}

    This example is syntactically correct and can be parsed successfully. However, this substitution does not evaluate to a value since TCRMFinancialProfileBObj is a business object. The backward reference used in the substitution expression must resolve to an attribute. This example will throw an exception at transaction time.

    {id.234.response.TCRMPersonBObj.TCRMPersonNameBObj[where LastName = Smith].
         PersonNameIdPK}

    This example is syntactically incorrect because the string value being compared is not enclosed with quotation marks. An exception will be thrown during parsing time.

    {id.234.response.TCRMPersonSearchResultBObj.PartyId}

    This example is syntactically correct and can be parsed successfully. However, if the request producing this response is an searchPerson transaction, the transaction will return zero or more instances of the TCRMPersonSearchResultBObj objects in a collection. By not qualifying which TCRMPersonSearchResultBObj object you want to refer to, this example will throw an exception at transaction time.



Feedback

Timestamp Last updated: November 2012

Topic URL: