Business Processes and Rules: Siebel Enterprise Application Integration > Data Mapping Using Scripts >
EAI Data Transformation
The Siebel Data Transformation Functions are a framework for building data transformation maps. Data transformation maps act as import and export filters, preparing data from an external system for entry into Siebel applications and preparing data in Siebel applications for export.
Data transformation maps are created as business services using Siebel eScript. You invoke them as part of an EAI workflow process.
A data transformation map reads data from an input structure and transfers it to an output structure, transforming it along the way. The map developer creates a custom eScript function to do the transformation. The Data Transformation Functions provide a convenient way to read the input data and generate results. They also provide a framework for invoking your map functions, handling errors, and accessing other EAI resources.
Setting Up a Data Transformation Map
You create your data transformation map in Siebel Tools in a business service, then you compile it into an .srf file. You can organize your maps in many different ways. Each business service you create can contain one or more maps. You can, in fact, use several business services to organize a large number of maps into logical groups.
To define a data transformation business service in Siebel Tools
- In Siebel Tools, create a new business service associated with a locked project.
- Choose the CSSEAIDTEScriptService class for the business service.
- Double-click the Business Services Methods folder and add the method Execute.
- Select the Business Service Method Arg folder and add the arguments for the Execute method. For a list of arguments and their description, see DTE Business Service Method Arguments. The arguments to include are:
- An input argument. Select one of SiebelMessage, XMLHierarchy, or MIMEHierarchy as the argument name, based on the type of input.
- An output argument. Required if the output object is a different type than the input argument. Select one of SiebelMessage, XMLHierarchy, or MIMEHierarchy as the argument name.
NOTE: If the input and output types are the same then the same argument entry is used for both.
- InputType(Optional). This is required only when passing the business service input property set to the map function without interpretation. This is done by specifying the InputType as ServiceArguments.
NOTE: Most transform maps use SiebelMessage for both the input and output arguments. This is for mapping one integration object to another. For details, see DTE Business Service Method Arguments.
Once you have created the business service you need to write the Siebel eScript code to perform the data transformation.
To write a script for the DTE business service
- In Siebel Tools, select the business service you want to contain the transformation map.
- Right-click, then choose Edit Server Scripts
- Choose eScripts as the scripting language if you are prompted to select a scripting language.
- In the (declarations) procedure of the (general) object, add the line:
- In the Service_PreInvokeMethod function of the service, change the function to the following:
function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
return EAIExecuteMap (MethodName, Inputs, Outputs);
Your data transformation map is run as a business service invoked from a workflow process. Business service scripts have a standard entry point, Service_PreInvokeMethod. Although the script environment provides you with a boilerplate function by this name, you need to modify it, as described in the preceding steps, to include the call to the EAIExecuteMap function.
- The MethodName must be Execute and is used by Siebel Workflow. The name of your function is the name you supply for the MapName argument to the Execute method.
- Inputs is the input message from workflow containing service arguments—for example, MapName and Output Integration Object Name—and the integration message to be transformed. Outputs is the argument used to return data—for example, Siebel Message. MapName specifies the map function to be executed and must be the name of one of the functions you defined in the business service.
For examples of DTE business services, select the Business Service object in Siebel Tools, and then query for CSSEAIDTEScriptService in the Class field in the Object List Editor.