Contents
Tutorial: Supply Chain
In This Section
Lesson 1: Set Up the BizTalk RFID Environment
In This Section
Step 1: Install BizTalk RFID
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Step 2: Run the Tutorial Setup Scripts
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Step 3: Start the ContosoTestProcess Process
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Lesson 2: Receive Parts into Inventory
In This Section
See Also
Step 1: Query Parts Before Receive
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Step 2: Receive Parts
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Step 3: Query Parts After Receive
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Step 4: Assign Received Parts into Inventory
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Lesson 3: Create Assemblies from Parts
In This Section
See Also
Step 1: Query Assembled Parts Before Assembly
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Step 2: Create a New Tag for the Assembly
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Step 3: Verify the Assembly Tag
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Step 4: Assign Inventory Parts to Assembly
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Step 5: Query Assembled Parts After Assembly
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Lesson 4: Decommission a Tag That Fails Quality Assurance
In This Section
See Also
Step 1: Verify That the Tag Exists
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Step 2: Decommission the Tag
Prerequisites
Procedures
What did I just do?
Next Steps
See Also
Step 3: Verify the Decommissioned Tag
Prerequisites
Procedures
What did I just do?
See Also
Copyright
Tutorial: Supply Chain
Microsoft®BizTalk® RFID can be used to scan and read RFID tags at all steps in an organization's supply chain. RFID tags can be used for item-level tagging, subassemblies, assemblies, cartons, pallets, and more.
The supply chain tutorial walks you through a supply chain scenario that is likely to be used in a manufacturing organization. The scenario presented in this tutorial assumes that a manufacturer receives parts from a supplier and combines them into assemblies. Each part from the supplier has an item-level RFID tag on it to enable tracking of individual items. An RFID tag is generated for each assembly and the parts received into inventory are assigned to those assemblies.
The supply chain scenario in this tutorial is not intended to be a complete end-to-end scenario, but rather one that illustrates the concepts of how BizTalk RFID can be used. Many of the concepts that you will learn in this tutorial will be repeated in other areas of a real-world supply chain scenario. For example, the concept of assigning parts to an assembly and generating an RFID tag for that assembly can be used to pack and ship the assemblies. For brevity, the pack-and-ship part of the supply chain is not discussed in this tutorial.
The lessons in this tutorial use predefined scripts that are specifically designed to support this tutorial. Some lessons also use the Contoso device simulator that comes with BizTalk RFID to ensure that specific hardware is not needed to run this tutorial. For more information about using the Contoso device simulator, see Testing a Server Application.
The premise of this tutorial is that the rfidclientconsole.exe command-line utility is used to add RFID events to the process pipeline of a process named ContosoTestProcess. You will use the rfidclientconsole utility to post three tag-read events for three parts that are going to be used in an assembly. The ContosoTestProcess process uses the SQL Server sink event handler to store RFID events in the RFIDsink database..
After parts are received into inventory, they are constructed into an assembly. This tutorial also generates an RFID tag that is assigned to the new assembly. Because the RFIDsink database is not meant to be a permanent data store, tag data is inserted into a SupplyChain database, which is created as part of this tutorial.
The following script and configuration files are provided as part of this tutorial and can be downloaded from
Script or configuration file name / PurposeTutorial1_Lesson1_Step2_CreateSupplyChainDB.sql / SQL script that creates a new database named SupplyChain and creates tables to support the examples shown in this tutorial.
Tutorial1_Lesson1_Step2_CreateFunctions.sql / SQL script that creates a user-defined function named udf_ConvertBase64ToASCII in the SupplyChain database. This function is used to convert a Base64-encoded string to an ASCII string. Base64-encoded strings are used in the BizTalk RFID XML tag files, but are not human-readable. The ASCII string is human-readable.
Tutorial1_DataReset.sql / Deletes all data in the SupplyChain database to enable you to run through tutorial steps multiple times.
ContosoSimulatorConfig.xml / Configuration file used to run the Contoso device simulator.
Tutorial1_Lesson2_Step1.sql / SQL script that selects the count of parts records read in the RFIDsink database.
Tutorial1_Lesson2_Step2.cmd / Script to run the rfidclientconsole.exe command-line tool that reads RFID tags from XML files, and posts the tags to the ContosoTestProcess process.
PartsTag1.xml / Parts tag with a TagID value of 1001, used in Lesson 2, Step 2
PartsTag2.xml / Parts tag with a TagID value of 1002, used in Lesson 2, Step 2
PartsTag3.xml / Parts tag with a TagID value of 1003, used in Lesson 2, Step 2
Tutorial1_Lesson2_Step3.sql / SQL script that reads the parts record data in the RFIDsink database.
Tutorial1_Lesson2_Step4.sql / SQL script that inserts parts data from the RFIDsink database into the SupplyChain database.
Tutorial1_Lesson3_Step1.sql / SQL script that selects the count of assemblies in the SupplyChain database.
Tutorial1_Lesson3_Step2.cmd / Script to run the rfidclientconsole.exe command-line tool that uses the Contoso device simulator to print RFID tags used to create new assemblies from XML files.
AssemblyTag.xml / Assembly tag with a TagID value of 2001, used in Lesson 3, Step 2
Tutorial1_Lesson3_Step3.sql / SQL script that selects serialized data from the GenericEvents table in the RFIDsink database.
Tutorial1_Lesson3_Step4.sql / SQL script that selects serialized data from the GenericEvents table in the RFIDsink database and joins it with parts data. The resulting data is stored in the SupplyChain database.
Tutorial1_Lesson3_Step5.sql / SQL script that selects parts that are assigned to assemblies in the SupplyChain database.
Tutorial1_Lesson4_Step1.cmd / Script to run the rfidclientconsole.exe command-line tool to verify that assembly tag data exists in BizTalk RFID.
TagMetadata.xml / Assembly tag to test for existence in BizTalk RFID, used in Lesson 4, Step 1 and Step 3.
Tutorial1_Lesson4_Step2.cmd / Script to run the rfidclientconsole.exe command-line tool to decommission (or kill) a tag.
AssemblyKillTag.xml / Assembly tag to decommission, used in Lesson 4, Step 2.
Tutorial1_Lesson4_Step3.cmd / Script that verifies assembly tag data was decommissioned in BizTalk RFID.
In This Section
Lesson 1: Set Up the BizTalk RFID Environment
Lesson 2: Receive Parts into Inventory
Lesson 3: Create Assemblies from Parts
Lesson 4: Decommission a Tag That Fails Quality Assurance
Lesson 1: Set Up the BizTalk RFID Environment
In this lesson, you set up the BizTalk RFID environment. This includes installing BizTalk RFID, running setup scripts that support the Supply Chain scenario, and running and testing the device simulator.
In This Section
Step 1: Install BizTalk RFID
Step 2: Run the Tutorial Setup Scripts
Step 3: Start the ContosoTestProcess Process
Step 1: Install BizTalk RFID
Time to complete: 10 minutes
Objective: In this step, you will install BizTalk RFID.
Prerequisites
Note the following requirements before you begin this step:
You must log on as a member of the local Administrators group.
Procedures
To install BizTalk RFID
1.Identify a computer that you will use to run the tutorial.2.Install BizTalk RFID according to the instructions found in the BizTalk RFID Installation Guide.
3.Verify that the RFID service is running by opening RFID Manager. If you are able to open RFID Manager and click the server name to view the Service Summary page without errors, you are ready to continue with the tutorial. For more information about RFID Manager, see How to Monitor BizTalk RFID Using RFID Manager [RFID11].
What did I just do?
In this step, you installed BizTalk RFID to prepare for the rest of the lessons in this tutorial.
Next Steps
Run the setup script according to Step 2: Run the Tutorial Setup Scripts
See Also
Lesson 1: Set Up the BizTalk RFID Environment
Step 2: Run the Tutorial Setup Scripts
Step 3: Start the ContosoTestProcess Process
Step 2: Run the Tutorial Setup Scripts
Time to complete: 5 minutes
Objective: In this step, you will set up the Microsoft SQL Server® environment that is used throughout the rest of the lessons in this tutorial.
Prerequisites
Note the following requirements before you begin this step:
SQL Server Management Studio must be installed.
Procedures
To run the tutorial setup scripts
1.Open SQL Server Management Studio.2.Open a new query window.
3.Open and execute the Tutorial1_Lesson1_Step2_CreateSupplyChainDB.sql file.
This file creates the SupplyChain database that will be used throughout this tutorial. The SupplyChain database includes three tables named Assembly, Parts, and PartsAssembly. It also creates foreign key relationships between the tables. The SupplyChain database is used to store inventory, whereas the RFIDsink database is used to temporarily store tag data as it is read by the SQL Server Sink event handler, but it is not meant to be a permanent data store.
Caution
The SupplyChain database is created in the C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ folder. If you don't want the database created in this folder, you need to edit the Tutorial1_Lesson1_Step2_CreateSupplyChainDB.sql file before executing it.
4.Open and execute the Tutorial1_Lesson1_Step2_CreateFunctions.sql file. This file creates a user-defined function, called udf_ConvertBase64ToASCII. This function converts Base64 strings (as they are stored in the TagID, TagData, and other RFID XML fields) to ASCII strings. This is useful in later steps in the tutorial.
What did I just do?
In this step, you created the SQL Server environment, including the database and all required database objects that are needed to run this tutorial.
Note
If you want to delete all data in the SupplyChain database, but do not want to delete its objects, you can execute the Tutorial1_DataReset.sql file.
Next Steps
Test the Contoso device simulator in Step 3: Start the ContosoTestProcess Process.
See Also
Lesson 1: Set Up the BizTalk RFID Environment
Step 1: Install BizTalk RFID
Step 3: Start the ContosoTestProcess Process
Step 3: Start the ContosoTestProcess Process
Time to complete: 5 minutes
Objective: In this step, you will run the ContosoTestProcess process and the Contoso device simulator, which will be used in later lessons in this tutorial.
Prerequisites
Note the following requirements before you begin this step:
BizTalk RFID must be installed and running.
Procedures
To run the Contoso device simulator
1.Navigate to the %rfidinstalldir%\Samples\Device Service Provider\Contoso\ContosoEndToEnd folder.2.Execute the Contososetup.cmd file. The commands in this file perform the following operations:
a.Registers and starts the ContosoDeviceProvider device provider.
b.Imports a device named ContosoTestDevice.
c.Imports a process named ContosoTestProcess, which has logical device mylogicaldevice, and a SqlServerSink event handler.
d.Deploys and starts the ContosoTestProcess process.
3.Execute the runContososimulator.cmd file that is part of this tutorial. This opens a command window and runs the Contoso device simulator, but differs slightly from the same command file that exists in the %rfidinstalldir%\Samples\Device Service Provider\Contoso\ContosoEndToEnd\ContosoDeviceSimulator folder. The file that is part of this tutorial does not show unnecessary notifications that are not part of this tutorial. However, because of this modification, you may see an error that indicates "Notification XML not specified." This message can be ignored for this tutorial.
4.Verify that no other errors are displayed in the command window and that the device simulator is ready to receive tags. You should see the following in the command window:
1|Device Simulator web service started successfully
4|Accepting new Reader Client at 0.0.0.0:6666
5.If the device simulator is not started or if any other errors appear, make sure that you correct these errors before continuing. For additional information about running the Contoso device simulator, see Testing a Server Application.
What did I just do?
In this step, you started the ContosoTestProcess process and the Contoso device simulator. This simulator is not used until Lesson 3: Create Assemblies from Parts, Step 2: Create a New Tag for the Assembly, but is included here as part of the setup for the tutorial.
Next Steps
Receive parts into inventory to make them into assemblies in Lesson 2: Receive Parts into Inventory.
See Also
Lesson 1: Set Up the BizTalk RFID Environment
Step 1: Install BizTalk RFID
Step 2: Run the Tutorial Setup Scripts
Lesson 2: Receive Parts into Inventory
In Lesson 1: Set Up the BizTalk RFID Environment, you completed the setup of the BizTalk RFID environment. In this lesson, you will learn how to use the BizTalk RFID event processing pipeline to receive three parts that are individually tagged with item-level RFID tags. The data for these tags is stored in three separate XML files, one for each item. The tag data stored in each RFID tag is the Universal Product Code (UPC) number that uniquely identifies a manufacturer's product.
The ContosoTestProcess process uses the RFID sink event handler to store the tag data read by BizTalk RFID. The data is stored in the RFIDsink database in the TagEvents table. This lesson shows how to use SQL to move the parts into inventory by inserting them into the SupplyChain database, which was created as part of Lesson 1: Set Up the BizTalk RFID Environment, Step 2: Run the Tutorial Setup Scripts.
In This Section
Step 1: Query Parts Before Receive
Step 2: Receive Parts
Step 3: Query Parts After Receive
Step 4: Assign Received Parts into Inventory
See Also
Lesson 1: Set Up the BizTalk RFID Environment
Step 1: Query Parts Before Receive
Time to complete: 10 minutes
Objective: In this step, you will query the RFIDsink database to ensure that it contains no parts data previously read by the ContosoTestProcess process. This ensures a clean database with which to run the rest of this tutorial.
Prerequisites
Note the following requirements before you begin this step:
The ContosoTestProcess process must be running without errors.
SQL Server Management Studio must be installed and connected to the RFIDsink database on the BizTalk RFID computer.
Procedures
To query for parts in the RFIDsink database
1.Open SQL Server Management Studio.2.Open a new query window.
3.Execute the following query (which can be found in the Tutorial1_Lesson2_Step1.sql file):
SELECT COUNT(*)
FROM TagEvents
WHERE TagSource = 'Antenna3'
AND LEN(CONVERT(VARCHAR, CONVERT(VARBINARY, TagData))) = 12
4.Verify that the count of records returned from this query is zero. If you have already completed this tutorial and there are parts in the database, you can clear the RFIDsink and SupplyChain databases by running the Tutorial1_DataReset.sql SQL script.
What did I just do?
In this step, you verified that the RFIDsink database contains no parts data that was read by the ContosoTestProcess process before receiving parts into inventory. You did this by selecting a count of the number of records that are read by Antenna3 and have a 12-character UPC in the TagData field.
Next Steps
Receive parts into inventory to by following the steps mentioned in the next step: Step 2: Receive Parts
See Also
Lesson 2: Receive Parts into Inventory
Step 2: Receive Parts
Step 3: Query Parts After Receive
Step 4: Assign Received Parts into Inventory
Step 2: Receive Parts
Time to complete: 10 minutes
Objective: In this step, you will execute a script in a command prompt that simulates reading three RFID tags. These tags are located on parts that your company has just received from the loading dock. As they are scanned, they are placed into inventory to be ready to install into assemblies.
Prerequisites
Note the following requirements before you begin this step:
The ContosoTestProcess process must be running without errors.
Procedures
To receive parts by using the Contoso device simulator
1.Navigate to the folder that contains the tutorial script files.2.Use the rfidclientconsole.exe command-line utility to add each RFID tag to the process pipeline. The three tags are simulated in three separate XML files. All XML files are read from a command-line text file named Tutorial1_Lesson2_Step2.cmd, as follows:
set exe="%RFIDINSTALLDIR%\bin\rfidclientconsole.exe"
%exe% -m localhost AddEventToProcessPipeline ContosoTestProcess PartsTag1.xml mylogicaldevice
%exe% -m localhost AddEventToProcessPipeline ContosoTestProcess PartsTag2.xml mylogicaldevice
%exe% -m localhost AddEventToProcessPipeline ContosoTestProcess PartsTag3.xml mylogicaldevice
echo "TagReadParts"
pause
3.Verify that there are no errors in executing the Tutorial1_Lesson2_Step2.cmd file.
What did I just do?