# Scripts

To invoke a script during a deployment after schema changes have been loaded, you can define what scripts need to be run in the .jadegit config file (where supported by the deployment format).

Each script to run is defined in a `[[deployment.scripts]]` section in the config file.  This uses the TOML array syntax, allowing multiple scripts to be run (in the order specified).

The scripts are run using or like [jadclient](https://secure.jadeworld.com/JADETech/JADE2020/OnlineDocumentation/#resources/runtimeapps/ch1runninguserapplication/runnonguiclntappwithjadclient.htm), the parameters for which are based on the configuration options below.

During the build process, any entities referred to by the options below are resolved to ensure they're valid.

#### schema / app

These two options correlates directly to the jadclient parameters, which specify the application context under which the script method needs to be run.

#### method

Defines the script method which needs to be executed, which may be the name of a method on the JadeScript class in the current schema context, or it may be a fully/partially qualified name referring to a method on a specific class, possibly in another schema.

This correlates to the executeSchema, executeClass, executeMethod & executeTypeMethod jadclient parameters which are all inferred from the method specified.

#### param

Correlates directly to the executeParam jadclient parameter.  Validation checks this is supplied as required for the method being executed.

**transient**

Correlates directly to the executeTransient jadclient parameter.  Validation checks this isn't supplied for type methods.

### Examples

Running a simple script defined on JadeScript class.

`[[deployment.scripts]]`\
`schema="ExampleSchema"`\
`app="ExampleApp"`\
`method="scriptMethod"`

Running a script on a transient instance of a specific class in another schema.

`[[deployment.scripts]]`\
`schema="ExampleSchema"`\
`app="ExampleApp"`\
`method="AnotherSchema::SpecificClass::scriptMethodWithParam"`\
`param="Hello World"`\
`transient=true`
