Input and output mappings

Communication with the runtime environment is possible through internal files. The mapping definitions denote the file names; Python reads the input data from the specified input files and writes the output to the specified output files.

Input data mappings can be performed in these ways: Read from a single SCV table or read from SCV using a query. When table is used, all records of the specified table are made available to the script code as a file, with the specified file name. When query is used, the records returned by the specified query are made available to the script code as a file, with the specified file name. Script code writes all the output data to the specified output file; once the script is run, contents of the output file are published to the specified SCV output table. Currently, all records in the output file are inserted into the specified SCV table; it is not possible to delete existing records in the output table or merge the records in the output file into the output table. If required, deletion must be managed prior to script run, in a separate macro (step).

This is a mapping example to pass input data from an SCV table to the script code:
{
            "filename": "SC_CALENDAR.csv",
            "table": "SC_CALENDAR"
        }
All existing records in the SC_CALENDAR table are made available to the script code in the SC_CALENDAR.csv file.
This is a mapping example to pass results of a query to the script code as input:
        {
            "filename": "SC_CALENDAR_PERIOD.csv",
            "query": "SELECT id, calendar_id, period_id, period_start_date, period_end_date FROM SC_CALENDAR_PERIOD"
        }
The records are returned by the query on SC_CALENDAR_PERIOD, and only the selected columns are made available to the script code in the SC_CALENDAR_PERIOD.csv file.
This is a mapping example to write the records generated by the script code to SCV:
        {
            "filename": "SI_CALENDAR.csv",
            "table": "SI_CALENDAR"
        }
The script code writes all the output data in the SI_CALENDAR.csv file. Once the script run is completed, all records in this file are inserted into the SI_CALENDAR table.

Further improvements to input and output mappings are planned in future versions, such as finer control on output behavior to delete existing records in the output table or to merge into output table.