Default Data
You can create default data entries within a business rule component. Each default data entry becomes a data map entry that includes a name (key) and a value.
The following is the syntax for specifying default data entries.
Important! Content in a business rule is case sensitive. This includes business rule component names, attributes, and values.
Note: If you create a default data entry, you must specify a name and a value. Do not begin and end the name with an exclamation point (!), because that syntax is used for reserved keys.
About the syntax documentation
Vertical bars indicate that you must choose one of the options shown. Italicized items can be named or specified by you.
<defaultData>
<entry name="Name_of_data_map_entry"
dataType="STRING|INTEGER|BOOLEAN|NUMBER|BINARY|DATE"
mergePolicy="MERGE_ALL|MERGE_NONE|MERGE_FROM_CHILD|MERGE_TO_PARENT"
action="OVERRIDE|NOT_EXISTS|DELETE|APPEND|PREPEND">
<value>Value_of_data_map_entry</value>
</entry>
</defaultData>
Syntax Tips
Additional information is available about the following items.
action
For a business rule component that can return a value, this property determines whether that value remains in the data map when the business rule component finishes running and returns control to its parent business rule component. The default value is OVERRIDE.
Note: The impact of a business rule component returning control to its parent is also affected by mergePolicy.
OVERRIDE
|
When control is returned to the parent, the value produced by the business rule component is retained for the data map entry, replacing any previous value for the data map entry.
|
NOT_EXISTS
|
When control is returned to the parent, the value produced by the business rule component is retained for the data map entry only if a data map entry with that name did not exist prior to the execution of this business rule component. Otherwise, the previous value for the data map entry is reinstated.
|
DELETE
|
When control is returned to the parent, the data map entry is deleted from the data map.
|
APPEND
|
If the data map entry existed before the business rule component was run, then when control is returned to the parent the new value for the data map entry is concatenated onto the end of the old value.
|
PREPEND
|
If the data map entry existed before the business rule component was run, then when control is returned to the parent the new value for the data map entry is concatenated onto the beginning of the old value.
|
dataType or valueType
The type of data that the component returns or to which it refers. The default value is STRING.
Additional details for specific types of components.
- For a parameter, the dataType specifies the data type of the parameter value. For a parameter in a dataService business rule component, the result map for a JDBC data service can be represented as a string.
- For a comparison in a condition, the valueType specifies the data type of a value to be compared.
- A dateTime business rule component always returns a value with a data type of STRING regardless of the dataType specified.
- For an exportData business rule component, only STRING and BINARY are supported for the dataType element.
STRING
|
A text string. Any number or date/time included is treated as text.
|
INTEGER
|
A signed integer value.
|
NUMBER
|
A signed decimal value.
|
BOOLEAN
|
A value of true or false.
|
BINARY
|
An array of bytes.
|
DATE
|
A date/time value stored in one of the following formats:
|
mergePolicy
For a business rule component that returns a value, this property (in conjunction with the mergePolicy of its parent business rule component) determines whether the returned value remains in the data map when the business rule component finishes running and returns control to its parent. The default value is MERGE_ALL.
Note: The impact of a business rule component returning control to its parent is also affected by action.
MERGE_ALL or MERGE_TO_PARENT
|
MERGE_ALL or MERGE_FROM_CHILD
|
When the business rule component is finished running, the data map entry containing the value that it returns remains in the data map.
|
MERGE_ALL or MERGE_TO_PARENT
|
MERGE_NONE or MERGE_TO_PARENT
|
When the business rule component is finished running, the data map entry containing the value that it returns is removed from the data map.
|
MERGE_NONE or MERGE_FROM_CHILD
|
Any
|
When the business rule component is finished running, the data map entry containing the value that it returns is removed from the data map.
|
name
Required for a default data entry. The name is a string used to identify the data map entry.
value
For a default data entry, required. The literal value to be associated with name in the data map.
Tip: A default data value should not include references to other data map entries. If a reference to another data map entry is included, it will not be resolved to the value of that data map entry.
For a comparison, either a literal value to be compared or the name of a data map entry containing a value to be compared.
Tip: In a comparison, whether value is interpreted as a literal value or a data map entry name is determined by the type attribute. The value to be compared is interpreted as the data type specified by valueType.
Tip: For assistance with a business rule that you have created or to have Loftware create business rules for you, contact Loftware's Professional Services Group.