BizTalk Schemas Properties

Base Data Type:

this is important properties of schema, but most of the cases we have set as blank.

This properties is applied on Record, Field Element, Field Attribute;

Its by default value is set as Blank, indicating that the data type of this Record, Field Element, or Field Attribute node is not derived from another data type.

Data Structure Type:

It specifies a name for the data type of the selected node so that it can be used elsewhere.

Data Structure type only applied on Record in Schema. It is used for below three kind of activity:

  • Select an existing global complex type to be associated with the selected Record node, thereby converting the inbuilt complex type for this Record node to a global complex type.
  • Specify a name for the complex type associated with the selected Record node, thereby converting its unnamed complex type to a global complex type
  • Reference an existing global Record node.

Difference between Base Data Type and Data Structure Type:

Base Data Type as inheriting from a base class which you can then modify further.  It will retain the name you define and can then be used as the Data Structure Type of other Elements.

Data Structure Type is similar to creating an instance of a Type.  So, if you have your ‘Type’ Elements defined at the root, you can then set child Elements elsewhere to these types, complex or simple, using Data Structure Type.

Derived By:

It specifies how the complex type associated with the selected node is derived from the data type specified by the Base Data Type property.

Derived By.jpg

More info available at: https://msdn.microsoft.com/en-us/library/aa560465.aspx

Simple and complex types in XML Schema:

In XML Schema, there is a basic difference between complex types which allow elements in their content and may carry attributes, and simple types which cannot have element content and cannot carry attributes.

Advertisements

Regulation Expression in BizTalk Schema

Some times we need to set element or record attribute with particular restricted values e.g. mail id, positive integer, without any special characters. We can achieve this  with following steps:

mail.jpg

We need to set Schema property for this MailID as below

 

mailidproperties.jpg

Now click on Pattern eclipse and set the Regular expression for mail id:

PatternEditor.jpg

Through this way we can achieve regulation expression in BizTalk Schemas.

Exception Handling at Port level

When we develop BizTalk applications, then most of the time, we handle exceptions at orchestration level though the use of catch exception block. And most of the cases, we have seen that exception is not handle at port level e.g. Receive Port and Send Port.

What’s happen when message failed at Receive/Send Port:

Whenever message is failed, then message will automatically go in Suspended Instances in BizTalk Admin Console.

Whenever message failed in BizTalk, then an error message is generated with having original message. And all its prompted properties will be demoted. The error message is a clone of the original message with selected properties related to the specific messaging failure promoted to the message context. We can see this info in Suspended Instance of message.

When a failed message is generated, BizTalk Server promotes error-report-related message context properties and demotes regular message context properties before publishing the failed message.

Now a day Business Require that alert mail will be generated whenever message will be failed at Port level as well as pipeline and message will not go in suspended instances, in this case we need to check the checkbox of Enable routing for failed messages on Receive Port and send port.

Below are some Message context properties of Error Report are promoted when message failed. for more details, you can check at

https://msdn.microsoft.com/en-us/library/aa578516.aspx

  • ErrorReport.FailureCode
  • ErrorReport.FailureType
  • ErrorReport.FailureCategory
  • ErrorReport.FailureInstanceID
  • ErrorReport.FailureMessageID
  • ErrorReport.Failuretime
  • ErrorReport.Description
  • ErrorReport.MessageType
  • ErrorReport.ReceivePortName
  • ErrorReport.InboundTransportLocation
  • ErrorReport.SendPortName
  • ErrorReport.OutboundTransportLocation
  • ErrorReport.ErrorType
  • ErrorReport.RoutingFailureReportID
  • ErrorReport.ProcessingServer

Exception Handling at Port level through orchestration:

https://vkbiztalk.wordpress.com/2017/07/05/handling-port-level-exception-through-orchestration/

Exception Handling at Port level through ESB Management Portal:
Exception Handling at port level is also a very  important.  If ESB Management Portal is  already available on the BizTalk , if not then you can download from Microsoft site (https://www.microsoft.com/en-in/download/details.aspx?id=38166). its free available along with BizTalk Licence.

We just need to check the check box of Enable routing for failed message.

On Receive Port below screen is available in General tab in Receive Port Properties. We need to check the check box as below

enablerouting.jpg

On Send Port below scree is available at Transport Advance Options at Send port properties

We need to check the check box of Enable routing for failed message

SendPort_EnableRouting.jpg

How ESB Management Portal work at Receive/Send Port-

When ESB tool kit install on BizTalk server, then a ESB applications Microsoft.Practices.ESB is added at BizTalk admin console as below:

ESB ManagementPortal.jpg

This ESB application can handle all the Custom and System exception of BizTalk Applications. And stored the data and exception details in ESBExceptionDb and can be track on ESB Management Portal. ESB Management Portal is a website which is hosted on the BizTalk server when we install toolkit. Through this portal we can add support team and Business user mail id. When any exception occur then this portal automatically generated alert mail.

Below screen is show the Filter of ALL.Exception Send port of Microsoft.Practices.ESB BizTalk Application.

AllException.jpg

Here we can see that this send port set the filter for properties of ErrorReport.FailureCode and Microsoft.Practices.ESB.ExceptionHandling.Schemas.Property.FaultCode. So when ever message will failed in BizTalk then this send port pick the message and send the details in EsbExceptionDb database from where ESB Management Portal get info.

Some times we need to check the failure details from database. Below table have all the details of failure message

Database Name: EsbExceptionDb

Fault: This table has all the exception related details. Error details, stack trace, failure time etc.

Message: This table has the information of Message e.g. Messageid, Interchangeid

MessageData: This table has the original message with MessageID. So we can retieve message data from this table.

Exception Handling in Orchestration with ESB

Click Here

Exception handling at Port without using ESB:

Some times BizTalk doesn’t have ESB. So in that case Exception handling at port level can be done by the flowing way.

  1. Send Port: We need to create a send port which have the ErrorReport properties as well as ReceivePort/Send port name in filter. So this send port receive the failed message and send to destination location as configured. But this is not share any error details just send original message.
  2. Orchestration: We need to create a BizTalk application which have a orchestration to handle exception. in orchestration receive shape filter properties we need to apply ErrorReport properties and port name. Port name at filter is require otherwise it receive all the Exception of BizTalk. This orchestration receive Original message as with error details.

In below blog, I have defined a sample how to exception handling of Port through orchestration:

https://vkbiztalk.wordpress.com/2017/07/05/handling-port-level-exception-through-orchestration/