The BizTalk Editor

[Previous] [Next]

The BizTalk Editor allows you to edit BizTalk documents and schemas. Using the BizTalk Editor, you can import existing document definitions, including DTDs, BizTalk schemas, electronic data interchange (EDI) specifications such as American National Standards Institute (ANSI) X12 and electronic data interchange for administration, commerce, and transport (EDIFACT), flat files, well-formed XML, structured document formats, and XML-based templates. You can also create new specifications from blank templates. A specification is a structured document that tells BizTalk Server 2000 how to format data. All specifications are stored as XML. Let's take a look at how the BizTalk Editor works.

If you have installed BizTalk Server 2000, click the Start button, point to Programs, Microsoft BizTalk Server 2000, and then choose BizTalk Editor to open the BizTalk Editor. We will work with the Northwind.biz document we created in Chapter 9 to see how to use the BizTalk Editor to edit this document. First take the following code in the Northwind.biz document and save it as Categories.xml (we have removed the customer element because the BizTalk Editor currently imports only one component at a time):

 <Schema name = "NorthwindSchema" xmlns = "urn:schemas-microsoft-com:xml-data" xmlns:dt = "urn:schemas-microsoft-com:datatypes"> <ElementType name = "Categories"       xmlns:Categories = "urn:northwindtraders.com.Categories"       content="eltOnly" model="closed"> <group order = "seq">             <element type = "Categories.CategoryID"             minOccurs = "1" maxOccurs = "1" /> <element type = "Categories.CategoryName" minOccurs = "1" maxOccurs = "1" />             <element type = "Categories.Description"             minOccurs = "0" maxOccurs = "1" />             <element type = "Categories.Picture"             minOccurs = "0" maxOccurs = "1"/> </group> </ElementType> <ElementType name = "Categories.CategoryID"         xmlns:Categories = "urn:northwindtraders.com.Categories"      dt:type = "int">    <description>       Number automatically assigned to a new category    </description> </ElementType> <ElementType name = "Categories.CategoryName"         xmlns:Categories = "urn:northwindtraders.com.Categories"       dt:type = "string"> <description>Name of food category</description> </ElementType> <ElementType name = "Categories.Description"         xmlns:Categories = "urn:northwindtraders.com.Categories" dt:type = "string"/> <ElementType name = "Categories.Picture"         xmlns:Categories="urn:northwindtraders.com.Categories" dt:type = "bin.base64"> <description>             Picture representing the food category         </description> </ElementType> </Schema> 

To import a well-formed XML document, a DTD, or a BizTalk schema, from the Tools menu choose Import. The Select Import Module screen will appear as shown in Figure 16-1.

click to view at full size.

Figure 16-1. The Select Import Module screen.

Since we are working with a BizTalk schema, choose XML-Data Schema and then select the Categories.xml file. At this point, a dialog box will appear informing you that group elements are not supported; just click OK. The records and fields of the imported schema will appear in the BizTalk Editor specification tree, as shown in Figure 16-2.

click to view at full size.

Figure 16-2. Imported schema in BizTalk Editor.

As you can see, the BizTalk Editor has imported most of the information, such as the elements and their child elements and the values of these elements. However, it did not import the data types. You will need to add the data types. For the CategoryID element, click on the right column next to Data Type and a list box will appear. Select integer[int] from the drop-down list. Add the data types for the other elements.

Records and Fields

The BizTalk Editor uses records and fields to present a document structure. Records and fields represent two types of components found in electronic data interchange (EDI) documents: segments and elements. A field corresponds to an EDI element and a record corresponds to an EDI segment. In regards to XML, we can think of a field as an element that either contains text or has no content at all, and a record as an element that can contain text, content, or other elements. As you can see in Figure 16-2, the root node was a record that contained four fields. The BizTalk Editor interprets the data contained in the records and fields of a document specification and creates a specification that is an XML representation of the document.

In Figure 16-2, you can also see that the BizTalk Editor has five tabs: Declaration, Reference, Parse, Dictionary, and Code List. Let's examine these tabs in more detail.

The Declaration Tab

The Declaration tab can be used to set declaration property values, add a custom declaration, and delete a custom declaration.The properties listed in the Declaration tab are shown in the following table:

Declaration Tab Properties

PropertyDescription
Name Name of the element.
Description Description of the element. This property can be used as a comment.
Data Type Data type of the element.
Model Can be closed or open. If the model is closed, the structure of a document that uses the specification currently being defined in the BizTalk Editor must conform to this specification. If the model is open, a document that uses this specification does not have to conform to this specification.
Type Determines whether this component is an attribute or an element. For the root node, it can only be an element.
Content Defines the type of content for an element. The root node and any record with child elements are Element Only, which means they can contain only elements. All other records can be either Empty or Text Only. If an element is empty, it contains no content.
MinLength, MaxLength Used for fields or records that contain string content. These properties define the length of the field.

The Reference Tab

The Reference tab can be used to set reference property values. It provides properties for each BizTalk Editor component. The properties of the root node, records that are not the root, and fields are all different from each other for the Reference tab. The available Reference tab properties for the root node are shown in the following table:

Reference Tab Properties for the Root Node

