Friday, August 31, 2012

EAI Dispatch Service


It’s the business Service that invokes the other business services/workflows based on the properties of its input property set.

Scenarios of Dispatch Service
  1. Inbound Request - The EAI Dispatch Service can be the first step of the inbound integration to decide which business service should process an incoming message/document. For example in case of MQ series transport, whenever message is placed in a queue, MQ receiver in Siebel receives the message and dispatches to different workflows/Business services based on defined rules
  2. Outbound Request - Can be last step in outbound integration to send the outgoing message/document to the right transport. For example When sending an Opportunity message from Siebel to external system , message needs to be send to different external teams using different transports(MQSeries , HTTP , MSMQ)  depending on the Opportunity Sales stage (Prospect, Qualifying Lead, Selected) being send.
  3. It can also be used to change the root tags/elements and sending the new messages.

Demo of Outbound Request
  1. Created a simple workflow using EAI Dispatch service to dispatch the message to different workflows based on Opportunity Sales Stage.
  2. Create Rule Set for the Dispatch Service.
·         Go to Sitemap>Administration-Integration>EAI Dispatch Service View.
·         In the Rule Set Applet, create a new rule set with following values:


Dispatch Service Grammar. 

Symbol
Description
/
Defines a level of Hierarchy
@
Indicates the attribute
*
No specific criteria and that everything matches in the input


In above example input provided to dispatch service is shown below:



So to read the value of Sales Stage of an Opportunity we need to go to the 4th level defined below:
  1. PropertySet
  2. SiebelMessage
  3. ListofOpportunity_PRM_ANI
  4. Opportunity ---- Sales_Stage

Expression used to reach to Sales_Stage is /*/SiebelMessage/*/Opportunity@Sales_Stage. 
  • Uses 4 Slashes(/) to reach 4th level.
  • To retrieve the value of Attribute Sales_stage used @ symbol
  • *  specifies no Criteria. In this example 1st level is PropertySet instead of that lets say it was XMLHierarchy then even same expression will have worked.
  • After second slash in expression SiebelMessage is specified , it indicates that at 2nd level xml tag should have type as SiebelMessage which is true in above example. If it would have been say SiebelMessage2 then expression will have failed.
Please refer to Bookshelf for Detailed description of Dispatch Service Grammar. 

I will be writing one more blog for explaining other scenarios as well.

Case Insensitivity & Accent Insensitivity


We can configure Case insensitivity at column level. Let’s assume we have a requirement to query contacts on Last Name irrespective of any case (Upper/Lower).

In Siebel version 8 and above you can configure this by following number of steps:

·               Log in to Siebel Tools.
·               In Object explore Select tables and  query for S_CONTACT table
·               Lock the Project and in columns Query for LAST_NAME Column.
·               In the OBLE Right click the column and click on Case Insensitivity.



·               CIAI wizard appears.
·               Click Next and Finish on the Screen.


·               In table Apply and Activate the changes made.
·               Compile the changes on client srf.
·               CIAI is now enabled.

To test the functionality login to Siebel Application and Navigate to Contact Screen>Contacts View and query for contact in Last Name. It retrieves all the records with same last name irrespective of case.

Suppress Scripting Error Code


Many times we want to suppress the error code appearing at the end of error message to make it more appealing to user.

In order to accomplish same do the following:

  • Navigate to Administration – Application Screen
  • Drill down on System Preferences view link
  • Set “Suppress Scripting Error Code” to TRUE.
Scripting Error Code = FALSE gives following error message


Scripting Error Code = TRUE gives following error message







Thursday, August 30, 2012

Prohibit Creation of new records on child applet


For Example I need to prohibit creation of any activity records for opportunity which has been won.
.
Steps to configure same:

Parent Business Component        : Opportunity
Child Business Component          : Action
Child Applet                                : Activity List Applet

1.      In Siebel Tools navigate to Object explorer in applet query for Activity List Applet

2.      Create new applet user property as below

a.       Name : CanInvokeMethod: NewRecord
b.      Value : [Disable Creation]

3.      Navigate to Business Component and query for ‘Action’ BC.
4.      Create a new Calculated field as specified below:

