Array Object in eScript
An array is a special class of object that holds several values rather than one. The values could range from simple data structures to complex ones. The later is called vectors.
Values stored in an array are refernced by index numbers assigned to that value. Each value in an array is called an element. Array indices can be either numbers or strings. Arrays can be single dimensional or multi-dimensional in nature.
e.g.,
var arrMyArr = new Array(); // Defines an array object
arrMyArr[0] = “Single Dimensional first value”;
arrMyArr[1][2] = “2-Dimensional Array referencing 2nd row and 3rd column”
Operations supported on Array objects in eScript:
1. Array join() Method:
Syntax: arrMyArr.join([separatorString]):- A string of characters to be placed between consecutive elements of the array; if not specified, a comma is used.
2. Array length property:
Syntax: arrMyArr.length :- Returns an integer value which equals the largest index of array, +1.
3. Array pop() Method:
Syntax: arrMyArr.pop() :- Similar to the pop method we have for stacks. It removes the last element from the array and returns it. If the array has no elements left, it returns “undefined”.
4. Array push() Method:
Syntax: arrMyArr.push(“Element”) :- Appends the element(s) passed onto the end. Returns the updated index of the last element.
5. Array reverse() Method:
Syntax: arrMyArr.reverse() :- Reverses the elements in the array so that last element becomes the first element.
6. Array sort() Method:
Syntax: arrMyArr.sort(“Function to compare and decide sort mechanism”)
7. Array splice() Method:
Syntax: arrMyArr.splice(StartIndex, NoOfElements) :- Returns another array of the elements removed from the main array.
EAI Queue for Error Handling
The EAI Queue provides temporary storage for data in transit between Siebel Business applications and external applications and a means by which to monitor the data exchange. This temporary storage of data can facilitate error recovery in the event that the flow of data to or from Siebel is interrupted. Error Handling mechanism can be configured to push and pop messages from the EAI Queue based on an OOB Business Service “EAI XML Queuing Service”.Each entry in the EAI Queue may contain the following information:
■ XML file containing the data object in transit
■ Processing status of data object
■ Reference ID for data object in external application
■ Additional fields to be used for error information and other external application specific
information.
A business service API is also provided to the EAI Queue. This business service contains methods to update information held in the queue and allows other components in the Siebel application, as well as customers, to develop software to use the queue. The business service contains the following methods:
■ AddMessage. Adds an XML data object to the queue.
■ GetMessage. Retrieves an XML data object from the queue.
■ GetStatus. Retrieves processing status of the data object.
■ UpdateStatus. Updates the processing status of the data object.
■ DeleteMessage. Removes an XML data object from the queue.
Steps to Configure an EAI Queue:
1. Navigate to Sitemap –> Integration Administration Screen –> EAI Queue
2. Create a New Record
3. Fill in the name of the EAI Queue e.g., “TEST EAI Retry Queue” without the quotes.
Steps to use / send Error Messages onto EAI Queue:
1. Call OOB “EAI XML Queueing Service” from the Error Handling workflow process to post the error message onto EAI Queue using “AddMessage” method.

2. Pass on the Error XML to the Error Handling workflow which in turn would post it onto the EAI Queue.
3. Error Message logged into the EAI Queue are listed as shown below:

Advantages of this Approach:
1. This uses OOB Siebel functionality without extra license to incorporate Error Handling.
2. Number of Custom Objects required to build for Error Handling decreases, thereby increasing performance, reducing development time, easier to debug.