Pre/Post Script

This topic describes how to configure the Pre Script or Post Script options to run an internal script or external file before running the Process file. You can configure both the pre-run and post-run settings at the same time. The external file can be a standard executable file, batch file, a VBScript, JavaScript, or Visual Basic file.

To configure pre-run or post-run script options

  1. Open the Process file for which you want to include the pre-run or post-run script, select Edit tab, and then one of the following options:
    • Pre Script: Indicates that the script is run before the Process file run.
    • Post Script: Indicates that the script is run after the Process file run.
  2. Select Pre Script or Post Script. The Pre-Run/Post-Run Process Settings window is displayed. Perform the following steps:
    1. On the Pre-Run iScript tab, select Pre-Run Process or on the Post-Run iScript tab, select Post-Run Process and select one of the following options from the dropdown list:
      • Internal Script: Allows you to enter a script written in VBScript, JavaScript, or VB.Net in the Internal Script editor box. Optionally, select Insert Sample Code to use one of the sample scripts provided.

        Note: For VB.Net, you can also select from the predefined libraries depending on your requirement. For example, select Innowera Easy Workflow Library to download an EShare file or start a workflow using the Download EShare File or Start Workflow functions. This library is not supported when EShare is configured using the EShare Service URL.

      • External File: Allows you to select an external .exe, .bat, .vbs, or .js file that is on your computer. Optionally, right-click in the parameters text box to view the list of predefined parameters that you can use in the selected external file and ensure that you separate each parameter with a comma.
    2. In the Process Settings section, select the following options that determine what must be done when an external file is busy or closed:
      • Wait options:
        • 1-No Wait: Indicates that the Process file does not wait for external file if the file is busy or closed.
        • 2-Wait until terminated: Indicates that the Process will waits until the external file gets terminated.
        • 3-Wait until second: Indicates that the Process file waits for specified seconds.
      • Stop on error: Indicates that the Process file stops if the external file or internal script throws an error.
      • Run with normal Run: Indicates that the external file or internal script runs only when you perform a normal run. This option is displayed only for Transaction, BAPI/RFM, and GUI Scripting Process files.
      • Run with Test Run: Indicates that the external file or internal script runs only when you perform a test run. This option is displayed only for Transaction Process file.
      • Run with Debug: Indicates that the external file or internal script runs only when you perform a debug run. This option is displayed only for Transaction and GUI Scripting Process files.
      • Run with Error Processing: Indicates that the external file or internal script runs only when you perform an error processing run. This option is valid displayed for Transaction and BAPI/RFM Process files.
    3. Select OK. The updates are saved.
  3. To add a third-party library file that can be used in the custom VB.NET script in the Pre-Run iScript, Post-Run iScript, and Custom Process script editor, select Custom Library > Add. The Add Custom Library window is displayed. Perform the following steps
    1. Select Add. The Add Custom Library window is displayed.
    2. In the Library file box, browse to the location on your computer where the library file exists. Process Runner supports only 32-bit library file.
    3. By default, the name of the file selected in the Library file box is displayed in Library name box. Optionally, you can edit the name.
    4. In the Runtime path for library section, select one of the following options:
      • Reference Path: Indicates the path on your computer where the library file exists, which will be used to run the custom script.
      • Environment Variable: Indicates the variable name that you select from the dropdown list . The variable name is associated with the path in which the library file is placed. Select this option to share the Process file with other users, typically run-only users. To use this Process file, the run-only user must create an environment variable in the System Properties > Advanced tab > Environment Variables with the same name displayed here, and configure the path where the custom library file exists, after adding the library file.
    5. Select Pre-Run iScript, Post-Run iScript, and Custom Process depending on where you want to use the library file.
    6. Select OK. The library file with the configured details is displayed in the custom library grid.