Scriptor
Use this component to execute a script in a Microsoft ActiveX scripting language such as PerlScript from ActiveState, or Microsoft Visual Basic Scripting Edition (VBScript).
Intended use: any pipeline, any stage.
Configuration Values
You can determine where the Scriptor component reads the script and the parameters passed to it by setting component properties. Use the following boxes on the Scriptor tab of the Component Properties dialog box to determine this information.
Box | Description |
Scripting Engine | Specifies the scripting language in which the script is written. The a drop-down list contains the scripting engines installed on your system. |
Source | Specifies whether the script is stored internally or externally. The options are:
Internal The script is stored in the pipeline (.pcf) file itself. In the Pipeline Editor, click Edit to display the script for editing. External The script is stored in a file on disk. Enter the path and file name of the script in the Filename box. You can import an external script and convert it to an internal script. For more information, see Configuring a Scriptor Component. |
Config | The parameters passed to the script in the form name=value. |
Values Read
None.
Values Written
None.
Remarks
The Scriptor component calls three procedures in the script, in turn:
The MSCSOpen procedure. The Scriptor component calls this procedure first and passes it the Configuration dictionary. You may omit this procedure.
The MSCSExecute function. This is the main Scriptor component procedure and must appear in the script. The function is passed, in order, to the Configuration dictionary, the Order dictionary (usually an OrderForm object), the Context dictionary, and a flags variable.
The MSCSClose handler. The Scriptor component invokes this procedure after the MSCSExecute procedure returns. It has no arguments and may be omitted.
The MSCSExecute function must return a success code. If you write the script in VBScript, the MSCSExecute routine must be a function, not a subroutine. The MSCSExcute function return values are: 1 for success, 2 for warning, and 3 for failure.
Parameters entered in the Config box of on the Scriptor tab in the ComponentProperties dialog box are passed to the script in the Configuration dictionary. The name is used as the key, and the value on the right of the equal sign is the value assigned to that key.
This is because the MSCSExecute function must return a success value of 1, a warning value of 2, or a failure value of 3. Subroutines cannot return 1.
If you include the Scriptor component in a pipeline using the MtsTxPipeline object, you should not call methods of the ObjectContext object in the MSCSOpen or MSCSClose procedures. Calls to ObjectContext methods may be used only in the MSCSExecute procedure.
The Microsoft Transaction Server (MTS) context is not available to a Scriptor component or to any components called by a Scriptor component. Thus context.SetComplete and context.SetAbort are not available to scripts run by the Scriptor component.