Configuring the FixedWidth data handler
To configure the FixedWidth data handler, take the following
steps:
- Enter the appropriate values for the attributes of the FixedWidth
child meta-object.
- Create or modify business object definitions so that they support
the data handler.
Each of these steps is described in more detail in the following
sections.
Configuring the FixedWidth child meta-object
To configure a FixedWidth data handler, you must ensure
that its configuration information is provided in the FixedWidth
child meta-object. For the FixedWidth data handler, IBM delivers
the MO_DataHandler_DefaultFixedWidthConfig child meta-object. Each attribute in this meta-object defines
a configuration property for the FixedWidth data handler. Table 56 describes the attributes for this
child meta-object.
Table 56. Child meta-object attributes for the FixedWidth data handler
Meta-object attribute name |
Meaning |
Delivered default value |
ClassName |
Name of the data handler class to load for use
with the MIME type that matches the name of the attribute in the
top-level data-handler meta-object. This attribute has the FixedWidth
child meta-object as its type. |
com.crossworlds.
DataHandlers.
text.fixedwidth |
Alignment |
Adds or removes the PadCharacter attribute. For event processing, pad characters are trimmed.
For request processing, pad characters are added. Possible values
are BOTH, LEFT, and RIGHT. For example, "LEFT" alignment means the value of the business object attributes
moves to the extreme left of the space for that attribute value.
"BOTH" alignment for event notification means that pad characters are
trimmed off both the left and right sides. "RIGHT" alignment for request processing means that the right side
is padded with pad characters. |
BOTH |
BOCountSize |
Specifies the space allocated for the total number
of business objects being processed. |
3 |
BONameSize |
Specifies the space allocated for the name of
the business object. |
50 |
BOVerbSize |
Specifies the space allocated for the verb. |
20 |
CxBlank |
When converting from a business object, the FixedWidth data
handler writes the value configured for the Default Value property
of the CxBlank meta-object attribute to the fixed-width document whenever
it encounters a business object attribute whose value is CxBlank. When converting to a business object, the FixedWidth data
handler assigns the value configured for the Default Value property
of the CxBlank meta-object attribute to the business object attribute's
value whenever it encounters the value of this CxBlank meta-object attribute in the fixed-width document. Business
objects must have at least one primary key that does not contain
the value CxBlank at run time. |
CxBlank value |
CxIgnore |
When converting from a business object, the FixedWidth data
handler writes the value configured for the Default Value property
of the CxIgnore meta-object attribute to the fixed-width document whenever
it encounters a business object attribute whose value is CxIgnore. When converting to a business object, the FixedWidth data
handler assigns the value configured for the Default Value property
of the CxIgnore meta-object attribute to the business object attribute's
value whenever it encounters the value of this CxIgnore meta-object attribute in the fixed-width document. Business
objects must have at least one primary key that does not contain
the value CxIgnore at run time. |
CxIgnore value |
DummyKey |
Key attribute required by the business integration
system. |
1 |
OmitObjectEventId |
Boolean value to determine whether or not to
include ObjectEventId data in business-object-to-string and string-to-business-object
conversions. |
false |
PadCharacter |
Indicates spaces to add or remove for alignment.
You can specify any character as the pad character. |
# |
Truncation |
Sets removal of characters. If true, any attribute value in the business object that is greater
than MaxLength is truncated to MaxLength during request processing. If false, an error is logged and formatting stops. |
false |
ObjectEventId |
Placeholder not used by the data handler but
required by the business integration system. |
none |
The "Delivered default value" column in Table 56 lists the value in the Default Value
property for the corresponding attribute in the delivered business
object. You must examine your environment and set the Default Value
properties of those attributes to the appropriate values for your
system and your FixedWidth documents. You must make sure that at
least the ClassName attribute has a default value.
Note:
Use Business Object Designer Express to
modify business object definitions.
Business objects requirements
The FixedWidth data handler makes assumptions about the
structure of the business objects that it handles. Therefore, when
you create a business object for conversion using the FixedWidth
data handler, follow these rules:
- Make sure that every attribute in the business object definition
has an appropriate MaxLength property value. This ensures that the FixedWidth data handler
can properly process the conversion of data from a business object
to a FixedWidth format and from a FixedWidth format to a business
object.
- Make sure that the ObjectEventId attribute is included in every business object at all levels
of a business object hierarchy. Business Object Designer Express does
this automatically when it saves a business object definition, but
you should confirm that the requirement is met.
Business object structure
There are no requirements regarding the structure of the
business objects for the FixedWidth data handler. The data handler
can process any business object as long as the MaxLength attribute property has a value.
The business objects that the data handler processes can have
any name allowed by the business integration system.
Business object attribute properties
Business object architecture contains various properties
that apply to attributes. Table 57 describes
how the FixedWidth data handler interprets these properties and
describes how to set the properties when modifying a business object.
Table 57. Attribute properties for business objects converted using the FixedWidth data handler
Property name |
Description |
Name |
Each business object attribute must have a unique
name. |
Type |
Each business object attribute must have a type,
such as Integer, String, or the type of a contained child business
object. |
Key |
Not used by the FixedWidth data handler. |
MaxLength |
Determines the width of the field in which the
attribute value is included. |
Foreign Key |
Not used by the FixedWidth data handler. |
Required |
Not used by the FixedWidth data handler. |
Default Value |
Not used by the FixedWidth data handler. |
Cardinality |
Supports cardinality 1 and cardinality n objects. |
Business object application-specific information
The FixedWidth data handler does not require any application-specific
information in business objects or their attributes. The data handler
does, however, check for the existence of the cw_mo_ tag, which a business object might use to indicate any child
meta-object that the connector uses. The data handler ignores any attribute
identified by the cw_mo_ tag in the application-specific information of the business
object. For more information about the cw_mo_ tag, see Implementing conversion from a business object.
Using existing business object definitions
The FixedWidth data handler can convert any business object
to a FixedWidth string as long as the business object delivers data
in a form that complies with the requirements of the data handler.
The single requirement of the FixedWidth data handler is that each
business object attribute have a MaxLength value specified. Existing business objects may need to be
modified to specify an appropriate value for MaxLength.
Although existing business objects that meet this requirement
can be converted by the FixedWidth data handler, a good practice
is to create your own business objects for each type of data to
be processed. If you use a sample business object, or a business
object developed to support the same application in another implementation,
be sure to modify the definition as necessary to include only the
attributes required for the implementation for which you are developing.
Therefore, to convert existing business objects to a form that
closely corresponds to your data, modify the business object to
provide only the data required by the application and the information
required by the data handler. To adapt existing business objects
for use with the FixedWidth data handler, do the following:
- Perform a functional analysis of the target application, and
compare the results to existing business objects to determine the
required fields of a business object definition.
- Use Business Object Designer Express to
add or delete attributes from the business object definition as needed.