Name
Calculated
Calculated Value
Force Active
Immediate Post Changes
Disable Creation
Y
IIf(ParentBCName () = "Opportunity",IIf(ParentFieldValue ("Sub-Status") = LookupValue("STATUS", "Won"), "N", "Y"),"Y")

Y
Y


Siebel Configuration Best Practices


  • Always set Force Active and Link Specification to FALSE until and unless field is being used in Workflow or EAI and not exposed on UI. For scripting use ActivateField method.
  • Use fields mapped to index columns only in sort specifications
  • Make sure that Sort order sequence defined on the Business components and  Pre-defined queries are same.
  • Always identify a Primary Id field for MVL and set the Use Primary Join Property to TRUE
  • Use Field user property ‘Required’ for conditional required scenario rather than writing script.
  • Define Upgrade Ancestor property for clone objects which will help in Siebel upgrade.
  • Don’t hardcode values of LOV’s in script and calculated fields. Always prefer to use LookupValue.
  • Create extension table on Base table if data will persist in that column for most of the records else use the available column of extension table.
  • Do not set No Delete , No Insert , No Update Properties at BC Level.
  • Avoid using Sum and Count functions in calculated fields and it fires the secondary sql query and leads to poor performance. 

Wednesday, August 29, 2012

PRM ANI Utility Service

Most of the time if you are appearing for EAI interview this is the favorite question or topic being asked.Lets dig into it to identify what this business service is being used for.

Main purpose of this business service to create new and edit property sets.

Usually we get a requirements where we need to retrieve a value of some attribute from incoming XML message and then perform a operations based on value accordingly, this is very well achieved through the PRM ANI UTILITY SERVICE.

I wont be discussing each and every method of this service. Lets only talk about the frequent used methods
  1. CreateEmptyPropertySet
  2. SetProperty
  3. GetProperty
I will be taking an example to explain these methods. Lets say we need to send an input in the form of Hierarchy to external business service.

I have created a 3 step workflow , starting with creation of hierarchy message , setting up of property in hierarchy and then getting the same property value in workflow process property.

Created an small Integration Object named as Contact External IO with Contact as Parent Integration Component and Account as Child Integration Object.

Step 1

CreateEmptyPropertySet Method is used to create a structure definition. It has only one input argument which is Integration Object Name.In example below I have passed Contact External IO (alias ContactEr) as IO name as Input Argument.

I/P Arguments of CreateEmptyProperty Set Method


O/P Arguments of CreateEmptyProperty Set Method
  • SiebelMessage ---- Output of Step 1
  • HierarchyPath ----- SiebelMessage.ListOfContact_External_IO.Contact
  • Property Name --- FirstName
  • Property Value ---- Gaurav

XML representation of Empty Hierarchy Message:


Step 2

Once the structure of message is retrieved we will be setting property in a message lets say we need to set FirstName.To achieve this we will be using the SetProperty Method. 

I/P arguments for Set property are 

I/P Arguments of Set Property




O/P Arguments of Set Property method


Step 3

We are trying to identify whether the FirstName has been correctly set.
Here we will be using Get Property Method.

I/P arguments for Set property are 
  • SiebelMessage -----Output of Step 2
  • HierarchyPath ---  SiebelMessage.ListOfContact_External_IO.Contact
  • Property Name ----  FirstName
Input Arguments of Get Property Method




Storing the output of Get Property method into workflow Process property.

Output Arguments Of GetpropertyMethod

Problem:

Sometimes you might get an error:

Running Method 'Execute'(SBL_PRM_00104).

This happens because hierarchy path is not retrieved correctly as per Hierarchy Path mentioned in Input Argument of step 3.

Resolution

To Suppress this use hidden input argument  ReturnBlankIfNull.Create a new input argument though it will not be available in the picklist.
ReturnBlankIfNull            Y

Limitation

There is a big limitation to PRM ANI Utility service, It cannot be used in case of multiple records. Lets say you are getting multiple contacts in same xml file , you cannot use PRM ANI Utility Service to retrieve Properties of Contact. It has been beautifully explained in one the blogs on Siebel Mantra. Please refer the link below:

