Application DesignRetrieve Detailed Device Status (XML)

You can use a business rule to query a device for its status and for information about the device. You can use this data to respond differently to jobs when an error has occurred on the device or when the device is configured in a particular way.

For a reference of reserved keys related to detailed device status, see Reserved Keys.

Important! The detailedDeviceStatus and detailedDeviceInfo business rule components are supported for use only with Avery Dennison, cab, Datamax-O'Neil, Epson, Intermec IPL, Loftware, NOVEXX Solutions, PCL, Printronix, QuickLabel, SATO, Toshiba, and Zebra devices.

Important! Content in a business rule is case sensitive. This includes business rule component names, attributes, and values.

Fail a print job if the resolution of the device is not 300

In this example, the print job is failed if the resolution of the device specified in the job is not 300. To achieve this, device information is retrieved, including the resolution configured on the device. Because the device name is not specified, this business rule is not limited to processing jobs only from a particular device.

<?xml version="1.0" encoding="UTF-8"?>

<businessRules configuratorSupport="false">

   <businessRule>

 

      <!-- Retrieve data about the device. -->

      <detailedDeviceInfo name="BCCTEST" namespace="detailedInfo">

         <triggers>

            <trigger eventTrigger="ENQUEUE" priority="0"/>

         </triggers>

      </detailedDeviceInfo>

 

      <!-- Use data about the device to fail the print job if the resolution is not 300. -->

      <mapOperations name="BCCTEST2" namespace="detailedInfo">

         <triggers>

            <trigger eventTrigger="ENQUEUE" priority="1"/>

         </triggers>

         <executionCondition>

            <equalsIgnoreCase failOnFalseCondition="true">

               <trueLogMessage>RESOLUTION 300</trueLogMessage>

               <falseLogMessage>RESOLUTION NOT 300</falseLogMessage>

               <left type="KEY" valueType="STRING">

                  <value>${/detailedInfo/DDI_RESOLUTION}</value>

               </left>

               <right type="LITERAL" valueType="STRING">

                  <value>300</value>

               </right>

            </equalsIgnoreCase>

         </executionCondition>

         <operations>

         </operations>

      </mapOperations>

 

   </businessRule>

</businessRules>

Fail a print job if the device is paused

In this example, the print job is failed if the device is paused. To achieve this, device status information is retrieved, including whether the device is paused. Because the device name is specified in the business rule, the effect of this business rule is limited to jobs received from that device.

<?xml version="1.0" encoding="UTF-8"?>

<businessRules configuratorSupport="false">

   <businessRule>

 

      <!-- Retrieve data about the specified device. -->

      <detailedDeviceStatus name="BCCTEST" namespace="detailedStatus" deviceName="/Default/ZebraDevice01">

         <triggers>

            <trigger eventTrigger="ENQUEUE" priority="0"/>

         </triggers>

      </detailedDeviceStatus>

 

      <!-- Use data about the device to fail the print job if the device is paused. -->

      <mapOperations name="BCCTEST2" namespace="detailedStatus">

         <triggers>

            <trigger eventTrigger="ENQUEUE" priority="1"/>

         </triggers>

         <executionCondition>

            <equalsIgnoreCase failOnFalseCondition="true">

               <trueLogMessage>NOT PAUSED</trueLogMessage>

               <falseLogMessage>PAUSED</falseLogMessage>

               <left type="KEY" valueType="STRING">

                  <value>${/detailedStatus/DDS_PAUSED}</value>

               </left>

               <right type="LITERAL" valueType="STRING">

                  <value>FALSE</value>

               </right>

            </equalsIgnoreCase>

         </executionCondition>

         <operations>

         </operations>

      </mapOperations>

 

   </businessRule>

</businessRules>