Sunday, August 25, 2013

Top Contributors Awards!! System Center 2012, Hybrid IT Infrastructures, BizTalk, Microsoft Project 2013 and Lovable Techie Gurus!

I was pleasingly surprised after seeing my name... feels good!!!!!!!!!!!!




Reference:

Top Contributors Awards!! System Center 2012, Hybrid IT Infrastructures, BizTalk, Microsoft Project 2013 and Lovable Techie Gurus!


Friday, August 23, 2013

Interview questions on Orchestration





This post intends to cover the answers to orchestration related questions, which a BizTalk developer can face during an interview.




Questions and answers:

1.     How are messages created in an orchestration?

You construct a message any time that you introduce a message into your orchestration, either by receiving it or by assigning values to a message variable (see MSDN Constructing Messages Jump ). There are several ways to create a new instance of a message in an orchestration, see Michael Stephenson blog post Message Construction in an Orchestration Jump 

2.     Where is information about promoted properties stored?

The information about the promoted properties is extracted and stored in the bts_DocumentSpec table in the Management database.

3.     What is message metadata?

The message metadata is called Context Properties and on receiving the message, both the adapter and the pipeline will add information to the context.

4.     Can we use message metadata in Orchestration?

Yes

5.     How does Orchestration subscribes to messages?

In Orchestration, the first Receive shape is responsible for creating a subscription. Following two properties are involved in it,

o    Message : This tells what message this Orchestration is subscribing to
o    Activate : This tells to consume the message when found in a MessageBox

6.     Design patterns in Orchestration?

One of the best practices when implementing orchestrations is to use orchestration patterns when possible. These patterns are basically design pattern, which is a general reusable solution to a commonly occurring problem within a given context of BizTalk orchestration. This article will provide some useful resource links to aid you in using patterns when implementing an orchestration. See TechNet Wiki articles BizTalk Server 2010: Orchestration Patterns and BizTalk: Enterprise Integration Patterns

7.     Types of messages?

Two types of message 

o    Typed message : A message created in Orchestration is bound to the schema
o    Untyped message : A message is bound to System.Xml.XmlDocument instead of the schema.

8.     How to load message in a variable?

It can be done using the LoadXml method. Say xmlDoc is a variable then following is done to load employee message. 

xmlDoc.LoadXml("<Employee><first_name>Joe</first_name><last_name>Smith</last_name></Employee>");

9.     Can recursion be achieved in Orchestration?

No

10.   What is binding?

The term binding refers to the configuration of orchestration ports in order to control the creation of subscriptions and/or promoted properties. Binding is used to control how messages will be routed to or from orchestration ports by the subscription mechanism.

11.   To which scope compensation block can be added?

A scope configured as Atomic or Long running can have compensation blocks added, but scopes that are configured with no Transaction type cannot.

12.   Is it necessary for all .Net components being called from orchestration to be serializable? 

Yes it is necessary (good practice) for all .Net components being called to be serializable. If not then Atomic scope is to be used which has its own limits.

13.   Is it possible : Orchestration A calls another Orchestration B and vice versa?

No it is not, since it forms cyclic dependency.

14.   What is XLANG and where it is used?

XLANG/s can be viewed as a messaging language with some of the expression capabilities of C#. However, code is not portable between XLANG/s and C#. The language is used for orchestrations. XLANG/s statements generally fall into one of two categories: simple statements that act on their own, such as receive or send, and complex statements that contain or group either simple statements or other complex statements, such as scopeparallel, and listen. The semantics embodied in XLANG/s are a reflection of those defined in the Business Process Execution Language for Web Services (BPEL4WS) specification published by Microsoft, IBM, and BEA for the definition of business process semantics. See MSDN XLANG/s Language Jump 

15.   Can we prevent Orchestration from entering a suspended state?

Any exception which is not caught within the exception handlers of the orchestration causes the orchestration instance to be moved to the Suspended state. By applying the appropriate error handling in an orchestration it can be prevented entering the Suspended state. 

16.   What is persistence point?

At various points within a running orchestration the state can persist. See MSDN Persistence and the Orchestration Engine Jump .

17.   XMLDocument is non-serializable still it's called without atomic scope with no error, why?

It is the only exception to the requirement of types for variables having to be serializable and treated as special case. See more here Jump 

18.   What is the maximum number of properties that can be used in correlation set?

The correlation set can have a maximum of three properties used for correlation on the receive shapes. 

19.   Can an Atomic scope can have an exception handler of their own?

No, it can only have a Compensation Block.

20.   Pro's and Con's of Direct binding? 

Pro's:

