Debugging Siebel eScript - Write Property Set to file

This is one of the tricks that i use to debug Siebel scripts. It is really useful if you are working on the product configurator. As most of the events in configurator have property set as argument to it, and there is no debug window to see runtime property values for the events.


For configurator i use WritePropSet method of EAI XML Write to File business service. This method prints out the property set to a file on the siebel server. here is the code for the configurator:

var ps = TheApplication().NewPropertySet();
var ps1 = TheApplication().NewPropertySet();
GetCPInstance(ps);
var bs = TheApplication().GetService("EAI XML Write to File");
var op = TheApplication().NewPropertySet();

ps.SetProperty("FileName" , "C:\\temp.xml");
bs.InvokeMethod("WritePropSet", ps, op);
similarly for business services and workflows we can have following snippet:


function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
var ps = Inputs.Copy();
var bs = TheApplication().GetService("EAI XML Write to File");
var op = TheApplication().NewPropertySet();
ps.SetProperty("FileName" , "C:\\temp.xml");
bs.InvokeMethod("WritePropSet", ps, op);
return (ContinueOperation);
}

Above code can be use as code sniffer. Provided you use some naming sequence of the file.

Other Siebel Blogs

siebel-admin-l @ IT - toolbox

siebel-dev-l @ IT - toolbox