Print Document Using an Empty File Integration (Video - 5:01) Follow
Applies to: BarTender 2016
The purpose of this example is to create an integration that prints a specified BarTender document after detecting an empty trigger file. The techniques involved are also applicable to the later examples.
A parts-manufacturing plant needs to print an item with a serialized number at the end of an assembly line. On this item, there is no other dynamic or changing information, other than the incremented barcode. What generates the trigger file is a “Laser Presence Sensor” toward the end of the assembly line that detects parts and generates an empty text file. The text file drops into a specific directory that the Integration Service is monitoring. When the file is detected, the Integration Service deletes the empty file and prints the specified document.
The following procedures describe how to set up, deploy, and verify the integration for the scenario outlined above.
Set up the empty trigger file
- Create the network folder where the empty file will be saved. This is the folder that the Integration Service will monitor. In this example, it will be called
- Create, in some other directory, a blank text file called "part.txt".
Create the BarTender document
- Open BarTender.
- From the File menu, select New to open the New Document Wizard.
- Select Blank Template, and then click Finish to close the New Document Wizard. A new document appears in BarTender.
- From the File menu, select Print to open the Print dialog.
- From the Name dropdown list, select the printer you want to use, and then click Close to close the Print dialog.
- From the File menu, select Page Setup to open the Page Setup dialog and configure your page as needed.
- When you're finished configuring your page, click OK to close the Page Setup dialog.
- From the Create menu, select Barcode.
- From the Select Barcode dialog, select a barcode type and click on it. Click the Select button to close the dialog.
- Click anywhere on the template to add the barcode object.
- Double-click the barcode to open the Barcode Properties dialog.
- In the left Navigation Pane, click the barcode's data source.
- Click the Transforms tab.
- At the right of the Serialization field, click the icon to open the Serialization dialog.
- On the Serialization tab, select Increment.
- Click OK to close the Serialization dialog.
- Click Close to close the Barcode Properties dialog.
- From the File menu, select Save As, and save the BarTender document under the name Serialized.btw.
- Close BarTender.
Create and deploy the integration
- Open BarTender Integration Builder.
- Click Create New Integration to open the New Integration dialog.
- Click File and then click OK.
- In the File Integration pane, select Integration.
- In the Properties pane, enter the Name of your integration as "Each Part".
- From the Start Integration dropdown list, select Automatic.
- Under User Account, select whether you want to inherit permissions from the service.
- Note that by default, actions will inherit the user account specified from the Integration node, so you won’t need to set it again in the Actions node.
- In the File Integration pane, select File Detection.
- In the Properties pane, under Detection Options, select "Computer/Network" from the Location dropdown list.
- For the Folder to Scan option, type the path or browse to the folder that you want the Integration Service to monitor. In this case, specify the \\AssemblyLine\NextPart folder that you created in the Set up the empty trigger file section, above.
- In the File Pattern field, type "*.txt". (Do not include the quotation marks.)
- Scroll down to the Actions After Detection section. From the Action dropdown list, select Delete File. The file is no longer needed after it has been detected.
- In the File Integration pane, click the Print Document action. (This is the default action.)
- In the Properties pane under Document, click the Browse button to browse to and select the BarTender document you created earlier, Serialized.btw. Click Open.
- Click in the top left corner of Integration Builder to save the integration file as NewPart.btin.
- Click Deploy Integration to open the New Deployment dialog.
- Enter a name and description for the deployment.
- Ensure that the Integration File setting lists NewPart.btin. Otherwise, click Browse and browse to and select NewPart.btin.
- For Target Servers, add the server(s) you want to deploy the integration file to.
- For Schedule, select Immediately.
- Specify the desired Error Handling settings.
- Click OK to close the dialog and deploy the integration file.
- Administration Console will open on the Integrations node, displaying your integration.
Run the scenario and view integration processing
- In Administration Console, click the integration name "Each Part" to open a detailed view of the integration.
- As you run the example scenario in the next step, you can observe the processing steps of the integration in the Output section of this view.
- Using Windows Explorer, copy the blank text file part.txt to the folder
- The integration begins almost immediately, deleting the empty text file from the NextPart folder and sending the BarTender document to print. Each time you run the scenario, the barcode on the printed document is incremented by 1.