Ever wanted to add your own annotations to your schemas for some purpose like the Flat File extension, property promotion, the HWS extension or the TPM extension does? You can edit the schema by hand, but that wouldn’t be any fun, right? ;-) As an exercise, I’ve created two extensions which can easily be used in Visual Studio and extend the default schema editor, like the flat file extension does.
One of the extensions allows an annotation to be added to the root schema element which can be read somewhere else in order to execute a specific BRE policy belonging to the message. This solution could be used to execute a policy from a pipeline in a content-based routing scenario.
The other extension solves an issue a guy with me on a recent course has in processing COBOL copybooks. He needs to determine whether a field should be treated (and validated) as a date field instead of the normal numeric value. The extension allows for adding a property on any field stating it’s a date field according to the COBOL copybook standards.
Figuring out how and what with schema extensibility can be a daunting task, as documentation is scarce. If you end up developing with these extensions, look into these properties, as there are not used, but very interesting (and hopefully, self-descriptive):
Also, note the custom tab on the CopyBookExtension. It stems from a method called by the schema editor called GetCustomViews and the tab shows which fields will be interpreted as a date.
Sourcecode for the CopyBookExtension is here
, sourcecode for the BRECallPolicyExtension can be found here
Using the extension is easy:
Let me know what you think!
- Compile the extension. A post-build action will copy the output to the schema editor extension folder of BizTalk
- Open up a schema in Visual Studio
- Select the extension
- In case of the CopyBook extension, select a field and note the “CopyBook” group in the PropertyGrid
- In case of the BRECallPolicy extension, select the node and note the “BRE” group having a dropdown list of all published policies (latest only) or the error if nothing is found on the local host BizTalkRuleEngineDb ;-)