One fine day I got an assignment of working on Siebel EAI. I had to create an example workflow where I had to

  • Query an Attachment Record using EAI Siebel Adapter.
  • Convert it into MIME Hierarchy using EAI MimePropSet Converter
  • Convert it into MIME Doc using EAI MIME Doc Converter
  • Finally write it to a File using EAI File Transport

There is an example workflow given in EAI 5 PDF starting at page 210 and I followed it step by step and I had my workflow ready and working in less than 20 minutes :)

Then, I was asked to do the same thing with scripting. I said to myself no problems and started with it. Essentially I had to perform the same steps in a Business Service and to my utter dismay I was not able to do that. I took me almost 6 hours to debug what I was doing wrong.

I had written code that was something like

var inpset = TheApplication().NewPropertySet();
var outset = TheApplication().NewPropertySet();
var inpdoc = TheApplication().NewPropertySet();
var outdoc = TheApplication().NewPropertySet();

var querysvc = TheApplication().GetService(”EAI Siebel Adapter”);
var mimesvc = TheApplication().GetService(”EAI MimePropSet Converter”);

inpset.SetProperty(”PrimaryRowId”,’1-9988C’);
inpset.SetProperty(”OutputIntObjectName”,”AttachmentIO”);
querysvc.InvokeMethod(”Query”,inpset,outset);

inpdoc.SetProperty(“SiebelMessage”,outset);

mimesvc.InvokeMethod(”SiebelMessageToMimePropSet”,inpdoc,outdoc);

This above given code was failing and saying that “Input argument should be of type SiebelMessage”. I checked but property set “outset” that came as output EAI Siebel Adapter BS was of type SiebelMessage

Problem:
Look the line in bold in code given above. If you go to Siebel tools then you will see that SiebelMessageToMimePropSet method expects SiebelMessage Input argument to be of Type Hierarchy and we all know Hierarchy in PropertySet is represented by Parent-Child relationship and then it struck me and modified the code as given below

Instead of setting it as a property of inputdoc propertyset

inpdoc.SetProperty(“SiebelMessage”,outset);
mimesvc.InvokeMethod(”SiebelMessageToMimePropSet”,inpdoc,outdoc);

I added it as a child

inpdoc.AddChild(outset);
mimesvc.InvokeMethod(”SiebelMessageToMimePropSet”,inpdoc,outdoc);

And it worked :)

Summary:

In script if an argument of type “Hierarchy” is expected then you should pass a PropertySet as input argument and you must add it as a Child of input PropertySet for that business service. In workflow though you can directly pass the property set to a process property of Type Hierarchy.

Working example:

Here is working code that will explain you the things

// create property sets that will passed in Invoke button method
var inpset = TheApplication().NewPropertySet();
var outset = TheApplication().NewPropertySet();
var inpdoc = TheApplication().NewPropertySet();
var outdoc = TheApplication().NewPropertySet();

var querysvc = TheApplication().GetService(”EAI Siebel Adapter”);
var mimesvc = TheApplication().GetService(”EAI MimePropSet Converter”);

//Query for attachment
inpset.SetProperty(”PrimaryRowId”,’1-9988C’);
inpset.SetProperty(”OutputIntObjectName”,”AttachmentIO”);
querysvc.InvokeMethod(”Query”,inpset,outset);

//outset will contain the SiebelMessage property set
//add it as child of the next business service method
inpdoc.AddChild(outset);

//Invoke method
mimesvc.InvokeMethod(”SiebelMessageToMimePropSet”,inpdoc,outdoc);

 

OkAvarageGoodVery GoodExcellent (No Ratings Yet)
Loading ... Loading ...