Everytime the events are posted to the output, you can perform any post process, if need be, using the Post Process script. You can use any standard Java or Groovy code in the post process script.
Variables Available
The following are the variables available to the script
FlowScript (db)
FlowScrip.java
interfaceFlowScript { /** * <p>Call this to get a connection to the output database. Throws exception * if the output type is not a database. If you call multiple times, * then the same connection will be returned.</p> * * @return {@link IOConnection} * @throwsException */IOConnectiongetTargetDBConnection() throwsException; /** * <p>Call this to get a connection to the input database. Throws exception * if the input type is not a database. If you call multiple times, * then the same connection will be returned.</p> * * @return {@link IOConnection} * @throwsException */IOConnectiongetSourceDBConnection() throwsException; /** * <p>Call this to get a new connection to the output database, discarding any * existing connection. Throws exception if the output type is not a database. * If you call multiple times, then the same connection will be returned.</p> * * <p>This is useful when you want to make a Redshift call after an * exception as shown below</p> * * <pre> * Connection con = null; * * try { * * con = db.getTargetDBConnection(); * * Map<Integer, Object> result = SQL.createCall(con, "my_proc(?, ?)") * .bind(1, "bind value 1") * .registerOutParameter(2, Types.VARCHAR2) * .execute(); * * } catch (Exception e) { * * con = db.resetAndGetTargetDBConnection(); * * SQL.createCall(con, "my_handle_error_proc(?)") * .bind(1, e.getMessage()) * .execute(); * * } * </pre> * @return {@link IOConnection} * @throwsException */IOConnectionresetAndGetTargetDBConnection() throwsException; /** * <p>Call this to get a new connection to the input database, discarding any * existing connection. Throws exception if the input type is not a database. * If you call multiple times, then the same connection will be returned.</p> * * <p>This is useful when you want to make a Redshift call after an * exception as shown below</p> * * <pre> * Connection con = null; * * try { * * con = db.getTargetDBConnection(); * * Map<Integer, Object> result = SQL.createCall(con, "my_proc(?, ?)") * .bind(1, "bind value 1") * .registerOutParameter(2, Types.VARCHAR2) * .execute(); * * } catch (Exception e) { * * con = db.resetAndGetTargetDBConnection(); * * SQL.createCall(con, "my_handle_error_proc(?)") * .bind(1, e.getMessage()) * .execute(); * * } * </pre> * @return {@link IOConnection} * @throwsException */IOConnectionresetAndGetSourceDBConnection() throwsException; /** * This is called by FLOW after the script is executed */voidclose(); /** * This is called by FLOW after successful execution of the script to commit * both the input and output connections when used. * * @throwsSQLException */voidcommit() throwsSQLException; /** * This is called by FLOW after unsuccessful execution of the script to * rollback both the input and output connections when used. * * @throwsSQLException */voidrollback() throwsException; /** * Same as logger.debug * @param msg */voiddebug(String msg); /** * Retrieves the value of a given variable * * @param variableName * @return the variable value * @throwsException */Stringenv(String variableName) throwsException;}