DTE Scripts – Helping Integration.

DTE stands for Data transformation engine. These scripts are usually used during integration. They are alternative to EAI data maps that are available to transform data from one format to another.

I came across DTE Scripts while working on web services

We were getting data in the following format from Siebel.  

<tag property1=”value1″ property2=”value2″ property3=”value3″>

The output that we had to send to the external application was.

<tag method=”property1″>value1</tag>
<tag method=”property2″>value2</tag>
<tag method=”property3″>value3</tag>

This was done by just one small function using DTE scripts. Some of the distinctive characteristics of DTE Scripts are:

  • DTE scripts can only be written in Siebel Tools.
  • The class of DTE Script business service (BS) is CSSEAIDTEScriptService.
  • It can have only one method called Execute.
  • It can contain multiple data maps.
  • It is flexible and powerful way to manipulate siebel messages.

DTE Service has got additional functions (due to CSSEAIDTEScriptService class) to help us process MIME property sets

XML Hierarchy functions

  • XPSGetRootElement() : Returns the root element of XML Hierarchy
  • XPSCreateRootElement() : Add a root element in a XML Hierarchy
  • XPSGetAttribute() : Returns the value of the attribute specified
  • XPSGetChild() : Returns the child xml object specified
  • XPSAddChild(): Add a new child xml object in Hierarchy

MIME Message Functions:

  • GetPartCount(): Returns the number of parts in MIME message
  • GetPart(): Returns the part specified by index
  • GetAttachmentByCID() : Returns the attachment from MIME message
  • Similarly create functions are available to create MIME messages.

Siebel Message functions:

  • GetIntObj() : Returns the instance of Integration object and opens it for reading
  • CreateIntObj(): creates a new integration object instance
  • GetPrimaryIntComp(): Returns the instance of Primary Integration component of Integration object.
  • NewInstance() : Creates a New instance and of IO and makes it active.

Similarly several other methods are available. The above given methods are just to give you an idea how powerful and flexible DTE Scripts can be. More detail on DTE scripts can be found in bookshelf PDF called EAI4.pdf

In next posts about DTE Scripts I will give some practical examples of DTE Scripts and the problems I faced while working on them during a project which involved web services.

7 Responses to DTE Scripts – Helping Integration.

  1. Hi all,
    I have created a sample DTE but I am getting following error message. Please help.

    “Argument Siebel message is not currently initialised or does not return valid data.”

    Here is my work what I have done.

    DTE Business Service

    I have created following arguments for the “Execute” method of my DTE Business Service as per Bookshelf.
    XMLHierarchy,SiebelMessage,OutputType,MapName,MIMEHierarchy,InputType

    //Code of DTE Business Service

    function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
    {

    try{
    if(MethodName==”Execute”)
    DataMapScript(Inputs,Outputs);
    // EAIExecuteMap(Execute, Inputs, Outputs);

    }

    catch (e)
    {
    throw e;
    }
    }

    function DataMapScript (ObjectIn, ObjectOut)
    {

    try
    {

    var inIntObj = ObjectIn.GetIntObj(“Account_Test_Suresh”); //Throwing Exception here.
    while (inIntObj.NextInstance())
    {

    var primaryIntComp = inIntObj.GetPrimaryIntComp(“Account”);

    while (primaryIntComp.NextRecord())
    {

    // var AccntId = primaryIntComp.GetFieldValue (“Id”);
    var HomePage = primaryIntComp.GetFieldValue (“Home Page”);
    var IntId = primaryIntComp.GetFieldValue (“Integration Id”);
    var MPN = primaryIntComp.GetFieldValue (“Main Phone Number”);
    var Name = primaryIntComp.GetFieldValue (“Name”);

    }

    }

    var outIntObj = ObjectOut.CreateIntObj(“Client_Test_Suresh”);
    while (outIntObj.NextInstance())
    {

    var primaryIntComp1 = outIntObj.CreatePrimaryIntComp(“Client”);

    while (primaryIntComp1.NextRecord())
    {

    primaryIntComp1.NewRecord();
    primaryIntComp1.SetSource(primaryIntComp);

    primaryIntComp1.SetFieldValue(“ClientID”,IntId);
    primaryIntComp1.SetFieldValue(“ClientName”,Name);
    primaryIntComp1.SetFieldValue(“Phone”,MPN);
    primaryIntComp.SetFieldValue(“URL”,HomePage);

    }

    }

    }

    catch(e)
    {

    }

    }

    Workflow:

    I have tested the same workflow with same IOs with Data map in Client. Its working fine.

    Input Arguments for DTE Business Service Step in workflow
    input Argument Value
    InputType SiebelMessage
    MapName DataMapScript
    OutputType SiebelMessage
    SiebelMessage Siebel Msg

    Output Arguments for DTE Business Service Step in workflow
    Output Argument Value
    Mapped Siebel Msg SiebelMessage.

    Thanks,

  2. Hi Neel,
    Regarding GetIntObj() Method, bookshelf says
    “An integration object instance is always returned even if the integration object does not exist.”

    Is it true? I am getting error when I use GetIntObj() with IO name which is not there in SRF!!

Leave a Reply

Contribute