Siebel Tools >  eScript Property Set Printing Tool

eScript Property Set Printing Tool


APPLIES TO:Siebel Tools - Version 8.0 [20405] to 17.0 [IP2017] [Release V8 to V17]

Information in this document applies to any platform.

PURPOSE

During script debugging, for example, when developing a Virtual Business Component, it is useful to be able to print out the contents of a property set. This Technical Note lists eScript code that can be added to a business service to print out the contents of a property set.SCOPEThis document is informational and intended for any user.


DETAILS

When debugging script code, it is useful to write out values to a file, or to examine them in the debugger watch window. The eScript code in this Technical Note will handle multiple level property sets. It is not limited to one or two layers of child property sets; rather, it is recursive and handles any depth of child property sets.

The listing also shows the child depth so you can see at a glance how deep in the hierarchy you are. The indent amount is configurable, so for property sets with several children you can choose a smaller indent. 

The script provided in this Technical Note writes out to a text file, but all the printed output is written through the LogMe() routine so it is easy to redirect it if required.

 For additional information on the methods used in the sample script,

refer to Siebel Siebel Bookshelf version 8.1 > Siebel Object Interfaces Reference > eScript Quick Reference > Property Set Methods for eScript  and Siebel Bookshelf version 8.1 > eScript Language Reference. 

Instructions

 

To add the code to a Business Service, follow these steps: 

Paste the code listed in the eScript Code section below  into the General Declarations section of the business service. Start with the functions and save after each one, so they become new functions below the General Declarations section. 

After the new functions appear, there will be a few lines of script code remaining in the General Declarations Section. You can make the following optional changes: 

Modify the output filename assigned to OutPutFileName if you wish to write to a different file.

Remember that in eScript a backslash must be escaped, so a path name like C:\TEMP\LOGS\output.txt becomes C:\\TEMP\\LOGS\\output.txt. 

Change the indent level. It is two spaces by default.

 Now when you want to print out the values in a property set, simply call it like this: DumpPropSet(MyPropertySet);

 This will trigger a formatted text file which will display as shown in the Sample Output section below: 

eScript Code

// Add to General Declarations section 

// Change this to the file and pathname you want the report to appear in.

var OutPutFileName = 'C:\\PropertySet_Dump.txt'; 

var IndentAmount = 2;

// Indent child prop sets listing this many spaces                   

// to the right for each level down.var PSDepth = 0;

// How deep in the property set tree, what level  

// Add to General Declarations section

 function LogMe(LogThis)

// Writes a line out to a text file. All printed output is routed 

// through this routine, so add HTML or popup writes here to redirect 

// the printed output.  

var MyFile = Clib.fopen(OutPutFileName, 'at'); 

var sTime = Clib.ctime(Clib.time()); 

sTime = sTime.replace('\n',' ');

// Remove trailing Newline. 

Clib.fputs(sTime + ': ' + LogThis + '\n', MyFile); 

Clib.fclose(MyFile);

 

function DumpPropSet(Inputs)

{

// Print out the contents of a property set. 

PSDepth++;

// We have just dived down a level 

var InpValue;

var InpType;

var InpChildCount;

var inprop;

var inpropval;

var inpropcnt;

var BlankLine = ' '; 

// Build a string to indent the Listing. 

var IndentSpaces = '';

// Number of spaces to indent to

for (var SpaceCount = 0; SpaceCount < IndentAmount * PSDepth; SpaceCount++) 

IndentSpaces = IndentSpaces + ' ';

 }

var IndentLevel = ToString(PSDepth);

if (PSDepth < 10) 

{

IndentLevel = '0' + IndentLevel;

// Indent by a number of indents, then level number as nn, then two spaces

 

var Indent = IndentSpaces + IndentLevel + '  '; 

LogMe(BlankLine);

LogMe(BlankLine);

LogMe(Indent + '---- Starting a new property set ----');

LogMe(BlankLine); 

 // Now do main value and type 

InpValue = Inputs.GetValue();

InpType  = Inputs.GetType(); 

InpChildCount = Inputs.GetChildCount();

LogMe(Indent + 'Value is ........ : "' + InpValue + '"');

LogMe(Indent + 'Type is  ........ : "' + InpType + '"');

LogMe(Indent + 'Child count ..... : ' + ToString(InpChildCount)); 

 

// Dump the properties of this property set 

var PropCounter = 0;

inprop = Inputs.GetFirstProperty();

while (inprop != "") 

    PropCounter++; 

    inpropval = Inputs.GetProperty(inprop);  

    LogMe(BlankLine); 

    var PropCountStr = ToString(PropCounter); 

     if (PropCounter < 10)   

        {

              PropCountStr = '0' + PropCountStr;

         }    

         LogMe(Indent + 'Property ' + PropCountStr + '  name : "' + inprop + '"'); 

         LogMe(Indent + 'Property ' + PropCountStr + ' value : "' + inpropval + '"');  

         inprop = Inputs.GetNextProperty(); 

      } 

  // Dump the children of this PropertySet

      if (InpChildCount == 0) 

       { 

            LogMe(BlankLine); 

            LogMe(Indent + '(No children exist below this property set.)');

        }

      else  

      { 

          for (var ChildNumber = 0; ChildNumber < InpChildCount; ChildNumber++)   

           {   

                 LogMe(BlankLine);   

                 LogMe(Indent + 'Child Property Set ' + ToNumber(ChildNumber + 1) + ' of ' +

                 ToNumber(InpChildCount) + ' follows below.');   

                 LogMe(Indent + 'This child is on level ' + ToNumber(PSDepth));    

                // Recursive call for children, grandchildren, etc.   

                 DumpPropSet(Inputs.GetChild(ChildNumber));   

             } 

         } 

            PSDepth--;  // We are about to pop up a level

        }

 

Sample Output

Here is sample output from the property set printing tool. 

 

Wed Jun 16 16:36:47 2018 :   01  ---- Starting a new property set ----

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :   01  Value is ........ : ""

Wed Jun 16 16:36:47 2018 :   01  Type is  ........ : ""

Wed Jun 16 16:36:47 2018 :   01  Child count ..... : 2

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :   01  Property 01  name : "search-string"

Wed Jun 16 16:36:47 2018 :   01  Property 01 value : "([Date] = "06/18/2018" AND [Description] ~LIKE "A test description*" AND [House_ID] ~LIKE "779*")"

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :   01  Property 02  name : "Business Component Name"

Wed Jun 16 16:36:47 2018 :   01  Property 02 value : "Alvin VBC Business Component"

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :   01  Property 03  name : "Business Component Id"

Wed Jun 16 16:36:47 2018 :   01  Property 03 value : "4"

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :   01  Property 04  name : "Parameters"

Wed Jun 16 16:36:47 2018 :   01  Property 04 value : "C:\temp\nrec.cfg"

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :   01  Child Property Set 1 of 2 follows below.

Wed Jun 16 16:36:47 2018 :   01  This child is on level 1

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :     02  ---- Starting a new property set ----

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :     02  Value is ........ : ""

Wed Jun 16 16:36:47 2018 :     02  Type is  ........ : ""

Wed Jun 16 16:36:47 2018 :     02  Child count ..... : 0

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :     02  (No children exist below this property set.)

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :   01  Child Property Set 2 of 2 follows below.

Wed Jun 16 16:36:47 2018 :   01  This child is on level 1

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :     02  ---- Starting a new property set ----

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :     02  Value is ........ : ""

Wed Jun 16 16:36:47 2018 :     02  Type is  ........ : "search-spec"

Wed Jun 16 16:36:47 2018 :     02  Child count ..... : 1

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :     02  Child Property Set 1 of 1 follows below.

Wed Jun 16 16:36:47 2018 :     02  This child is on level 2

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :       03  ---- Starting a new property set ----

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :       03  Value is ........ : "AND"

Wed Jun 16 16:36:47 2018 :       03  Type is  ........ : "node"

Wed Jun 16 16:36:47 2018 :       03  Child count ..... : 2

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :       03  Property 01  name : "node-type"

Wed Jun 16 16:36:47 2018 :       03  Property 01 value : "Binary Operator"

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:47 2018 :       03  Child Property Set 1 of 2 follows below.

Wed Jun 16 16:36:47 2018 :       03  This child is on level 3

Wed Jun 16 16:36:47 2018 : 

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :         04  ---- Starting a new property set ----

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :         04  Value is ........ : "AND"

Wed Jun 16 16:36:48 2018 :         04  Type is  ........ : "node"

Wed Jun 16 16:36:48 2018 :         04  Child count ..... : 2

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :         04  Property 01  name : "node-type"

Wed Jun 16 16:36:48 2018 :         04  Property 01 value : "Binary Operator"

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :         04  Child Property Set 1 of 2 follows below.

Wed Jun 16 16:36:48 2018 :         04  This child is on level 4

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :  

Wed Jun 16 16:36:48 2018 :           05  ---- Starting a new property set ----

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :           05  Value is ........ : "="

Wed Jun 16 16:36:48 2018 :           05  Type is  ........ : "node"

Wed Jun 16 16:36:48 2018 :           05  Child count ..... : 2

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :           05  Property 01  name : "node-type"

Wed Jun 16 16:36:48 2018 :           05  Property 01 value : "Binary Operator"

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :           05  Child Property Set 1 of 2 follows below.

Wed Jun 16 16:36:48 2018 :           05  This child is on level 5

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :             06  ---- Starting a new property set ----

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :             06  Value is ........ : "Date"

Wed Jun 16 16:36:48 2018 :             06  Type is  ........ : "node"

Wed Jun 16 16:36:48 2018 :             06  Child count ..... : 0

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :             06  Property 01  name : "node-type"

