Once you determine what the production object needs to do and what objects it requires, you are ready to build the production object.
This example discusses only the objects you need to build and the order in which to build them; it does not give step-by-step instructions on how to build those objects. See Chapter 3, “Building Production Objects.”
Sybase recommends that you build all of the objects that the production object requires from within the Production Object Information window. This allows you to build each set of objects in a logical order that generates each piece of the output transaction.
There are several ways to build the desired output transaction for this example. You could build a rule object to add the header information, then build a quick rule for each field object. This method works when there are a small number of field objects in the transaction. However, most transactions require hundreds of field objects and using the quick rule method produces too many rule objects that are difficult to track and manage. You could also build one rule object with components and filters that produce the entire output transaction. However, to demonstrate multiple rule objects in a production object, the following steps build three rule objects—Rule1, Rule2, and Rule3—to produce the output transaction.
Build the field objects. For the remainder of this example, the pieces of data in the input transaction are referenced by these field object names:
Data |
Field object name |
---|---|
John Smith 114 Center Ave Pacheco ca 94553 123456 789758.15 |
name_fld street_fld city_fld state_fld zip_fld id_fld total_fld |
Build the Rule1 rule object to place the header information, the ID, and the total into the output transaction (HEADER|123456789|758.15***).
Build a component (C1) that adds the literal value “HEADER” to the output transaction.
In C1, build a pre-filter that adds the “|” symbol to the output.
Build another component (C2) to place the contents of the id_fld field object into the output transaction.
In the C2 component, reuse the Pre-Filter that adds the “|” symbol.
Build another component (C3) to place the contents of total_fld into the output transaction.
In component C3, reuse a pre-filter that adds the “***” separator to the output.
Build Rule2 to place the name, street, and city into the output transaction (JOHN SMITH|114 Center Ave|Pacheco).
Build a component (C4) to place the contents of name_fld into the output transaction.
In C4, build a pre-filter that changes the data to uppercase.
In component C4, reuse the pre-filter that adds the “|” symbol.
Build another component (C5) to place the contents of street_fld into the output transaction.
In C5, reuse the pre-filter that adds the “|” symbol.
Build another component (C6) to place the contents of city_fld into the output transaction.
In C6, reuse the pre-filter that adds the “|” symbol.
Build Rule3 to place the state and zip code into the output transaction.
Build a component (C7) to place the contents of state_fld into the output transaction.
In C7, build a pre-filter that uses a table object to change the data from “ca” to “California.”
In C7, reuse the pre-filter that adds the “|” symbol.
Build another component (C8) to place the contents of zip_fld into the output transaction.
The production object now contains all the pieces it needs to generate the desired output transaction from the given input transaction.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |