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:

1 comment:

  1. this is an excellent resource indeed, very helpful, thanks a bunch for that.

    one improvement i can suggest would be to get a prefilled hierarchy (say using eai siebel adapter, IO = Sample Contact, Id = 0-1) and then set some prop, get some other prop etc!!

    ReplyDelete