Siebel – EAI Siebel Adapter Search Spec
by Vikas LuthraHi,
I can bet that for anybody who has worked on Siebel EAI, ‘EAI Siebel Adapter’ is not an Alien term. This post is about EAI Siebel Adapter’s Query method.
How to restrict the number of Child records returned in Siebel adapter’s Query.
Scenario – Order and related Order Line Items
The way EAI Siebel Adapter’s Query method works is that, you specify the name of the IO in ‘OutputIntObjectName’ argument and row id of the parent record in ‘PrimaryRowId’ argument. However this way the query method will fetch all the Line Items for that Order.
So here, to restrict the number of Line Items returned (at the child Line Item level) in the EAI Siebel Adapter Query, we can use another input argument of Query method, which is ‘SearchSpec’.
The value for the ‘SearchSpec’ argument is an expression based on any field from the IC’s of the integration Object, with the dot notation. Not all of us would know that we can use it to restrict the number of child records returned.
Sample Expression: [Order Entry - Line Items.Source] = ‘Testing’
This expression means only the line itemitems where the field ‘Source’ of ‘Order Entry – Line Items’ BC has value ‘Testing’, will be retrieved in the output Siebel Message.
Just creating the expression for the ‘SearchSpec’ argument is a trick here.
In our requirement the user can select multiple line items, say out of 14 line items he has selected only 5 and clicks on ‘Sync Selected’ button. Now we have to create an expression based on selected line items and then pass it as a process property to the workflow where we are using the Siebel Adapter. The sample script for creating expression is pasted below:-
(Note: Here the variable SearchSp is an expression string which will be passed as an input to the workflow)
RecExists = this.BusComp().FirstSelected();
while (RecExists)
{
rec[i] = this.BusComp().GetFieldValue(“Id”);
RecExists = this.BusComp().NextSelected();
i++;
}
SearchSp = “[Order Entry - Line Items.Id]=’” + selrec[0] + “‘”;
for(x = 1; x < selrec.length; x++)
{
SearchSp = SearchSp + ” OR ” + “[Order Entry - Line Items.Id]=’” + selrec[x] + “‘”;
}
That’s it! We hope this helps somebody someday.
Nicely explained…
Keep it up…