With EAI first word that comes to mind is integration. But domain of EAI is not limited to just integration with external application. It can help us in configuration also when used properly. The most common used EAI business Service is EAI Siebel Adapter which is used at lot of places. Recently it helped me to improve performance of code by 50%. Here is how?

Requirement:

For Document Generation over 190 fields fetched from over 10 different BC’s were to be set on Service Agreement BC.
This was being done through business service which used to query all the BC’s and store values in global variable and then in the end these global variables were used in function to set the field values of Service Agreement BC.

Problem:

Because of large number of SetFieldValue statements (over 190 :( ) this business service used to take 15-20 seconds to complete.

Solution:

Instead of using SetFieldValue we created a Siebel Message in the form of Property Set and used EAI Siebel Adapters Update method to do the bulk update and improve on performance.

Example code to that is given below:

// The property set that we created

<SiebelMessage IntObjectName = “ServiceAgreementIO” IntObjectFormat =”Hierarchical” MessageType = “Integration Object”>
<ListOfServiceAgreementIO>
<ServiceAgreement Field1=”Value1” Field2=”Value2”>
</ServiceAgreement>
</ListOfServiceAgreementIO>
</SiebelMessage>

The Code to create the above the Property Set is as following

//Create 3 Property Sets
var AgreePS = TheApplication().NewPropertySet();
var ListAgreePS = TheApplication().NewPropertySet();
var AgreeDataPS = TheApplication().NewPropertySet();

//Make this of Type Siebel Message 

AgreePS.SetType(“SiebelMessage”);

//Set Necessary Properties
AgreePS.SetProperty(”MessageType”,”Integration Object”);
AgreePS.SetProperty(”IntObjectName”,”AutoAgreementIO”);
AgreePS.SetProperty(”IntObjectFormat”,”Siebel Hierarchical”);

ListAgreePS.SetType(“ListOfServiceAgreementIO”);
AgreePS.SetProperty(“IntegrationObject”,”ServiceAgreementIO”);

//Add List as Child of Siebel Message
AgreePS.AddChild(ListAgreePS);

//Add data to property set
AgreeDataPS.SetType(“ServiceAgreement”);
AgreeDataPS.SetProperty(“Field1”, golbalvariable1);
AgreeDataPS.SetProperty(“Field1”,golbalvariable2);

//Finally Add Data to List
ListAgreePS.AddChild(AgreeDataPS);

After we have created our complete property set with all the values then we use EAI Siebel Adapter business service to update our BC in one shot, here is the code to do it

var inpSet = TheApplication().NewPropertySet();
var outSet = TheApplication().NewPropertySet();

var svc = TheApplication().GetService(“EAI Siebel Adapter”);
inpSet.AddChild(AgreePS);
inpSet.SetProperty(“PrimaryRowId”,RowId);
svc.InvokeMethod(“Update”,inpSet,outset);

And we are done Instead of taking 20 seconds to complete this code now takes just 10 seconds to complete. EAI Siebel Adapter has come again to our saviour :)

OkAvarageGoodVery GoodExcellent (5 votes, average: 4.8 out of 5)
Loading ... Loading ...