Global Variable Initialization¶
Plugins can be executed within activities configured as a source or target in an operation, or called from within scripts. Wherever they are used, it is usually necessary to initialize certain global variable values for use with the plugin.
Determine if Global Variables Are Required¶
Global variables are referred to as data elements within the plugin XML manifest files for Jitterbit-provided plugins.
If a plugin does not have any variables that are required, it is not necessary to set global variables in a script unless there are other optional variable values you want to provide.
Set Global Variables for the Plugin¶
Prior to executing a plugin that is applied to an activity or called from a script, you must initialize any variables that are required by the plugin. This is normally done by creating a script to set these values that is upstream of the plugin in the operation chain. If calling a plugin from a script, you may set the global variable values in the same script or a different script, so long as they are initialized before the plugin is run.
After you have created the script, if the plugin is applied on an activity or is being called from a script in another operation, you can then add an operation action to run the operation that contains the plugin on success of the operation where the global variables are set.
The final workflow setup for this example has an operation to set the variable values for the plugin, and another operation using the activity where the plugin is applied: