Defining Prologue/Epilogue Information

Isight allows you to specify scripts that are executed prior to the component running (Prologue) or after the component runs (Epilogue). Furthermore, if you are working with a process component, you can specify commands that are executed prior to (Subflow Prologue) or after (Subflow Epilogue) each execution of the process component’s subflow.

These scripts can be written in either Jython or DynamicJava. Jython is recommended; DynamicJava is provided for backward compatibility with existing scripts. In addition, these scripts have access to the RuntimeEnv object that contains the component’s parameters and properties.

Notes: For general information on Isight scripting, see Scripting in Isight Models. For information on how to manipulate Parameters and other Isight model states in these scripting languages, see Customizing Models in the Isight User’s Guide. Import statements can be entered to gain access to classes and objects known in the execution environment. Core classes and SIMULIA Execution Engine API classes are already imported. Consult with your SIMULIA technical support representative for more information.

  1. To open the Prologue / Epilogue dialog box, select the desired component and click the button on the Component Title Bar.

  2. From the Prologue / Epilogue dialog box, click one of the following tabs, based on the type of script you want to create:

    Option Description
    Prologue Allows you to enter commands that are executed prior to the execution of this component.
    Epilogue Allows you to enter commands that are executed after the execution of this component.
    Subflow Prologue Allows you to enter commands that are executed prior to the execution of this process component’s subflow.
    Subflow Epilogue Allows you to enter commands that are executed after the execution of this process component’s subflow.

  3. Select the desired scripting language (Jython or DynamicJava) from the Language list.

  4. Type your script in the upper portion of the tab.

    The interface provides full undo/redo capability as well as cut/copy/paste functionality. You can right-click the text in the editor to access the functionality or use standard shortcuts, such as Ctrl-C and Ctrl-V.

    Note: Scripts should be written carefully so as to not interfere with the environment used to execute them. For example, scripts cannot contain calls to System.exit() or Runtime.getRuntime().exit(), because these method calls would terminate the supporting Isight Gateway or SIMULIA Execution Engine station.

    Warning: In the current Isight runtime architecture, the values of all subflow parameters at the end of each subflow run are written to the job database before the Subflow Epilogue is run. Since no changes to those parameters by the Subflow Epilogue could ever be seen as execution results, such changes are disallowed in the Subflow Epilogue. Any statement that attempts to make such a change will cause the execution of the Subflow Epilogue to fail.

  5. Do one of the following to include a parameter in your script:

    • Select the parameter from the Parameter list, and click the button (if necessary, click Expand to display the Parameter list).

    • Click to create a new parameter. The Add Parameter dialog box appears, and you define attributes of the parameter, such as its name and type. For information about the different parameter modes that are available, see About the Script Component. For more information about parameters, see Using Parameters in the Isight User’s Guide.

    • Click to create a new parameter as a member of a selected aggregate parameter. An aggregate parameter is a collection of parameters of different types and can contain scalars, arrays, and other aggregate parameters. The  button is available only if an aggregate parameter is selected in the Parameters list.

    • Type the name of the parameter directly in the script. The editor recognizes existing parameters and colors them green. If you type a parameter name in your script that does not match an existing parameter, the Script Component Editor assumes that it is a script variable, and it will not be initialized to anything or stored.

    • Type a portion of a parameter name or a global variable, and press CTRL+SPACE to complete the name. If more than one parameter name matches the portion you type, a menu appears allowing you to select the correct parameter. If you press CTRL+SPACE without typing any letters first, a list of all parameters and global variables appears.

    These referenced parameters are colored green in the script. For more information on other colors used by the Script component, see Understanding Color Coding in Scripts. You cannot edit a parameter name once it has been recognized and colored green; you must delete the parameter reference and insert another one.

    You do not have to define a script variable before you use it provided the first reference is an assignment. Predefined script variables are underlined. The component provides predefined variables that you can use in your script, such as the directory in which the component is executing. The predefined variables are described in Global Variables for Script, Prologue, and Epilogue.

  6. If necessary, alter the Script Type setting in the Parameter list using the menu that appears when you click the corresponding column. The available types are described in About Parameters Within Scripts.

    Note: The Script Type option appears only if you have clicked Expand to view the full parameter list.

  7. Click Check Syntax to verify the syntax of your script.

    Any messages about the script are displayed on the status bar at the bottom of the editor. The messages will not go away until you fix the error and click Check Syntax again.

    • Syntax errors are highlighted in pink. The highlighting is removed when you edit the script.

    • Values assigned to parameters are displayed in the status bar. The status bar attempts to shows all script errors but is limited in the number of characters it can display.

    • Click to open the Script Messages dialog box and get more information on a syntax error or to display errors that do not fit on the status bar.

    Tip: Leave the Script Messages dialog box open at all times when creating your scripts. This dialog box is cleared each time you click Test Script and is populated with messages as they are generated by the component.

  8. Click Close to save your changes and to close the Prologue / Epilogue dialog box.