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

QueryPage Method


This method is useful when the search specification retrieves a large number of records at the root component. To avoid returning one huge Siebel Message, you can specify the number of records to be returned using the PageSize argument, as presented in Table 25. You can also use method arguments such as OutputIntObjectName, SearchSpec, SortSpec, ViewMode, and StartRowNum to dictate which records to return.

Even though the QueryPage returns a limited number of records, it keeps the data in the cache, which you can then retrieve by calling the EAI Siebel Adapter with a new value for the StartRowNum method argument. Note that this is only possible if the method arguments OutputIntObjectName, PageSize, SearchSpec, SortSpec, and ViewMode are not changed and the NewQuery method argument is set to False.

NOTE:  The EAI Siebel Adapter returns the output of the QueryPage() method as one Siebel Message. This integration object instance is stored in the process memory. If your query returns a large number of records, this will result in your Siebel component's memory consumption being high.

The QueryPage method precedes each integration object instance. It is provided through the SiebelMessage input argument when performing a query by example. Parameters such as StartRowNum, PageSize, and others are applied to each integration object instance.

For example, a Siebel database contains four account records with the Name field set to: a1, a2, b1, b2. An input SiebelMessage with two instances of the Account integration object with the first instance's name set to "a*" and the second instance's name set to "b*" the result for StartRowNum=0 is all four records (a1, a2, b2, b4), and for StartRowNum=1 only two records (a2 and b2). This example illustrates that the StartRowNum method argument counts records within each single integration object instance of the query by example input SiebelMessage, once for "a*" (a1, a2) and once for "b*" (b1, b2).

The following is an example of using the QueryPage() method in a business service.

var EAIService = TheApplication().GetService("EAI Siebel Adapter");

var writeSvc = TheApplication().GetService("EAI XML Write to File");

var EAIin = TheApplication().NewPropertySet();

var ResultSet= TheApplication().NewPropertySet();

var moreRecords = true;

var countOfObjects = 0;

var i = 1;

// set up input arguments, get 10 at a time

EAIin.SetProperty("OutputIntObjectName", "EAI Account");

EAIin.SetProperty("PageSize", "10");

EAIin.SetProperty("SearchSpec", "[Account.Name] LIKE '3*'");

EAIin.SetProperty("StartRowNum", i);

EAIin.SetProperty("NewQuery", "true");

// retrieve the business component data

EAIService.InvokeMethod("QueryPage", EAIin, ResultSet);

// loop through cached data

while ( (ResultSet.GetChildCount() > 0) && (moreRecords)) {

countOfObjects = countOfObjects + ResultSet.GetProperty("NumOutputObjects");

// write out first chunk of data retrieved

ResultSet.SetProperty("FileName", "d:\\temp\\EAIaccount$$.xml");

writeSvc.InvokeMethod("WriteEAIMsg", ResultSet, Outputs);

// reuse the existing input property set, except don't reissue query

EAIin.SetProperty("NewQuery", "false");

i= i+10; // get next 10 records

EAIin.SetProperty("StartRowNum", i);

ResultSet.Reset(); // clear previous result set

EAIService.InvokeMethod("QueryPage", EAIin, ResultSet);

if (ResultSet.GetProperty("LastPage") == "true")

moreRecords = false;

}

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