Change Print Attributes (XML)
You can use a business rule to perform print attribute substitution, changing values for print attributes such as the device name, job name, Quantity, and Duplicates based on business logic or on an existing request-level attribute. A request-level attribute is a default attribute for a label template in the print request. If the label template does not define an attribute and there is no lookup, then the request attribute is used.
Important! Content in a business rule is case sensitive. This includes business rule component names, attributes, and values.
Tip: If you always want to use the same value for a print attribute when a particular simple process is run, you can specify the value for that print attribute in the field for it in the process. You do not need to use a business rule unless you also want to implement business logic.
The following business rule changes the label quantity (number of times to print a label using the same data) to 2 for a specific shipping label template. This business rule can be run by a simple process.
Note: This business rule requires the existence of a JDBC data service that establishes a connection to a database. In the data service, Is Parameter is selected for the SQL Query. For more information,
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<businessRules configuratorSupport="false">
<businessRule>
<mapOperations name="UPDATEMAP" namespace="Body">
<!-- Triggered by ENQUEUE event. -->
<triggers>
<trigger eventTrigger="ENQUEUE" priority="0"/>
</triggers>
<!—- Check whether the request is for a specific shipping label. -->
<executionCondition>
<equalsIgnoreCase failOnFalseCondition="false">
<trueLogMessage>*** DETECTED SHIPPING LABEL ***</trueLogMessage>
<left type="KEY" valueType="STRING">
<value>${!DOCUMENT_URL!}</value>
</left>
<right type="LITERAL" valueType="STRING">
<value>/Default/Label Templates/Shipping</value>
</right>
</equalsIgnoreCase>
</executionCondition>
<!-- Override the existing label quantity. -->
<operations>
<operation action="OVERRIDE" dataType="INTEGER" literalValue="true" operation="PUT">
<!-- Name (key) for quantity. -->
<targetKey>/!QUANTITY!</targetKey>
<value>2</value>
</operation>
</operations>
</mapOperations>
</businessRule>
</businessRules>