Batch Processing Through Constraint Definition

Previous Next

See Also

Instead of rejecting records that need special processing, allow all external data into the database and use a status field for further processing.

Further batch processing is taken care of by constraints or by a separate SQL task.

This technique combines two strategies:

· Import task functionality is transferred to constraints or SQL tasks, turning import tasks into more straightforward bulk import routines.


· Special records are admitted into the database with a special status flag, instead of being rejected into external files.

Advantages of this technique are:

· You can take advantage of the main benefit of USoft's Rules Engine, which is that you can specify rules as actual rules, instead of building procedural programs that are hard to maintain.


· You are encouraged to break the process down into steps that are understandable and manageable by end-users. This is a major advantage during iterative development.


· Errors and failures (or part failures) are translated into data values rather than into error messages. Among other things:
· This allows more sophisticated processing. For instance, data that would normally be discarded can now be put in a request queue.


· This way you avoid error files and their maintenance. You can disable their creation, thereby improving performance.
· If the functionality also applies to online processing, the single point of definition (SPOD) of functionality is safeguarded (an identical engine for online and batch processing).


· Because the import routine is straightforward it will more easily succeed and be faster.

To use status fields for flagging imported data:

1. Add a field to the table the data are to be imported into. Typically this is a one-character field with a limited number of allowed values, e.g. Y/N or some one-letter codes.
2. Define an import task that imports all data and sets the status field to a default code indicating that the record has not yet been processed other than that it has been physically allowed into the database.
3. Write a constraint affecting all records with the default code generated in step 2. If the record is successfully processed, (a) constraint(s) should reset the status code.