Use the Run VBScript
The Run VBScript tool is used to create a task step that runs a Visual Basic Script using data produced by other steps in the task. function to write your own Visual Basic (VB) functions, for example, to change input date formats from MMDDYY to DDMMYY before being passed to another task step.
Run VBScript functions are available as part of the Data Transformation Layer (DTL
When used as part of a BPA Platform tool, the Data Transformation Layer (DTL) extend the tool's functionality by transforming SML from schema to another. In addition, several transformation functions are available for use with the input data before such data is mapped to the destination schema.) feature.
Drag the Run VBScript function icon from Functions to the Transformation Mappings pane.
Either:
| ► | Double-click the new icon |
| ► | Right-click the new icon and select Edit |
Provide a unique and meaningful Function Name.
Specifying the Inputs for the VBScript
You must create the input parameters used by your VBScript and map these to the relevant input nodes.
Adding New Input Parameters
To add new
Enter a meaningful Name for this parameter. Choose the relevant Data Type — standard XML data types are available.
Use Edit and Remove to manage existing parameters.
Mapping to Input Nodes
From the MappedTo drop-down, select the relevant data node.
Alternative Method
Alternatively, after dragging the function to the Transformation Mappings pane, you can drag the relevant elements and nodes onto the Run VBScript icon. This adds default, numbered parameter names of
Specifying the Outputs for the VBScript
You must create the output parameters used by your VBScript and map these to the relevant output nodes.
Adding New Output Parameters
To add new
Enter a meaningful Name for this parameter. Choose the relevant Data Type — standard XML data types are available.
Use Edit and Remove to manage existing parameters.
Mapping to Output Nodes
From the MappedTo drop-down, select the relevant data node.
Alternative Method
Alternatively, after dragging the function to the Transformation Mappings pane, you can drag the relevant elements and nodes onto the Run VBScript icon. This adds default, numbered parameter names of
Creating the VBScript
Create your VBScript in the box provided. Use Check Syntax to ensure your script is correct.
If required, you can use recordset columns, variables, and step properties from the Task Browser to create dynamic data.
Error Handling in the Run VBScript Function
At task run-time, if
| ► | Output an empty String — An empty string is passed to the mapped output node at task run time, for example, <country></country>. |
| ► | Output no Data — The element isn't included in the output XML. |
| ► | Output Value — Enter a static value in the provided text box; this value is passed to the mapped output at task run-time. |
| ► | Error — The function logs an error to the BPA Platform Event Log. Depending on the parent task step's own error handling options, the task can either continue or fail completely. |
Once configured, the Run VBScript function is added to the Transformation Mappings pane with connectors to the relevant nodes.