PropertyDescription
Schema Name Name of this particular specification.
Standard Name of an industry standard, such as XML, X12, or EDIFACT, that was used to create this standard (if one exists).
Standards Version Version of the standard (if a standard was used).
Document Type The document type of the specification (if a specification was used).
Version Version number of the specification.
Default Record Delimiter Determines which character you want to use to delimit records. You can use different characters for different records. This only applies to non-EDI standards.
Default Field Delimiter Determines which character you want to use to delimit fields. You can use different characters for different fields. This only applies to non-EDI standards.
Default Subfield Delimiter Determines which character you want to use to delimit child fields. You can use different characters for different fields. This applies only to non-EDI standards.
Default Escape Character Can be set to Tab (0x9), LF (0xa) and CR (0xd). This applies only to non-EDI standards.
Unicode If you set this property to Yes, the data associated with this specification uses the Unicode character set. If you don't specify the value for this property, it works with both Unicode and non-Unicode data. If you set this property to No, the data cannot be Unicode. If you are working with ASCII data, you must set this property to No.
Receipt If this property is set to Yes, you'll receive an interchange receipt acknowledgement, which will tell you that the message arrived at its destination. If this property is set to No, the documents built from this specification will be validated, but no receipt will be delivered if the message is received.
Envelope If this specification belongs to an interchange specification, choose Yes; otherwise choose No.
Target Namespace If you are working with a BizTalk framework document that uses a namespace, you must list the namespace here.

Reference Tab Properties for Records

PropertyDescription
Min Occurs Minimum number of times that a record can occur. The value can be either 0 or 1.
Max Occurs Maximum number of times a record can occur. The value can be either 1 or *. If you use either a star or don't specify a value for this property, BizTalk Mapper will define this record as a loop, if the specification is used in BizTalk Mapper.

Reference Tab Properties for Fields

PropertyDescription
Required If the field is required, set this property to Yes.
Start Position If the property is positional (contains a position in the record where a field starts), a number that indicates the starting position of the field in the record.
End Position If the property is positional, a number that indicates the ending position of the field in the record.

Figure 16-3 shows the Reference tab for the root node.

click to view at full size.

Figure 16-3. The BizTalk Editor showing the Reference tab properties for the root node.

Notice in the figure that we are missing the namespace that we had originally included. Add the following namespace to the root node Target Namespace property on the Reference tab: urn:northwindtraders.com.Categories.

The Parse Tab

The Parse tab is used to determine how the fields are defined in a document that uses the specification created by the BizTalk Editor. The Parse tab is used for documents that are delimited in some way, such as a comma delimited text file. The actual properties that are available will depend on whether you are working with a field or record and on the standard (such as X12, EDIFACT, or XML) and Structure property on the Parse tab you are using. If you have chosen to use XML as your standard, no properties will be available in the Parse tab. Because the schema we imported earlier used an XML specification, we cannot see or set any values of the Parse tab properties using the BizTalk Editor. If you choose either the X12 or EDIFACT standard, you will be able to set up properties for the Parse tab with delimited documents.

Parse Tab Properties for Root Nodes and Records

PropertyDescription
Structure Can be delimited or positional. If left blank, the file is considered to be delimited.
Source Tag Identifier Name of the source tag that is used to match the record with the data.
Source Tag Position Used in positional records; indicates the beginning of the tag.
Field Order Either Prefix (a delimiter is placed before each component, for example, *aa *bb *cc), Postfix (a delimiter is placed after each component, for example, aa* bb* cc*), Infix (a delimiter is placed between components, for example, aa*bb*cc), or Blank (unknown order). This property is used only for delimited records.
Delimiter Type Can be set to Character (the actual character to use as the delimiter is defined in the Delimiter Value property), Inherit Record (use the delimiter designation of the previous record), Inherit Field (use the delimiter designation of the previous field), or Inherit Subfield (use the delimiter designation of the previous subfield). This property is used only for delimited records.
Delimiter Value The character that is used to delimit the text if the value of the Delimiter Type property is Character. This property is used only for delimited records.
Escape Type Can be Character (tells the parser to suspend the delimiter designation if this character is found in the document; the character is specified in the Escape Value property), or Inherit Escape (for inheriting the previous record's escape type).
Escape Value If the value of the Escape Type property is Character, this property specifies the escape character.
Append New Line If set to Yes, indicates that when the record delimiter is found, begin the next record on a new line. If set to No, all records are on the same line.
Skip Carriage Return If set to Yes, the parser will skip the carriage return (CR) value after a delimiter.
Skip Line Feed If set to Yes, the parser will skip the line feed (LF) value after a delimiter.
Ignore Record Count If set to Yes, tells the parser not to count any CR or LF values when counting characters.

Parse Tab Properties for Fields

PropertyDescription
Custom Data Type Used for specifications that are based on an X12 or EDIFACT standard. Only applies to if the structure type is delimited.
Custom Date/Time Format Used for specifications that are based on an X12 or EDIFACT standard. Only applies to if the structure type is delimited.
Justification For positional and delimited files. If set to Left, the data that is less than the maximum length is aligned left. If set to Right, the data is aligned right.
Pad Character A character that will be used to pad blank spaces in a field.

The Dictionary Tab

The Dictionary tab is used to set up the properties for agreements. Agreements will be discussed in more detail in the section "BizTalk Management Desk" later in this chapter, but in simple terms, an agreement is used to define the rules for passing documents between two corporations. Using agreements, pipelines can be created that pass documents back and forth between two servers. (We will discuss pipelines in more detail later in this chapter.) The Dictionary tab defines the location of the agreement that is used for a field.

Dictionary Tab Field Properties

PropertyDescription
Source Type Indicates the document instance value for the source type.
Source Value Indicates the actual data in the document instance that will be used to validate a document. For example, an ID number.
Destination Type Indicates whether the sender or receiver data located in the document instance will be used to validate the document.
Destination Value Indicates whether the actual destination data in the document instance will be used to validate the actual document.
Document Type Indicates that the document name in the document instance is to be used to validate the document.
Document Node When using an envelope schema, the document node indicates the body record that will hold the actual document.
Version Indicates the document version that will be used to validate the document.



Developing XML Solutions
Developing XML Solutions (DV-MPS General)
ISBN: 0735607966
EAN: 2147483647
Year: 2000
Pages: 115
Authors: Jake Sturm

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net