This example will be using the output step Send Email (SMTP) to demonstrate the use of internal memory. However, any output tool can be used as the memory feature is available to all of them.
Overview
Memory is used to store specific data generated by a task, it is generally used for auditing purposes and holding historic data. It can be setup in a way that causes a task to only produce results when certain conditions have been met by utilising the stored data.
Internal memory stores the rows produced by a database query recordset. This data is stored locally inside of TaskCentre at a location called a repository. The repository is used as reference data for future task runs.
A Filter Data step is used to compare the results of a new recordset to ones already held by the repository. Processing options are applied and any new data is filtered and passed along to the output step to be processed.
Example: An ordering system is in place which sends an acknowledgement email to a customer when a new order is received. To prevent the customer from receiving the same email again it is logged to memory that it has already been sent. Only new orders will now be acknowledged.
- This process is working by comparing rows returned from a database query, TaskCentre references its memory and depending on the processing option selected will pass new information or none at all. If the same rows are produced again for example, then they will not be processed.
Where Memory Is Used
The memory feature is available for use by the following steps:
- Save File
- Send Email (SMTP)
- Transfer File (FTP)
- Send SMS
- Send Fax
- Call COM Object
- Run External Program
- Print Document
- Run VBScript
- Create Workflow Job
Adding a memory definition to the output step
From within the Main tab of the Send Email (SMTP) tool, memory is added to the task by using the Memory button.
This will display the Memory Definitions dialog where memory definitions are created and maintained. A memory definition refers to the type of memory in use by the task, once created it will be listed within this box.
Select theAdd button and from the list select Internal Memory.
Configuring Internal Memory
It is at this point where the properties of Internal Memory can be configured and arepository used to store task generated datais created.
The task browser is used to drag & drop columns of the recordset into the Items to Memorise table. It is the data within these columns which will be stored in the repositoryand later used as a comparison against a recordset from another task run. A Key column is assigned so that the individual rows of a recordset can be identified correctly. Lastly, options are selected which define how the data is stored.
Name – A unique name for the memory definition can be entered.
Repository Name – Displays the name of the repository to be held within TaskCentre. By default the name given is the location and name of the task but this may be edited as required or another repository selected.
Items to memorise (table)– Displays a list of columns to be memorised from a database query recordset. The columns are dragged here from the Task Browser into the Value column.
When a column is dragged across a tick is automatically placed in the Stored box meaning the data of that column will be stored in the repository. The Key and Display boxes will be blank.
Key – At least one key column needs to be selected, this needs to be a column which achieves uniqueness over the entire row set. This allows the storage of all rows in a recordset where the key column is different per row.
Display – When ticked the column data for a row set will be displayed when a repository is viewed.
Do not memorise (option) – No data is memorised and nothing is stored to the repository.
Memorise information for each row processed (option) – Every row of the recordset will be stored in the repository each time the task is run.
Memorise information for each row processed based on a rule (option)– A rule can be created to specify how the data is memorised, existing rules can also be edited.
Memorise one-off summary information (option)– A summary of the data processed is memorised.
Use Transactions – Ticking this box allows the following 3 options to become available:
Commit Repository Rows on Success –Stores rows that were successfully processed based on the memory options selected
Commit Repository Rows on Failure -Stores rows that failed to be processed based on the memory options selected
Commit Repository Rows based on a rule – Copies rows based on a rule into the selected repository.
Viewing the Repository
To view the repository, click on the Repositories node within the TaskCentre system tree which will display a list. Double-click the repository associated with the task to open and view the data being stored.
This completes the Internal Memory configuration.
A Filter Data step can now be created to utilise the repository data for comparison against the recordset of a new task run. This allows for new data not already in the repository to be processed by the task.
Click the following link to learn about creating a Filter Data step:
To read about tasks which make use of Internal Memory see:
Tasks which write key data to a repository – Internal memory