a.     Loose coupling  
b.     Not bounded to any physical port (explicitly)
Con's:
c.     Can lead to subscribing to messages published by another publisher

21.   Can orchestration use components other than listed in Toolbox?

Yes. It is possible to use components like pipeline, business rule policy, .net component etc.

22.   When is convoy used?

The convoy is used to receive multiple messages in sequence or parallel to achieve a goal/result. 

23.   Is it possible to enforce Orchestration to behave in singleton way?

Yes it is possible with the help of correlation. 

24.   Where is BTS.SPID and BTS.ReceivePortID used?

It is used in Specify Later port binding option. In this model the orchestration ports are bound to messaging ports using BTS.SPID,BTS.ReceivePortID or other related properties. 

25.   When is property "Synchronized=true" used?

When a variable is shared across the branches of parallel shape. 

26.   What is the maximum number of branches that can be used in a parallel shape?

There are no limitations on the number of branches which can be used in a parallel shape. 

27.   Which language does expression shape support?

Expression shape allows for writing XLANG/S statements that provide C# -like coding capabilities. 

28.   What is relation between Orchestration instance and correlation?

Correlation is the process of matching an incoming message with the appropriate instance of an Orchestration.  

29.   What are the ways to add properties in context?

Promoting a node to a property field means to make a node value available in the context of the message.Adapters and pipeline components write in the context. 

30.   What is the difference between written property and promoted property?

Promoted properties can be used as criteria in message routing while written properties cannot.  Property field is a Promoted Property in the context. Distinguished field is a Written property in the context.

31.   What is correlation type?

A correlation type is a list of properties that eventually populates with values for use in routing messages. 

32.   What are conditional persistence points?

The Receive shape, Listen Branch and Delay shape are conditional persistence points. 

33.   What are Scopes used for?

Scopes are used for following reasons: 

 .      To configure transaction (long running and atomic)
a.     To handle exceptions
b.     To trigger compensating logic
34.   Which shapes are used to implement "AND" and "OR" situation in Orchestration?

Parallel Action shape is used for a AND situation whereas Listen shape is used for OR situation. 

35.   Which scope can have an Exception Handling?

A scope configured with the transaction type of None or Long running  can have exception handling added but not Atomic scope.

36.   Is it possible to get an exception object from General Exception?

No. General exception in BizTalk is similar to writing a Try-Catch block but without the exception object thus not possible to get the exception object.

37.   What's the main difference between Call and Start Orchestration?

Calling an orchestration will use the same thread to run another orchestration while using Start Orchestration will create a new thread to run the started orchestration.
A Call Orchestration returns the control back to the caller. A Start Orchestration shape starts the orchestration in a non-deterministic way.
As a conclusion, Calling an Orchestration will be synchronous operation where the caller waits for a response, while Start Orchestration is asynchronous operation. See more here Jump .

38.   What are the different types of transactions available for orchestration?

Unlike traditional programming, BizTalk Server supports two distinct types of transactions: atomic and long-running.  See more here Jump 

39.   Is it possible to skip any particular orchestration from getting compiled?

Yes it is possible. You can do so by setting "Build Action" property of that orchestration to "None". By default value of this property is "BtsCompile". 

40.   When a persistence point occurs at the Orchestration level?

The engine will save the state of an orchestration in the following circumstances:

o    Send Shape (after a message is sent)
o    Start Orchestration Shape
o    Suspend Shape
o    End of a Transactional Scope (atomic or long-running)
o    An Orchestration Debugger breakpoint is hit
o    Orchestration Engine determines that the instance needs to be dehydrated
o    When the Orchestration Engine is shut down; through the controlled shutdown of the host or abnormal circumstances. The engine tries to persist but if that fails, the Orchestration instance will resume from the last successful persistence point.
See more here Jump 
41.   Can persistence point occur in the Delay or Receive shape?

Yes, but only if the Orchestration Engine determines that the instance needs to be dehydrated.

42.   Is it possible to use Message Assignment shape and Transform shape individually? 

No, it is not possible, Transform and Message assignment shape must run under construct shape.

43.   Is it possible to use IF Then Else logic inside the Message Assignment?

No, It is not possible to use the If Then Else Logic inside the message Assignment. It has to be used in the expression shape.


44.   How to Promote Property inside an Orchestration?

The Orchestration can not promote the properties to message context by default like pipelines can do by using the msg.Context.Promote() method. Inside Orchestration one has to create a correlation set and intialize that correlation set while publishing the message. Then the BizTalk Engine will promote the property to the message context.

Interview questions on Schema




This post intends to cover the BizTalk schema related questions, which a BizTalk developer can face during an interview.




