5月3日
Example using CodeList Database(Enumeration) using BizTalk 2004
CodeList Database in BizTalk 2004 specifies an Access database(mdb) that contains code lists.
-
To get started with this example we have to create an Access database and call it CustomerTest.mdb.
-
Then create a new table called XML_TestVersion1 with three new columns Code, Value and Desc. For this example all three columns are Text Data Types. Take a look at Image 1
-
Enter Data as shown in Image 2
Now Open a new BizTalk project call it “Customer”.
-
Once the project is opened click on the project node and select Add > Add New Item.
-
Select Schema from the templates and name it “CustomerData.xsd”.
-
Right click on the root node and rename it as “CustomerInfo”.
-
Right click and add a new Field Attribute or Field Element and name it “CustomerType”.
-
Click on the Schema node and browse to CodeList Database in the properties window. Click on the ellipsis button and select the folder where you saved your CustomerTest.mdb. Take a look at image 3
-
Browse down in the properties window to Standard and enter “XML”
-
In the Standards Version enter “TestVersion1”. This is the name of your table in CustomerTest.mdb “XML_TestVersion1”. Take a look at image 4.
-
Now select CustomerType in Image 5 which is a Field Element but you can also have a Field Attribute.
-
In the Properties window select Derived By – Restriction. (image 5).
-
In the Code List which gets enabled only after you select restriction for the derived by enter “MyEnum” and click on the ellipsis button. Look at Image 5 below.
-
After clicking on the Ellipsis button you get the CodeList window showing the Value and Description. Select All. Take a look at Image 6.
-
Click on OK.
-
Right click on your CustomerData.xsd in the Solution Explorer and select Generate Instance. You can see that CustomerType would have one of your code list values.