About the Script Adapter

The Script adapter is useful when you need to apply a complex operation to the parameters in your simulation process that cannot be defined by the Calculator adapter. It is used to manipulate parameters in ways that the Calculator adapter cannot handle. You can use the Script adapter to create Jython or DynamicJava scripts.

See Also
Creating Scripts
About Parameters Within Scripts

You can use the Script adapter to create new parameters. In addition, you can use the following in your scripts:

  • Parameters that are mode “output” in the adapters that appear before the Script adapter in the process diagram.

  • Parameters that are mode “input” in the adapters that appear after the Script adapter in the process diagram.

  • Parameters from the parent (top level) adapter.

The following parameter types are used by the Script adapter:

Input Provides a value to the adapter, either a default value or a value mapped from some other adapter.
Output Captures information from the adapter for subsequent use via mapping or viewing.
In/Out Serves both functions at the same time and has two values when the job runs. One value is created before each run of the adapter, and the other value is created after each run of the adapter.
Neutral Used inside of an adapter or as an output result from an adapter that should not be exposed to other adapters in the process diagram.

Your scripts are run when you run the simulation process that contains the Script adapter. When the script is running, it cannot change the parameter type.

You write your script in the upper portion of the editor. The lower portion lists the existing parameters from other adapters in the simulation process along with parameters you have created. The list includes those parameters that can be meaningfully mapped to the Script adapter based on where they are in the simulation process, their mode, and whether there already exists a parameter with the same name in the Script adapter. To make the script easier to read, parameters appear in blue text.