Questions and answers:

1.     What is the purpose of a document schema?

The schema is basically a contract of your message and defines it. The XML Schema definition (XSD) language defines the structure of an XML instance message, and this is the intended purpose of XSD, such schemas use XSD in a straightforward way. 

A schema is a term borrowed from the database world to describe the structure of data in relational tables. In the context of XML, a schema describes a model for a whole class of documents. See MSDN Different Types of BizTalk Schemas Jump .

2.     What is the purpose of a property schema?

Property schema is a special type of schema, not created to describe messages. Instead, it describes context properties. It consists of only child node under a root node. See MSDN Different Types of BizTalk Schemas Jump . 

3.     What is the purpose of an envelope schema?

An envelope schema is a special type of XML schema. Envelope schemas are used to define the structure of XML envelopes, which are used to wrap one or more XML business documents into a single XML instance message. When you define an XML schema to be an envelope schema, a couple of additional property settings are required, depending on such factors as whether there is more than one root record defined in the envelope schema. See MSDN Different Types of BizTalk Schemas Jump .

4.     What is the purpose of a Flat File schema?

A flat file schema defines the structure of a class of instance messages that use a flat file format, either delimited or positional or some combination thereof. Because the native semantic capabilities of XSD do not accommodate all of the requirements for defining the structure of flat file instance messages—such as the various types of delimiters that might be used for different records and fields within the flat file. BizTalk Server uses the annotation capabilities of XSD to store this extra information within an XSD schema. BizTalk Server defines a rich set of specific annotation tags that can be used to store all of the required additional information. See MSDN Different Types of BizTalk Schemas Jump .

5.     What is the target namespace for schema?

Target Namespace is to schema what a namespace is to .Net Object and root node as a class name.

6.     Is it possible to create a custom data type and use it in a schema?

Yes, it's possible to create custom data types and it can be used across the schema. See Can We Have Custom Data Type. Jump 

7.     Can schema have two nodes with the same name and different datatypes?

Yes, as long as they are not in the same scope. 

8.     Can schema have multiple root nodes?

Yes, a schema (XSD) can have multiple root nodes. In case you have a schema with multiple root nodes you will end up with multiple message types declared in BizTalk, one for every root node. So when you want to create a message you will need to specify exactly which message type you are going to use! 

9.     Is it possible to include and import in a single schema?

Yes, it is possible, both are the ways to utilize already existing schema. The only condition is the schema which is included should have same TargetNamespace or no namespace.

10.   By default, what is the data type of elements in a schema?

xs:string 

11.   What is the difference between Group Max occurs, Group Min Occurs and Max occurs, Min Occurs?

These are all node properties. See MSDN Node Properties Jump .
Group Max Occurs: Specifies the maximum number of times that to the underlying group content of the selected All Group node can occur.
Group Min Occurs: Specifies the minimum number of times that the underlying group content of the selected All Group node can occur.
Max Occurs: Specifies the maximum number of times that the element corresponding to the selected Record node can occur.
Min Occurs:  Specifies the minimum number of times that the element corresponding to the selected Record node can occur.

12.   What is BlockDefault property used for?

Use the BlockDefault property to prevent or restrict the types of derivations that can be used in instance messages for all data types defined by the schema being edited. See MSDN BlockDefault (Node Property of All Schemas) Jump .

13.   What is a canonical schema?

A canonical schema is a design pattern, which is applied within a service oriented paradigm, and within BizTalk server context establish the loose coupling between systems. Through performing the transformation of messages from one system to canonical schema and from the canonical schema to message of another system, systems have no direct relation with each other. The canonical schema can also be viewed as an internal schema in BizTalk and aid you in structuring your solution through best practice of creating separate projects for maps, orchestrations, internal and external schemas. Another advantage of using a canonical schema is that it reduces the number of transformations you need. If you need a to map a few types of inbound message coming from different parties to a few outbound messages, you can create a map to your canonical schema for each inbound schema and then a map from your canonical schema to each outbound schema. If for example you have three types of incoming that needs to be mapped to three types of outgoing messages you will only need to build and maintain six maps instead of nine. 

14.   What is the correlation property schema?

Correlation types define a set of properties on which you will be correlating messages. These can be any properties which were previously defined in a property schema (see question 2) and deployed with some BizTalk Project including "system" properties deployed with the GlobalPropertySchemas  Jump which is installed as part of the base BizTalk install. A correlation set defines a set of properties and values for these properties that a message must contain to be processed by a particular orchestration. See MSDN Correlation Sets Jump 

15.   Difference between Flat File Schema and XML schema?

