Featured Post

Applying Email Validation to a JavaFX TextField Using Binding

This example uses the same controller as in a previous post but adds a use case to support email validation.  A Commons Validator object is ...

Saturday, December 18, 2010

Clear, Map, and Put

 If you're doing mostly RDBMS table-to-table maps using Pervasive Map Designer, you might not have to worry about Event Handlers. That's because Pervasive produces a default behavior for straightforward maps where one input record (minus filters) corresponds to one output record. After you set up the source, target, and field mappings, Pervasive will add a ClearMapPut Action to the AfterEveryRecord Event Handler.

This screenshot shows a single Action for the AfterEveryRecord Event Handler which is a ClearMapPut. Map Designer added this Event Handler after a valid source and target were set up. For every source record (excluding filters), the target buffer is cleared (Clear). The map is applied to the buffer using the source data plus any RIFL expressions (Map). Finally, the buffer is written to the target (PutRecord or "Put").



ClearMapPut is a convenient shorthand for three distinct Actions: Clear, Map, and PutRecord. It's better to use the shorthand in most cases unless you want to deviate from the standard processing. Here's the functionality in longhand. 


While you can do many table to table transfers with a cursory understanding of Actions and Event Handlers, it's crucial to deepen this understanding when working with hierarchical data structures like XML. That's because there is no longer a one-to-one correspondence between an input record and an XML element. Watch a tutorial I put together on XML processing that uses two Event Handlers (BeforeTransformation and AfterEveryRecord).

This post is replicated from http://my.opera.com/walkerca/blog/2010/11/16/clear-map-and-put-4.

No comments:

Post a Comment