Difference Between EAI Converters - 2


In continuation to my previous blog to understand the IO, Property set and XML mapping, I am sharing one of the examples oracle has provided.

Let’s draw a table to identify the difference between the converters mentioned in previous blog:


Feature
EAI XML Converter
EAI IO To XML   Hierarchy Converter
XML Hierarchy Converter
XML Converter
Input/Internal Representation
Siebel Message (Integration Object Instance)
Siebel Message (Integration Object Instance)
XML Hierarchy
Property Set Hierarchy
Output/External   Representation
XML Document
XML Hierarchy
XML Document
XML Document
Metadata/Rules
Integration Object Definition
Integration Object Definition
Translation Rules
Translation Rules(Optional)

Let’s discuss each one of them in detail:

Figure below explains the simple workflow being used to send the xml message from Siebel to External System.


EAI XML Converter

Converts the output of the EAI Siebel Adapter business service to an XML document or the other way round . It should be used whenever integration object definition is available.EAI XML Converter understands the Siebel Envelope and validates the data against the IO.

Input Message Provided to EAI XML Converter


Output Message of EAI XML Converter


EAI Integration Object to XML Hierarchy Converter.

This business service is used to convert  the Siebel message/IO message to XML Hierarchy message  or from Siebel message to PSHierarchy Message and vice versa.

Input Message Provided to BS


Output Message of  BS method IntObjHierToXMLHier (XML Hierarchy message)



Output Message of  BS method IntObjHierToPSHier (Property Set Hierarchy message)



XML Hierarchy Converter 

This does not use integration object definitions. It expects  input property sets of type  "XMLHierarchy". It can have child property set of type "ProcessingInstructions" to tell the XML Hierarchy Converter what to do along with actual message.

The XML Hierarchy Converter is typically used for conversion from/to XML documents that do not have a relation to integration objects nor the typical Siebel Message envelope.

 Input Message Provided to XML Hierarchy Converter



Output Message of  XML Hierarchy  Converter


XML Converter 

It does not use integration objects nor does it expect/set the type of the input/output property sets. It simply converts an XML document into a property set and vice versa.

Input Message Provided to XML Converter


Output Message of  XML Converter

Tuesday, August 28, 2012

Difference Between EAI Converters


Most of us get confused while using an xml converter which converter to go for.

Let’s see first what options we have.

1) EAI XML converter
2) EAI Integration Object to XML Hierarchy converter
3) XML hierarchy converter
4) Property Set Converter.

I have spoken to lots of EAI developers and interviewed many and never got very convincing or would say practical answer of this.

Before actually jumping on converters let’s talk about different type of messages:

1) Integration Object Hierarchy
2) XML Hierarchy
3) PropertySet Hierarchy

To explain the type of messages I have taken an example of Contact message with address as child of contacts. Let’s see how these messages will appear.

I have created a diagram on paper to explain different messages. Please bear with me for writing :).



So what we understood from diagram is

1) For Integration Object Message we always need an Integration Object Definition (see my previous post for detailed explanation.) And Name of IO will appear in Message as a property of Siebel Envelope.

2) XML Hierarchy Message will always have a XML Hierarchy as parent XML element of actual message. So in second block you will see that message is child of XML hierarchy element.

3) All messages (IO message, Xml Hierarchy Message) are property set Messages as they are child of Property Set Element.

Taking diagram as reference point Let me draw a table to clarify how IC fields , property set and  xml elements/tags and attributes are mapped.

Integration Object
XML Hierarchy
Property Set
Integration Components(Contact and Contact_address)
XML Tag
<Contact>
<Contact_Addresses>
Property Set
Var Contact = TheApplication().NewPropertySet
Var ContactAddresses = TheApplication().NewPropertySet
Integration Component field
Last Name and First Name are fields of contact IC
XML Attributes
<LastName and FirstName are attributes of Contact>
Properties within propertyset.
Contact.SetProperty(“LastName”,””);
Contact.SetProperty(“FirstName”,””);


 Please see my next blog for detailed description of converters.