Scripts
Automated post processing & advanced metrics collection
Last updated
Automated post processing & advanced metrics collection
Last updated
You can use Scripts to execute java code or to invoke a stored procedure on your target data lake e.g. Redshift or Snowflake after every flow run. You can setup different script to run based on the status of the flow run.
To obtain the connection to the target data lake instance use db.getTargetDBConnection()
and db.getSourceDBConnection()
to get the connection to the source instance provided you use any relational datasource as the input for the flow.
Script Name
Script Status
Schedule Type
Script written in Java and/or Groovy
View Script Run History
The following are the variables available to the script
When calling a stored procedure on redshift the connection would become stale when an exception occurs. If you want to execute another procedure or SQL from the catch block, use db.resetAndGetTargetDBConnection()
to close the existing stale connection and get a new connection for perform additional calls.
Apart from performing JDBC calls, you can use Unirest to make any REST web-service call from scripts
Variable
Description
flowCode
Flow code
outputEventType
Table name in the target DB
inputEventType
Table/Object name in the source system
inputType
Input Connector Type e.g. Oracle, MySQL
outputType
Output Connector Type e.g. Oracle, MySQL
logger
Log4j logger for debug purpose
db
An instance of FlowScript