Integration Platform Technologies: Siebel Enterprise Application Integration > EAI Siebel Adapter > EAI Siebel Adapter 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 23. You can also use method arguments such as OutputIntObjectName, SearchSpec, SortSpec, ViewMode, and StartRowNum to dictate which records to be returned.

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. Please 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:  This is for both the Query( ) and QueryPage( ) method: The EAI Siebel Adapter returns the outputs of both methods as one Siebel Message. This integration object instance is stored in the process memory. If your query returns a large number of messages, this will result in your Siebel component's memory consumption being high.

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 dta 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 © 2008, Oracle and/or its affiliates. All rights reserved. Legal Notices.