A flat file schema defines the structure of a class of instance messages that use a flat file format, either delimited or positional or some combination thereof. Because the native semantic capabilities of XSD do not accommodate all of the requirements for defining the structure of flat file instance messages—such as the various types of delimiters that might be used for different records and fields within the flat file—BizTalk Server uses the annotation capabilities of XSD to store this extra information within an XSD schema. BizTalk Server defines a rich set of specific annotation tags that can be used to store all of the required additional information. See MSDN Different Types of BizTalk Schemas Jump .

An XML Schema is basically a contract of your message and defines it. The XML Schema definition (XSD) language defines the structure of an XML instance message, and this is the intended purpose of XSD, such schemas use XSD in a straightforward way. See MSDN Different Types of BizTalk Schemas Jump .

16.   Can we have schema without a target namespace? What will be its MessageType?

Yes, we can have a schema without target namespace and it's message type will be the Root node.

17.   Which property is only available for the flat file schema?

Custom Date/time property is only available for flat file schema.

18.   What is the Message?

Each message in BizTalk Server is considered a multi-part message and is made up of zero or more parts. Each message with one or more parts has one of these parts identified as the body part. Each part consists of a binary chunk of data which can represent an XML document, a flat file, a serialized .NET class, or other binary stream of data. You use the body part of the message to identify the type of the message that can be used for routing. See MSDN The BizTalk Server Message Jump 

19.   What is the difference between BizTalk (Schema) Editor and BizTalk Schema Generator?

BizTalk Editor resides within the Microsoft Visual Studio shell. Some of the functionality within BizTalk Editor relies upon existing user interface elements within the Visual Studio shell. See Using BizTalk Editor Jump .

BizTalk can automatically create the schema from DTD, well formed XML, XDR. To do this schema generator is used.

20.   How is schema generator invoked?

Right-click the project in Solution Explorer and select Add Generated Items --> Generate Schemas.

21.   What is InstallWFX.vbs script?

It is a script which when run installs the BizTalk Schema Generator. It is used when generating a schema from existing items. It's likely to get error first time or after updates "WFX to XSD Schema generation module is not installed". Then this script can be used to install the schema generator.

22.   Can "EDI" be a part of Namespace?

It can be but it should be avoided in the projects that uses BizTalk EDI engine as during run time there can be conflicts with this and expected results might not be seen.

23.   Is it possible to promote XML record of ComplexContent ?

No. To promote XML record its ContentType property should be set SimpleContent.

24.   What is the maximum length allowed for promoted properties?

255 characters

25.   What is the maximum length allowed for Distinguished fields?

It can be of any length, no limits.

26.   How to create an XPath alias  to a field which can be used in decision making in Orchestration?

The Distinguished field  is an XPath alias to the field.To create it , right-click the element-->Promote-->Show promotion-->Add

27.   What is <Any> element? 

An <Any> element in a schema designates a specific location in the schema where new elements or attributes can be added. When BizTalk uses the schema to process a message containing unknown elements or attributes in the designated location, the schema will still consider the message valid.

28.   What is the Root Node? 

It's a node within a BizTalk Server schema that represents the outermost XML element in the business document specified by the schema.

29.   How BizTalk engine identifies a unique schema?

BizTalk uses a combination of namespace#rootnode to define the schema type of a message, thereby making a MessageType unique (for example: http://mynamespace.com#MyRootNode). In other words, BizTalk uses this combination to identify and resolve schemas references.

30.   How BizTalk engine performs a validation of an instance of the message against the Schema?

By default, BizTalk Server will examine only the namespace and the root node name of a message to identify and validate the schema, and will not detect extra elements in the message body. To perform a deep validation of a message format, you have to create a Custom Pipeline with the XML Disassembler component. See more here Jump .

31.   What are encoding options available used by BizTalk when creating schema? 

There are various options but BizTalk always uses UTF-16 encoding for their schemas. See more.

32.   Does BizTalk add any namespaces when creating schema? 

Yes.  http://schemas.microsoft.com/BizTalk/2003 Jump  Jump  and http://www.w3.org/2001/XMLSchema Jump  Jump are added by BizTalk when creating a schema. See more.

33.   How is schema namespace added by BizTalk when creating schema? 

By default, the BizTalk Editor will set the namespace of a schema to http://ProjectName.SchemaName. 

34.   What is the difference between XSD and DTD? Difference between XSD and DTD are listed below:

    • XSD are written in XML.
    • XSD  support data types.
    • XSD  support namespaces.
    • XSD is extensible to future additions.
    • XSD is richer and more powerful than DTDs.