The Script Connector provides the ability to perform functions or operations that are not otherwise available in the built-in connectors of ArcESB.
Script Connectors use the powerful ArcScript scripting language to accomplish a wide range of custom behavior. The Script configured in the connector will be run each time a document is placed into the Send directory for the connector. The input document can be read and modified within the script, or the input document can simply trigger an external function configured in the connector. Script Connectors can also be configured to run on a schedule via Receive automation in the Automation tab.
The following are a few of the many different tasks you can configure a Script Connector to do:
- Replace values in the input document with data returned from custom SQL queries.
- Call a custom Web service to invoke a specialized workflow.
- Run an external script or executable via the sysExecute operation.
After you decide the appropriate task for your Script Connector, you can use the Scripting section to explore how to call various operations using ArcScript.
This section contains all of the configurable connector properties.
Settings related to the core operation of the connector.
- Connector Id The static name of the connector. All connector-specific files are held in a folder by the same name within the Data Directory.
- Connector Description An optional field to provide free-form description of the connector and its role in the flow.
- Script The script to execute. Input and output parameters of the script are listed at the top of each Script Connector within an info tag. These parameters should be referenced but not edited.
Settings related to the automatic processing of files by the connector.
- Send Whether messages arriving at the connector will automatically be processed.
- Retry Interval The number of minutes that the connector will wait before retrying a failed script execution.
- Retry Maximum Attempts The number of times that the connector will attempt to retry a failed script execution before raising an error.
- Receive Whether the connector should automatically run the script on a configured schedule.
- Execution Interval The unit of measure to use for the receive automation schedule (e.g. Minutes, Hours, Days, etc).
- Minutes The number of minutes to wait before executing. Only applicable when Send Interval is set to Minute.
- Minutes Past the Hour The minutes offset for an hourly schedule. Only applicable when Send Interval is set to Hourly. For example, if this value is set to 5, the automation service will execute the script at 1:05, 2:05, 3:05, etc.
- Time The time within a given day that execution should occur. Only applicable when Send Interval is set to Daily, or Weekly, or Monthly.
- Day The day on which execution should occur. Only applicable when Send Interval is set to Weekly or Monthly.
- Cron Expression An arbitrary string representing a cron expression that determines when execution should occur. Only applicable when Send Interval is set to Advanced.
Settings that determine the folder on disk that files will be processed from, and where they will be placed after processing.
- Input Folder (Send) The connector can process files placed in this folder. If Send Automation is enabled, the connector will automatically poll this location for files to process.
- Output Folder (Receive) After the connector finishes processing a file, the result will be placed in this folder. If the connector is connected to another connector in the flow, files will not remain here and will instead be passed along to the Input/Send folder for the connected connector.
- Processed Folder (Sent) After processing a file, the connector will place a copy of the processed file in this folder if Save to Sent Folder is enabled. This copy of the file will not be passed along to the next connector in the flow.
Settings related to the allocation of resources to the connector.
- Max Workers The maximum number of worker threads that will be consumed from the threadpool to process files on this connector. If set, overrides the default setting from the Profile tab.
- Max Files The maximum number of files that will be processed by the connector each time worker threads are assigned to the connector. If set, overrides the default setting from the Profile tab.
Settings not included in the previous categories.
- Send Filter A glob pattern filter that determines which files in the Send directory should be processed by the connector. Patterns will exclude matching files if the pattern is preceded by a minus sign:
Multiple patterns can be specified, comma-delimited, with later filters taking priority.
- Parent Connector If set to a connector of the same type, this connector will inherit all settings from the Parent Connector unless directly overridden in the existing connector configuration.
- Log Subfolder Scheme By default, logs for transactions processed by the connector will be stored in the Logs subfolder for the connector. For connectors that process many transactions, it may be desirable to further divide the logs based on the datetime they were generated. When this setting is set to Daily, logs generated on the same day will be grouped in a subfolder;; when this setting is set to Weekly, logs generated in the same week will be grouped in a subfolder; and so on.
- Log Messages Whether the log entry for a processed file will include a copy of the file itself.
- Save to Sent Folder Whether files processed by the connector should be copied to the Sent folder for the connector.
Settings for specific use cases.
- Other Settings Allows configuration of hidden connector settings in a semicolon-separated list, like
setting1=value1;setting2=value2. Normal connector use cases and functionality should not require use of these settings.