Integration Platform Technologies: Siebel Enterprise Application Integration > EAI UI Data Adapter Business Service > EAI UI Data Adapter Business Service Methods >

QueryPage Method


Custom UIs can use the QueryPage method to query data in the Siebel database one page at a time. QueryPage supports both query-by-example (QBE) and predefined queries (PDQ). However, it is recommended that you use either QBE or a PDQ, but not both at the same time. If both QBE and PDQ are specified, then PDQ overrides QBE. In this case, the EAI UI Data Adapter executes the PDQ, ignores the QBE, and does not generate an error.

QueryPage Method Arguments

Table 28 lists the method arguments used with the QueryPage method. For a description of the arguments, see EAI UI Data Adapter Business Service Method Arguments.

Table 28. Method Arguments for QueryPage
Method Argument Name
Type

ExecutionMode

Input

LOVLanguageMode

Input

NamedSearchSpec

Input

NewQuery

Input

NumOutputObjects

Output

OutputIntObjectName

Input

SiebelMessage

Input / Output

ViewMode

Input

Root and Child Pagination

The EAI UI Data Adapter supports pagination for both root and child components. To support root and child pagination, the EAI UI Data Adapter requires that you set the attributes listed in Table 29 as part of the integration component instance.

NOTE:  Pagination over root components benefits performance because, as long as the search specification, sort specification, and view mode remain the same, the business component is not re-executed with each invocation of QueryPage. However, for pagination over child components, the component is reexecuted every time you call QueryPage.

Table 29. Attributes for Root and Child Pagination
Attribute
Description

pagesize

The number of records to be returned for a component. The default page size is 10. Note that there is a server parameter that controls the maximum page size (MaximumPageSize). If the pagesize attribute is greater than the maximum pagesize defined in the server parameter, then an error occurs.

startrownum

Determines the starting point for record retrieval. The 0-based index of the record within the recordset.

lastpage

Indicates whether the record being returned is the last record in the record set. The value is set by the EAI UI Data Adapter. Valid values are true or false.

recordcountneeded

When set to true, indicates that a record count is needed for this component. Valid values are true or false.

recordcount

Value set by the EAI UI Data Adapter indicating the approximate record count provided by the object manager based on the search specification.

Example of QueryPage on Parent and Child Components

This example demonstrates querying on both parent and child components. In this example, the query is for accounts that begin with 'A' and any associated contacts (First Name and Last Name). Note that pagesize is 10 and an approximate record count is requested and returned in the response.

Request

<SiebelMessage MessageType="Integration Object" IntObjectName="Account" IntObjectFormat="Siebel Hierarchical">
   <ListOfAccount pagesize="10" startrownum="0" recordcountneeded = "true">
      <Account>
         <Name>='A'</Name>
            <ListOfContact>
            <Contact>
               <FirstName></FirstName>
               <LastName></LastName>
            </Contact>
         </ListOfContact>
      </Account>
   </ListOfAccount>
</SiebelMessage>

Response

SiebelMessage MessageType="Integration Object" IntObjectName="Account" IntObjectFormat="Siebel Hierarchical">
   <ListOfAccount recordcount="2" lastpage="true">
      <Account>
         <Name>Adams Tech</Name>
         <ListOfContact lastpage="true">
         <Contact>
            <FirstName>Sally</FirstName>
            <LastName>Brown</LastName>
         </Contact>
            <Contact>
               <FirstName>Terry</FirstName>
               <LastName>Smith</LastName>
            </Contact>
         </ListOfContact>
      </Account>
      <Account>
         <Name>Aleph Inc.</Name>
            <ListOfContact lastpage="true">
            <Contact>
               <FirstName>Bill</FirstName>
               <LastName>Jones</LastName>
            <Contact>
            <Contact>
               <FirstName>Roland</FirstName>
               <LastName>Smith</LastName>
            </Contact>
         </ListOfContact>
     </Account>
   </ListOfAccount>
</SiebelMessage>

Sort Specification

You can specify a sort specification on one or more integration component fields of an integration component. For each field you want sort on, you must define the attributes listed in Table 30. If both attributes are not specified, then the field is not considered as a sort field.

Table 30. Sort Specification Attributes
Attribute
Description

sortorder

Determines whether the sort order is ascending or descending. Valid values are ASC or DEC.

sortsequence

Determines the order in which the sort specification is applied. Valid values are integer numbers.

Example of Sort Specification

This example demonstrates using the QueryPage method with an ascending sort order.

Request

<SiebelMessage MessageType="Integration Object" IntObjectName="Account" IntObjectFormat="Siebel Hierarchical">
   <ListOfAccount>
      <Account>
         <Row_Id>2-1111</Row_Id>
         <ListOfContact pagesize="40" startrownum="0" recordcountneeded="true">
            <Contact>
               <FirstName sortorder="ASC" sortsequence="1"></FirstName>
            </Contact>
         </ListOfContact>
      </Account>
   </ListOfAccount>
</SiebelMessage>

Response

<SiebelMessage MessageType="Integration Object" IntObjectName="Account" IntObjectFormat="Siebel Hierarchical">
   <ListOfAccount lastpage="true">
      <Account>
         <Row_ID>2-1111</Row_ID>
         <ListOfContact recordcount="3" lastpage="true">
            <Contact>
               <FirstName>Alice</FirstName>
            </Contact>
            <Contact>
               <FirstName>Bill</FirstName>
            </Contact>
            <Contact>
               <FirstName>Casey</FirstName>
            </Contact>
         </ListOfContact>
      </Account>
   </ListOfAccount>
</SiebelMessage>

Predefined Query

You can specify the name of a PDQ using the method argument NamedSearchSpec. The EAI UI Data Adapter uses this value to set the search specification at the business object level.

Search Specification

You can use the searchspec attribute on a component instance for complicated queries.

For example, query by example (QBE) uses AND as the implicit operator between fields. You could implement OR semantics by using multiple integration component instances, but this would result in a query for each integration component instance and might result in duplicate records being returned. Using the searchspec attribute could avoid this problem.

The syntax for the searchspec attribute is as follows:

  • Expression: Expression [Binary Operator Expression]
  • Expression: [Field XML tag] Operator 'Value'
  • Expression: (Expression)

    NOTE:  Parentheses can be nested.

  • Expression: [Field XML tag] IS NULL | [Field XML tag] IS NOT NULL
  • Expression: EXISTS(Expression) | NOT EXISTS(Expression)

    NOTE:  In EXISTS and NOT EXISTS expressions, use the business component field names of multivalue group (MVG) fields, not the integration component XML tag names.

  • Operator: = | ~= | < | <= | > | >= | <> | LIKE | ~LIKE
  • Binary Operator: AND | OR

The EAI UI Data Adapter parses the searchspec (unlike the EAI Siebel Adapter) and performs the following operations before setting the search specification on the business component:

  • Converts Field XML tags into business component field names. For example, assume two business component fields, First Name and Last Name, have XML tags FirstName and LastName respectively. The EAI UI Data Adapter converts the XML tags as shown in Table 31.
Table 31. Example Search Specification Conversion
This Search Spec
Will be converted to this

[FirstName] LIKE '*Jon*' AND [LastName] = 'Doe'

[First Name] LIKE '*Jon*' AND [Last Name] = 'Doe'

[FirstName] LIKE '*Jon*' OR [LastName] LIKE 'Doe*'

[First Name] LIKE '*Jon*' OR [Last Name] LIKE 'Doe'

For more information about query language, see Siebel Developer's Reference.

Example of Using the searchspec Attribute

This example demonstrates using the searchspec attribute for the QueryPage method.

<SiebelMessage MessageType="Integration Object" IntObjectName="Account" IntObjectFormat="Siebel Hierarchical">
   <ListOfAccount>
      <Account>
         <Id>2-1111</Id>
         <ListOfContact pagesize="10" startrownum="0">
            <Contact searchspec="[FirstName] LIKE '*Jon*' AND [LastName] = 'Doe'">
               <FirstName></FirstName>
               <LastName></LastName>
            </Contact>
         </ListOfContact>
      </Account>
   </ListOfAccount>
</SiebelMessage>

Integration Platform Technologies: Siebel Enterprise Application Integration Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.