Working with the DatabaseCache Project

The DatabaseCache project contains a process that shows how to use ActiveMatrix BusinessWorks Plug-in for ActiveSpaces to query and store rows in a table.

The process is designed with the following activities:

Note: You must set Global Variables: DatabaseCache.BaseDir to TIBCO_HOME/bw/plugins/as/bw5pluginas-samples/DatabaseCache/data and DatabaseCache.InputFileName to TIBCO_HOME/bw/plugins/as/bw5pluginas-samples/DatabaseCache/data/input.txt



The following table describes the activities in this process:

Activity Description
FilePoller Reads the input.txt file to monitor if an input ID or the key specified in the table is created or changed. When the activity obtains an ID, it triggers the process.
Get From Space Queries data in the table with the ID specified in the input.txt file.
Get Success Log Writes the data in a row in the output.txt file if the row matches the input ID in the input.txt file. The output.txt file is located in the TIBCO_HOME/bw/plugins/as/bw5pluginas-samples/DatabaseCache/data directory.
Read Database File Reads the database.data file and sends the contents to the output of this activity.
Parse Data Retrieves the input from the output of the Read Database File activity and parses the data of the input based on the data format specified in the General tab.
Error Log Writes an error message in the output.txt file if no row matches the input ID in the database.data file.
Map Data Maps the data values in a row to the elements of the root variable if the row matches the input ID in the input.txt file.

The Root variable is a process variable added to the process definition by this activity and specified in the Input tab. The structure of the root is defined based on the field names specified in the table.

Cache Info Space Stores the output row of the Map Data activity in the table.
Success Log Writes a message that contains a row in the output.txt file when the row matching the input ID is stored successfully.
CacheError Writes an error message in the output.txt file if an error occurs during storing the matched row.
End Ends the process.