Using a Drop File that Stores Label Data in an Array – SENTINEL Instructions

Target Audience: Advanced User
Article #: 9877

Summary

A SENTINEL drop file with variable label data array allows the program to handle unique values automatically. This Instruction Article shows an example of how to develop a SENTINEL Map that can use label data provided in an array type of format.

Preparation

Instructions

Step #1. Start Mapper and Create new Map

Start Mapper and create a new Map file with the sample file as workfile with XML type

Step #2. Define Break Path to Unique Label Data Array

Set Break path (this is where you tell the mapper where the data for the individual labels are located. Double-click on Break, select XML Path and enter ./printlabel/Data/BatchDetail/Labels/IndividualLabel in the XPath query and click OK. Please note that the path is case sensitve. 

If you did not make any error typing in the path, you should see a green(?) dot in front of the first IndividualLabel.

Important Note: Do not skip this part.You will have to redo most of the following steps as this step establishes the starting position and the level of nested XML elements. The remaining elements will use the relative position from this position to define the data elements.

Step #3. Define Printer

Right-Click on Printer and select New zone…

Since we are defining a printer name which is a system variable for CODESOFT and not for the content of the label, we select the name from the dropdown list. In this case, @PRINTER_NAME is what is needed. Select @PRINTER_NAME and click Next 3 times and Done.

If all goes well, you should see a green dot in front of Printer.

Step #4. Define LabelName

Define shared elements LabelName – Follow the same procedure above but select @LABEL_NAME for the Zone name

Step #5. Define Common Label Data Variables

Now we need to define shared data elements that for the label template. These elements are defined in the label template as When Printed In this example, we have these variables defined in two locations OrderInfo and BatchDetail.

OrderInfo

For OrderInfo we assume that all the variables have the exact same spellings as the When Printed variables in the label files. Instead of creating 3 separate zone for each of the variables, we will use polyzone to accomplish this. One polyzone can contain many variables.

  1. Right-Click on OrderInfo and select New polyzone…
  2. For Polyzone, the name is not important, for this example, we shall leave it default as Polyzone no. 1. Click Next 3 times and Done.
  3. You will notice that there are no markings in front of the variables in the OrderInfo. This is because we did not tell the Map file how to interpret the information with in OrderInfo.  To accomplish that, we need to modify the XPath values for Name and Value.
  4. To modify the XPath for Name – Double-Click on the Name
  5. The original value for the XPath query is ../../../*. We need to add OrderInfo/@ in front of the * so that the value becomes ../../../OrderInfo@*. Click OK.
  6. Do the same for Value.
  7. If you did it correctly, the OrderInfo section should look like this.

BatchDetail

Now we need to define the two variables BatchRunID and BatchNumber. In this example, we assume that the label file does not have BatchRunID and BatchNumber defined in the When Printed. Instead, they are named BatchID and BatchNum.

  1. Right-Click on BatchRunID and select New zone…
  2. When prompted for name, enter BatchID and Click Next 3 times and then Done.
  3. Do the same for BatchNumber but enter BatchNum as the name.
  1.  

Step #6. Create Polyzone for Unique Label Data

The remaining item in the input file is IndividualLabel. It is probably the most important part of this exercise. It contains two or more of the IndividualLabel sections and each section has 2 variables. Again, we will have to assume that each of the variables in the IndividualLabel has the corresponding When Printed variables defined in the labels.  If not, you will have to do this one at a time.

  1. We will use Polyzone to do this
  2. Right-click on the first IndividualLabel and select New polyzone…
  3. Again, in this case, the name of the zone is not relevant, we will leave it as default – Polyzone no. 2
  4. Click Next 3 times and then Done.
  5. Like the previous Polyzone, nothing changed on the IndividualLabel section
  6. For this section we need to modify the XPath for both Name and Value to be @* instead of *.
Step #7. Save Map and Test

The map file is now completed. Don’t forget to save it.

To verify the result, click on the Test the map button on the toolbar

You should see the result in a table format

Note that each of the elements that defined by zone has its own column with the name assigned to the zone. For polyzone, all the variables are in the column *.

Additional comments

Tested Using: SENTINEL v2018

If you need further assistance, please contact us.

Author


Was this article helpful?

Related Articles