Save File Tool Introduction
What is the Save File Tool?
The Save File tool saves output from another task step capable of producing some form of document, as one or more files on the local hard drive or network location.
For example, save HTML output from a Format as HTML step as one or more .HTM files to send as an email, or save output from a Format as Text step as a .CSV file for use by another application, such as Microsoft Excel.
Save File Tool Features
- Save single or multiple files to the file system
- Any file type such as
.CSVprovided by step outputs
- Save a columns value from an Input step, such as Database Query (ODBC), into a file
- Static or dynamic paths
- Static or dynamic file names
- Memory features to memorise task data created at run-time
Working with other Tools
The Save File tool can interact directly with the following tools:
Consuming from Other Tools
The Save File tool can consume objects outputted by the following tools:
|Icon||Tool Name||Tool Category|
|Database Query (ODBC)||Input and Data Connectors|
|Database Query (OLEDB)||Input and Data Connectors|
|Import Flat File||Input|
|Import XML Document||Input|
|Retrieve Text Message||Input|
|Convert Recordset to XML||Format|
|Convert XML to Recordset||Format|
|Create Workflow Job||Format|
|Format as Flat File||Format|
|Format as HTML||Format|
|Format as HTML Pro||Format|
|Format as Text||Format|
|Run Crystal Report||Format|
|Run Microsoft Reporting Services||Format|
|Run Microsoft Word (Merge)||Format|
|Web Service Connector||Data Connectors|
|Applications Platform Connector||Data Connectors|
The following objects, outputted by the above tools, can be consumed by the Save File tool:
- Recordset — Tabular data from any BPA Platform tool capable of exposing such data (see above)
- Documents (Any) — Documents of any type
Exposing to Other Tools
As an Output category tool, Save File does not expose any objects that can be directly consumed by another tool. However, it does expose the following objects which can be used in a task step sequence:
- RecordSource — If an Input Recordset has been selected, this contains the columns included in the recordset
- DocumentSource — If a Document Source has been selected, this contains the data in the document as recordset columns
- Memory Definitions — If configured, this is a list of Memory Definitions created for the step and the recordset columns to be memorised for each one
- Step Properties — Standard step properties are available allowing you to use statistical data of the tool
The Save File tool does not require any global configuration before it can be used in a task.
To add a new Save File step to an existing task, you either:
- Click and drag the Save File icon from the Task Browser to the task Design area.
- From the task’s Design tab, right-click on empty space and select Add > Output > Save File
For a detailed description of how to create new tasks, refer to the product help.
About the General Tab
The General tab is used to enter the following details for the step:
- Name — Enter a meaningful name for the step
- Description — If required, enter a description of this step
- Use a Recordset — Enable this parameter if recordset data from a previous task step is required when saving the file
- Input Recordset — Contains all available recordsets from steps previously created in the task
- Read documents from a source — Enable this parameter if document data from a Format task step is required when saving the file
- Document Source — Contains all available documents from Format steps previously created in the task; note that the document format is displayed after the step name
- Read XML documents from a source and save as XML file — Enable this parameter if XML documents are being read and saved
- XML Input Source — Contains all available XML documents from steps previously created in the task
About the Main Tab
Use the Main tab to set the saved filed path and the saved filename.
If this task step consumes a recordset, use Source to specify the saved file’s contents. You can drag-and-drop variables and recordset data from the Task Browser to build the file contents. If consuming a document or XML source, these form the saved file’s contents.
Specify the saved file’s Path. You can use an existing folder or enable Create destination folder if not found to have the Save File step create the folder automatically if it can’t find the one specified. You can drag-and-drop variables and recordset data from the Task Browser build the file path or create a dynamic entry depending on run- time data.
Specify the saved file’s Filename. You can drag-and-drop variables and recordset data from the Task Browser to build the filename or create a dynamic entry depending on run-time data.
The above configuration results in filenames of:
and so on.
By default, all saved files use ANSI encoding. If a different Content Encoding is required, select this from the drop- down.
Use Memory to memorise some or all of the step output for use in other task steps. This is particularly useful when the Save File step is called multiple times — use Memory to compare the document previously processed to the new document currently being processed to avoid duplicates.
About the Options Tab
The Options tab allows you to define how errors in this step are handled at task runtime.
If a destination file already exists, you can chose whether to Never overwrite or Always overwrite.
If an error occurs, you can decide whether the step should Continue processing, or terminate the step immediately (Abort Step).
If the step is aborted, you can choose to Continue processing onto the next step in the task, or terminate the whole task immediately (Abort Task).