Siebel – EAI Siebel Adapter Search Spec
Hi,
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.
Related posts:
- Siebel – EAI Siebel Adapter – Looping Multiple Records This is a follow-up post on the post, Siebel –...
- Siebel – FINS Industry XML Query Service “Extracting values from a tag deep down in the Hierarchy.”...
- Siebel – Custom Applet Title There is an Applet title on the top of the...
- Siebel – SIA BC Utility Service – Invoke BC Method I had discussed about the vanilla Business Service, “SIA BC...
- Siebel – SIA BC Utility Service – Loop multiple records This is a vanilla business service which provides an extensive...
- Siebel – EnableServiceArgTracing – Logging Messages Hi, We have already discussed at quite a length the...
- Siebel – Looping multiple records – Query and Process In my last post, I discussed as to how we...
Nicely explained…
Keep it up…