Wed Jun 16 16:36:48 2018 :             06  Property 01 value : "Identifier"

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :             06  (No children exist below this property set.)

Wed Jun 16 16:36:48 2018 : 

Wed Jun 16 16:36:48 2018 :           05  Child Property Set 2 of 2 follows below.

Wed Jun 16 16:36:48 2018 :           05  This child is on level 5

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :             06  ---- Starting a new property set ----

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :             06  Value is ........ : "06/18/2018"

Wed Jun 16 16:36:49 2018 :             06  Type is  ........ : "node"

Wed Jun 16 16:36:49 2018 :             06  Child count ..... : 0

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :             06  Property 01  name : "node-type"

Wed Jun 16 16:36:49 2018 :             06  Property 01 value : "Constant"

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :             06  Property 02  name : "value-type"

Wed Jun 16 16:36:49 2018 :             06  Property 02 value : "DATE"

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :             06  (No children exist below this property set.)

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :         04  Child Property Set 2 of 2 follows below.

Wed Jun 16 16:36:49 2018 :         04  This child is on level 4

Wed Jun 16 16:36:49 2018 :  

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :           05  ---- Starting a new property set ----

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :           05  Value is ........ : "LIKE"

Wed Jun 16 16:36:49 2018 :           05  Type is  ........ : "node"

Wed Jun 16 16:36:49 2018 :           05  Child count ..... : 2

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :           05  Property 01  name : "node-type"

Wed Jun 16 16:36:49 2018 :           05  Property 01 value : "Binary Operator"

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :           05  Child Property Set 1 of 2 follows below.

Wed Jun 16 16:36:49 2018 :           05  This child is on level 5

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :             06  ---- Starting a new property set ----

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :             06  Value is ........ : "Description"

Wed Jun 16 16:36:49 2018 :             06  Type is  ........ : "node"

Wed Jun 16 16:36:49 2018 :             06  Child count ..... : 0

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :             06  Property 01  name : "node-type"

Wed Jun 16 16:36:49 2018 :             06  Property 01 value : "Identifier"

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :             06  (No children exist below this property set.)

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :           05  Child Property Set 2 of 2 follows below.

Wed Jun 16 16:36:49 2018 :           05  This child is on level 5

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :             06  ---- Starting a new property set ----

Wed Jun 16 16:36:49 2018 : 

Wed Jun 16 16:36:49 2018 :             06  Value is ........ : "A test description*"

Wed Jun 16 16:36:50 2018 :             06  Type is  ........ : "node"

Wed Jun 16 16:36:50 2018 :             06  Child count ..... : 0

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :             06  Property 01  name : "node-type"

Wed Jun 16 16:36:50 2018 :             06  Property 01 value : "Constant"

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :             06  Property 02  name : "value-type"

Wed Jun 16 16:36:50 2018 :             06  Property 02 value : "TEXT"

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :             06  (No children exist below this property set.)

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :       03  Child Property Set 2 of 2 follows below.

Wed Jun 16 16:36:50 2018 :       03  This child is on level 3

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :         04  ---- Starting a new property set ----

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :         04  Value is ........ : "LIKE"

Wed Jun 16 16:36:50 2018 :         04  Type is  ........ : "node"

Wed Jun 16 16:36:50 2018 :         04  Child count ..... : 2

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :         04  Property 01  name : "node-type"

Wed Jun 16 16:36:50 2018 :         04  Property 01 value : "Binary Operator"

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :         04  Child Property Set 1 of 2 follows below.

Wed Jun 16 16:36:50 2018 :         04  This child is on level 4

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :           05  ---- Starting a new property set ----

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :           05  Value is ........ : "House_ID"

Wed Jun 16 16:36:50 2018 :           05  Type is  ........ : "node"

Wed Jun 16 16:36:50 2018 :           05  Child count ..... : 0

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :           05  Property 01  name : "node-type"

Wed Jun 16 16:36:50 2018 :           05  Property 01 value : "Identifier"

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :           05  (No children exist below this property set.)

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :         04  Child Property Set 2 of 2 follows below.

Wed Jun 16 16:36:50 2018 :         04  This child is on level 4

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :           05  ---- Starting a new property set ----

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :           05  Value is ........ : "779*"

Wed Jun 16 16:36:50 2018 :           05  Type is  ........ : "node"

Wed Jun 16 16:36:50 2018 :           05  Child count ..... : 0

Wed Jun 16 16:36:50 2018 : 

Wed Jun 16 16:36:50 2018 :           05  Property 01  name : "node-type"

Wed Jun 16 16:36:51 2018 :           05  Property 01 value : "Constant"

Wed Jun 16 16:36:51 2018 : 

Wed Jun 16 16:36:51 2018 :           05  Property 02  name : "value-type"

Wed Jun 16 16:36:51 2018 :           05  Property 02 value : "TEXT"

Wed Jun 16 16:36:51 2018 : 

Wed Jun 16 16:36:51 2018 :           05  (No children exist below this property set.)