dataService Business Rule Component
A Data Service business rule component allows you to retrieve rows of data from a database, spreadsheet, file, or URL that is external to Loftware Enterprise SP. A Data Service can initiate row events to be processed by other business rule components. A Data Service business rule component is similar to a Database data source, a File data source, or an HTTP data source.
Before You Begin: In Data Services
, an administrator must create the data service with which you intend to associate the Data Service business rule component. You can use any type of data service. For more information, see Managing Data Services.
The following is the syntax for a Data Service business rule component.
Important! Content in a business rule is case sensitive. This includes business rule component names, attributes, and values.
Note: For each business rule component, most elements and attributes are optional, but you should specify enough to achieve the functionality that you intend. In most cases, you can omit attributes that are not relevant to your task and default values will be used. You must specify a name and a namespace. Except where otherwise indicated, attributes accept string values.
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.
<dataService name="This_component" namespace="Parent_of_component"
failOnNoRows="true|false"
mergeRowToJobData="true|false"
sticky="true|false" configuratorType="Block_type_ID" alias="Data_reference">
<triggers>
<trigger eventTrigger="ENQUEUE|PRINTJOBDETAIL|LABEL|Custom_Event" priority="integer" propagation="NONE|BEFORE|AFTER"/>
</triggers>
<executionCondition>
</executionCondition>
<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>
<parameters>
<parameter parameterKey="Name_of_parameter"
dataType="STRING|INTEGER|BOOLEAN|NUMBER|BINARY|DATE" resolveValue="true|false">
<parameterValue>Initial_value_of_parameter</parameterValue>
</parameter>
</parameters>
<preProcessingEvents>
<preProcessEvent eventName="Custom_Event" includeSiblings="true|false" />
</preProcessingEvents>
<postProcessingEvents>
<postProcessEvent eventName="Custom_Event" includeSiblings="true|false" />
</postProcessingEvents>
<errorProcessingEvents>
<errorProcessEvent eventName="Custom_Event" includeSiblings="true|false" />
</errorProcessingEvents>
<children>
</children>
<dataServiceUrl>Path</dataServiceUrl>
<stopRowProcessingCondition>
</stopRowProcessingCondition>
<skipCurrentRowCondition>
</skipCurrentRowCondition>
<perRowEvents>
<rowEvent eventName="Event_if_iterating_through_a row" includeSiblings="false|true"/>
</perRowEvents>
</dataService>
Syntax Tips
Additional information is available about the following items.
alias
An alias is a data reference for a business rule component. It is comparable to a in a label template.
configuratorType
For a business rule component that was generated by using the , this attribute is a numeric identifier that usually indicates what type of the business rule component is part of.
If the value of the attribute is 0, then it indicates one of the following about the type of component block:
- None: The business rule component was created by using the XML Editor or a version of Loftware Enterprise SP prior to Loftware Enterprise SP 3.0, and therefore is not part of a component block.
- Block fragment: The business rule component was generated by the Configurator as part of a component block. Refer to the configuratorType of the parent of this business rule component to determine the type of component block.
Tip: This attribute is automatically included in business rule components generated by the Configurator. If you are editing a business rule by using the XML Editor, you do not need to add this attribute, and you can either ignore or delete existing instances of this attribute with no effect on the functionality of the business rule.
0
|
None or block fragment
|
1
|
Conditional
|
2
|
Format Date/Time
|
4
|
Run Data Map Script
|
5
|
Get First Row
|
7
|
Print
|
8
|
Configure Test Data
|
10
|
Run Another Component Set
|
11
|
Conditional List
|
12
|
Run Another Business Rule
|
13
|
Repeat for All Rows
|
16
|
Prepend/Append
|
17
|
Conditional True/False
|
18
|
Update
|
19
|
Fixed Repeat
|
20
|
Log Data
|
23
|
Delete
|
For information about different types of component blocks, see Component Blocks.
failOnNoRows
This optional attribute of a dataService business rule component allows you to control whether a print job detail should fail if the database query returns no data. The default value is false.
false |
If the query returns no data, this does not cause a process error.
|
true |
If the query returns no data, the print job detail fails and a process error is indicated in Status .
|
mergeRowToJobData
Required for a dataService, forLoop, or whileLoop business rule component. Optional for a securityInfo business rule component. This attribute specifies whether a row of data retrieved from a database should be copied into the job data of the data map, or whether it should exist in the data map only as current row data. The default value is false.
Tip: For a securityInfo business rule component, it is typically recommended that you set mergeRowToJobData to true so that the profile, user name, and domain are saved to the data map.
false |
The data retrieved from the database exists in the data map only as current row data that child business rule components can access, but peer business rule components cannot.
|
true |
The data retrieved from the database exists in the data map as current row data that child business rule components can access, but peer business rule components cannot.
The row data is also copied to the job data portion of the data map for this business rule component. Peer and child business rule components can access this job data in the data map.
When the row data is merged into the job data, the mergePolicy used is MERGE_NONE and the action used is OVERRIDE. These are not configurable.
Example
A dataService business rule component named DBQUERY exists in the Body namespace and retrieves a value for PRINTERNAME from a database. If mergeRowToJobData is true, then peers of the dataService business rule component can access the value of PRINTERNAME in the data map by using ${/Body/DBQUERY/PRINTERNAME}.
|
name
Required for a business rule component or a default data entry. The name is a string used to identify the business rule component or, for a default data entry, the data map entry.
For a securityInfo or systemDiagnostics business rule component, the name and namespace indicate the path to the data saved in the data map. Alternatively, for a systemDiagnostics business rule component if the name and the namespace are empty strings, then the diagnostic information is saved to the !DIAGNOSTICS! namespace.
namespace
Required for a business rule component. The namespace is a string used to identify the parent of the business rule component specified by the name attribute. Do not include a leading slash.
For a securityInfo or systemDiagnostics business rule component, the name and namespace indicate the path to the data saved in the data map. Alternatively, for a systemDiagnostics business rule component if the name and the namespace are empty strings, then the diagnostic information is saved to the !DIAGNOSTICS! namespace.
Body
|
The namespace for fields in a label template created in Label Design is Body.
Note: Integrations automatically prefix paths in the print job file with /Body where needed.
|
runtime
|
The namespace for system properties is runtime.
|
Custom Namespace
|
You can create custom namespaces that are named at your discretion. The children of a namespace should always be business rule components, not other namespaces.
|
sticky
If parameters are used in the business rule component, whether the value of each parameter remains fixed throughout the execution of the business rule component. The default value is false.
true
|
The values of parameters in the business rule component remain fixed throughout the execution of the business rule component. If the value is a data ref, the value initially obtained for the data ref is used for the duration of the execution of the business rule component.
|
false
|
The values of parameters in the business rule component can be overridden during the execution of the business rule component. If the value is a data ref and the value of that data ref changes during the execution of the business rule component, then the current value of the data ref is used.
|
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.