Search This Blog

Wednesday, August 10, 2011

How to add Different Meta tags to Different Blogger Posts


What's the use of adding different meta descriptions to different Blogger Posts?
It is very good for SEO (Search Engine Optimisation) . Actually, why we are adding meta tags is to tell search engines what that page is all about... but, using same meta tags to all of your blog posts lessens the search engine rankings and traffic little bit.
But, if you add different unique meta tags to different Blog posts, it makes the search engines to know more about your individual blog posts and make them crawl and index your pages better and it also improves your Search engine rankings for sure ;)

So, how to add this?

For this to happen, you have to add some pieces of codes to the template.
First Sign in to Blogger dashboard » Layout » Edit html

and find this line


<b:include data='blog' name='all-head-content'/>


and add this code just below that line


<b:if cond='data:blog.url == "http://bloggertricks.com/"'>

<meta content='DESCRIPTION' name='description'/>
<meta content='KEYWORDS' name='keywords'/> </b:if>


So, the final code looks like this one


We now added meta tags to the homepage. Next, you want to add meta description for another post, for example : http://challabiztalkfaq.blogspot.com/2011/08/what-is-biztalk-biztalk-is-messaging.html

Now, what you have to do is pasting the above three lines below the present code and changing the link,description and keywords.
So, the final code now looks something like


<b:include data='blog' name='all-head-content'/>

<b:if cond='data:blog.url == "http://challabiztalkfaq.blogspot.com/"'>

<meta content='DESCRIPTION' name='description'/>

<meta content='KEYWORDS' name='keywords'/> </b:if>

<b:if cond='data:blog.url == "http://challabiztalkfaq.blogspot.com/2011/08/what-is-biztalk-biztalk-is-messaging.html"'>

<meta content='How to add Paypal Button to your Blogger Blog, Adding Donations to your blog' name='description'/>

<meta content='Adding,Paypal,Donate,Button' name='keywords'/> </b:if>

Just like the above procedure, you can add different meta tags to as many blog posts as you can.

Adding meta tags to blogger(blogspot) blogs,websites-SEO

If you don't know what meta tags are, and the importance of adding meta tags, here is the detailed article on how to add them to your blogger(blogspot) blogs or any website.

Adding meta tags is very important if you want to get some good traffic from search engines like google,yahoo,msn,etc,especially the meta description part is the most important one.

If you don't know what meta tags are,Meta tags are the tags which describes your site and tells the search engines what your site is all about. Adding meta tags is an important factor in Organic Search Engine Optimization (SEO). Meta tags allows search engines to index your web pages more accurately. In other words,Meta tags communicate with the search engines and tells more information about your site and make your webpages index correctly and accurately.

You have to add two meta tags to the head section of your blogger template. One is the Meta description which describes your site and another one is Meta Keywords which tells about your site keywords(what your site is all about).

Here is how to add meta tags to your blogger(blogspot) blog:
1.Sign in to your blogger dashboard>Select the 'Design' link[see the screenshot below]
blogger design
2.Click on the 'Edit html' tab
click on the 'edit html' tab

Here is the code you have to add

<meta content='DESCRIPTION HERE' name='description'/>
<meta content='KEYWORDS HERE' name='keywords'/>
<meta content='AUTHOR NAME HERE' name='author'/>



DESCRIPTION HERE:Write your blog description
KEYWORDS:Write the keywords of your blog
AUTHOR NAME:Write the author's name(Your name)


{ UPDATE : }
Now..You don't need to do it manually..
Click on below link
Meta Tags Generator to make this process easy for you!
Just go to this page and Enter some basic information like keywords,description,etc.. It will automatically generate you error free, effective Meta tags. Once done, copy that code and follow the next step.

3.Add the above code just after this [Look at the below screenshot]
<b:include data='blog' name='all-head-content'/>

add the code just like this
Don't forget to add description and keywords.
and save the changes.

IMPORTANT:
Many people are just filling the meta description with keywords. DON'T DO THAT. Google and other search engines will ban your site from the search engines list if you repeat your keywords too often. Make sure you don't repeat any keyword more than 3 times.
That's it!You have successfully added the metatags to your blogger(blogpsot) blog.If you want to check whether you added the meta tags correctly or not,just type 'meta tags analyzer tool' in the google and you will find so many sites which can check whether you have added the tags correctly or not.

For more blogger tips and tricks click here.

Tuesday, August 9, 2011

HOW to Compensate a Transaction in a BizTalk Orchestration

What is Compensation?

Most of us are aware of an Atomic transaction, which can either be committed or rolled back. A Long Running (L-R) transaction is one which executes for several hours, days or even weeks and contains several atomic transactions. These smaller atomic transactions which are completed/committed cannot be rolled back and hence need to be compensated. This undo operation which consists of deleting a record, in the case of an insert operation is known as Compensation and such a transaction is known as a Compensatory Transaction.

BizTalk Server and Compensation!

BizTalk provides the capabilities and facilities for the compensation to happen, but the developer is responsible for keeping track of all database changes and performing the appropriate undo operations. NOTE: BizTalk does NOT automatically perform compensation. BizTalk Server 2006 and Visual Studio 2005 have been used in this article.

Compensation - Points to Remember...

  • A Compensation section is generally written, in order to UNDO the effect of a transaction.
  • The Compensation section for a scope gets activated only when the scope terminates normally or the scope completes its execution.
  • Unlike exceptions, a compensation section can be written for a "Atomic" as well as a "L-R" transaction.
  • A Compensation section needs to be explicitly invoked, using the Compensation Shape in order for it to execute.
  • A Compensation section for a scope does NOT automatically undo the effect of a transaction. The compensation section must have the undo logic in place in order to have such an effect.
  • A Compensation shape can be used to invoke/execute a compensation section. The control returns to the next operation after compensation shape, once the execution of the compensation section is complete.

Scenario 1 : Employee Leave Request Processing...

Consider a scenario where an Employee leave request needs to be processed. The following are the steps which describe it in more detail...
  • An EmployeeLeaveHistory record is inserted into the database as soon as a request arrives in BizTalk. DD
  • The number of leaves requested is calculated from the EmployeeLeaveHistory record and the columns SickLeaveBalance and EarnedLeaveBalance in the Employee table are updated.
  • The Employee table update can fail, if the number of leaves in the columns SickLeaveBalance or EarnedLeaveBalance remaining for an employee is zero or less than the requested leaves.
  • Once an exception occurs, the EmployeeLeaveHistory record created in the first step needs to be deleted/removed. This is the compensatory transaction.
  • The following is the list of Stored Procedures used in this scenario.
SPList

  • The Stored Procedures are called from a .NET Component called DBLib, which uses a data class known as LeaveHistoryData CD
  • The Leave Application Schema - Observe the structure and the elements of the LeaveApplicationSchema LeaveAppSchema

Leave Compensation Orchestration:

LeaveCompensate OrchestrationView SolutionExplorer
In the Leave Compensation orchestration, there are three scopes being used...
  • Main Long Running Transaction Scope - Parent Scope
  • Leave History Record Insertion Atomic Scope - Child Scope
  • Employee Record Updation Atomic Scope - Child Scope
The Parent scope is a long running transaction which consists of two Atomic transactions. The First atomic transaction creates a new EmployeeLeaveHistory record. The updation scope updates the columns SickLeaveBalance or EarnedLeaveBalance in the Employee table. The Stored procedure raises an exception when the number of leaves remaining is zero or less than the requested number of leaves. Observe that the exception is caught by the Parent scope and the Compensation Shape invokes the Compensation section of the Leave History Record Insertion Atomic Scope and this section deletes the record or in other words performs an undo operation (Compensatory Transaction).
The RED arrow indicates the flow-of-control from the Compensation Shape to the Compensatory Section.

Event Log Messages...

Observe the event log messages...
EventViewer

Sample Example using a Parallel Shape

ParallelCompensation - Click to enlarge image The point to note in this example is that the exception raised in the Updation Atomic Scope branch does NOT interrupt the Insertion Atomic Scope branch. The exception is raised only after the Insertion branch completes its execution.
The RED arrow indicates the flow-of-control from the Compensation Shape to the Compensatory Section.
BizTalkExplorer

Some Takeaways

  1. Set the Synchronized property on the Scope shape to true, in case you want to handle exceptions.
  2. Compensation is an excellent mechanism to achieve database consistency during transactional failures.
  3. Compensatory transactions must be widely used in all the transactions involving disparate databases and integration projects. 

Biztalk interview questions 2004/2006/2010 Part :4 (Differences in biztalk terminology)


  1. How many type of transaction BizTalk supports.
  2. Difference between Atomic and Long Running transaction.
BizTalk orchestration provides a transactional programming model that includes support for exception handling and recovery from failed transactions.

You can define two types of transactions when creating an orchestration:
  • Atomic transaction. Enables a transaction to automatically role back to a previous state in case the transaction does not successfully complete.
  • Long running transaction. Can span days, weeks, and longer time durations, contain nested transactions, and use custom exception handling to recover from error scenarios.
As a result, orchestrations provide you the flexibility to define the course of action in the event of a business process failure.
Western Digital My Passport Essential SE 1 TB USB 3.0/2.0 Ultra Portable External Hard Drive (Black)

Apple iPod touch 8 GB (4th Generation) NEWEST MODEL

2. Difference between Dehydration and Rehydration in Orchestration.

When many business processes run at the same time, memory and performance can be compromised. The BizTalk Orchestration Engine solves this problem by dehydrating and rehydrating orchestration instances. Dehydration is the process of saving the state of an active orchestration instance to the MessageBox database and then removing that instance from memory. This can happen when the orchestration engine determines that an instance has been idle for a period of time. Dehydrating the instance frees up the resources that were being used by the instance.

Dehydration

The orchestration engine calculates thresholds to determine how long an orchestration will wait for various actions to take place, and if those thresholds are exceeded, it dehydrates the instance. This can occur under the following circumstances:
  • When the orchestration is waiting to receive a message and the wait is longer than a threshold determined by the engine.
  • When the orchestration is waiting for a subscribed message.
  • When a delay in the orchestration is longer than a threshold determined by the engine.
  • Between the retries of an atomic transaction.
The orchestration engine saves the entire state of a running orchestration instance to persistent storage at various points so that the instance can later be completely restored in memory. The dehydration of orchestration instances enables the orchestration engine to have more "in-flight" instances than the physical resources of the computer running BizTalk Server would normally allow. Dehydration is automatically controlled by the orchestration engine; however, you can control the dehydration threshold by changing specific BizTalk Server configuration properties.

Rehydration

Rehydration is the reverse of dehydration. It is the process of de-serializing the last running state of an orchestration from the database or restoring the saved state of an orchestration instance from disk back to memory. The orchestration engine is triggered to rehydrate an orchestration instance when it either receives a message or when a time-out expires. It then loads the saved orchestration instance into memory, restores its state, and runs it from the point where it left off.
An orchestration can be configured to run on more than one server. After an orchestration instance has been dehydrated, it can be rehydrated on any of these servers. If one server goes down, the engine continues to run the orchestration on a different server, continuing from its previous state. The engine also takes advantage of this feature to implement load balancing across servers.

3. What is the difference between a "Message Assignment" shape and an "Expression" shape?

A "Message Assignment" shape is used to create a new message and assign values to it. An Expression shape is used to assign values to variables and also write 'if' conditions.

4. What is the difference between a Document Schema and a Property Schema?

A document schema is used to define a message. It is a definition on an Xml message with optional extensions for flat files, EDI file, etc that enable the parsers to convert the native format into Xml. A property schema is used to define message context properties. These can be of type MessageDataPropertyBase (the property value is promoted or demoted from/to the message itself) or MessageContextPropertyBase(property value only exists within the message context and can be set by adapters, pipelines or within orchestrations). If you wish to promote a field from a message into the message context then you need to define a document schema and property schema. In the document schema you promote the required field using the property schema to define the property type that will be used in the message context.

5. When you use Call Orchestration shape vs Start Orchestration shape?
A Call Orchestration returns the control back to the caller. A Start Ochestration shape starts the orchestration in a non-deterministic way.

6. What is the difference between a "Message Assignment" shape and an "Expression" shape?
A "Message Assignment" shape is used to create a new message and assign values to it. A Expression shape is used to assign values to variables and also write 'if' conditions.

7.Difference between Distinguished Fields and Promoting Properties 

·         Distinguished fields are available only within a single orchestration instance, and they are not available to other BizTalk Server objects, such as receive locations, send ports, send port groups, and tracking utilities.
 
·         Distinguished fields can be of any length; 
      promoted properties have a maximum length of 255 characters.

·         Distinguished fields have less of a performance impact than promoted properties, as they are not persisted to the MessageBox database. Instead, they are essentially XPath aliases, which simply point to the appropriate XML data field. Additionally, adding the DistinguishedField attribute to a field on a .NET class allows it to be exposed as a distinguished field.

·         Distinguished fields are accessed through a reference to the name of the message, the name of the record structure containing the distinguished field (which could include multiple levels of child records), and the name of the distinguished field, with each named item separated by periods: MessageName.RecordName.ChildRecordName.DistinguishedFieldName
 
      Promoted properties, on the other hand, are accessed through a reference to the name of the message, the name of the property schema, and a name of the promoted property, via the following format:
MessageName(PropertySchemaName.PromotedPropertyName).

Biztalk interview questions 2004/2006/2010 Part :3



Biztalk interview questions :
Part 1

Part 2


Part 4

43. How can I clean up suspended send port instances after handling the XLANGs exception?
Whenever a message is suspended after retries to a send port, the messaging engine generates a NACK. This NACK is translated into an exception in the orchestration. You can set the DeliveryNotification property to Transmitted on your send port, and add a catch handler to your scope to handle a DeliveryFailureException. However, in addition to generating the NACK, the messaging engine also suspends the message. There is no way to disable this behavior.
You need your own logic to clean up the suspended send port instance (message). You can create another orchestration that subscribes to NACKs. Both ACKs and NACKs have the following system context properties promoted, which can be used in filter expressions for routing.
After you have written an error-handling orchestration to subscribe to NACKs, you can use BizTalk Server WMI methods to terminate the suspended instance. You will get the instanceID of the suspended send port instance in the NACK.
Some of the context properties you can use in subscribing are:
· BTS.AckType. Set to ACK or NACK.
· AckID. Set to the message ID of the message that this ACK/NACK is for.
· AckOwnerID. Set to the instance ID that this ACK/NACK is for.
· AckSendPortName. The name of the send port that this message was being sent over.
· AckOutboundTransportLocation. The outbound URL that this message was being sent to.

44. When is the Delivery Notification delivered?
A Send on a Delivery Notification (ACK/NACK) can appear at any point in the orchestration. The Receive for the ACK/NACK occurs at the end of the enclosing scope, unless the enclosing scope is atomic. If the scope is atomic, the Receive for the ACK/NACK occurs at the end of the atomic scope's enclosing scope (for example, you do not get the delivery failure exception until all shapes in the enclosing scope have executed).

45. I have an orchestration with custom components. I deployed my assembly successfully. However, when I tried to run the application, I got an error: "File or Assembly name or one of its dependences not found."

This error usually means the BizTalk orchestration engine cannot locate the custom component. You must install all assemblies included in a BizTalk application in the global assembly cache of the computer that hosts the application.

46. Why does the orchestration debugger show the orchestration is running at the Send shape even though I know the Send has finished?

When you look at an orchestration in the debugger, you only see its state at the last commit point (in this case the send).
To see the current state of the orchestration, you can suspend the orchestration instance from HAT and open the Orchestration Debugger on this instance. From the Debug menu of the Orchestration Debugger, you can resume the instance in debug mode and attach to the instance to see its state.

47. When I terminate active orchestration instances from HAT, the instances stay active with Terminate as the pending job. How can I force them to terminate immediately?

You can stop and unenlist the orchestration. Then you can terminate the orchestration in HAT.

50. What is Correlation in context of BizTalk Server?

An Orchestration can have more than one instance running simultaneously. Even though each of those multiple instances performs the same action, it does it on different data contained within a message. Correlation is a process of associating an incoming message with the appropriate instance of an orchestration. For Example: If your orchestration issues a purchase order, receives an invoice, and sends a payment, the developer must make certain that the invoice message is received by the orchestration instance which corresponds to the orchestration that sent the Purchase Order. Without correlation, it would be possible to send out an invoice for thousands of items even though the purchase order is for one. And each correlation is based on a set of properties known as correlation types.
Kindle 3G, Free 3G + Wi-Fi, 3G Works Globally, Graphite, 6" Display with New E Ink Pearl Technology - includes Special Offers & Sponsored Screensavers

52. List out some Artifacts of BizTalk Server?

#. HAT #. BAM #. Adapter #. Pipeline #. Orchestrations #. Role Links #.
Send Ports and Send Port Groups #.
Receive Ports #. Receive Locations #.
Policies #.
Schemas #. Maps #.
Resources #. BAS Artifacts (Business Activity Services).

53. What is Biztalk Orchestrations Dehydration and Rehydration?

Dehydration: When an orchestration has been idle for a while, the orchestration engine will save the state information of the instance and free up memory resources. Rehydration: When a message is received, or else when a timeout has expired, the orchestration engine can be automatically triggered to rehydrate the instance – it is at this point that the orchestration engine loads the saved instance of the orchestration into memory, restores the state, and runs its from the point it left off.

54. What is the default mapping for Auto Mapping?

The default mapping for Auto Mapping is is mapping by structure. This can be changed to by node name in the map properties.

55. Does BizTalk 2004/2006 support Synchronous communication?

BizTalk is essentially Asynchronous. It can exhibit some synchronous behavior, if an Orchestration is converted into a web service.

56. Can an Envelope schema consist of more than one schema type?
Yes. Technically it is possible.


57. Can a flat file message be processing without a pipeline?

A Pipeline's job is to convert any external format into XML, be it a flat file or EDI or anything else.

58. Can multiple messages be processed or batched without an envelope schema?
It is possible to process multiple messages, without an envelope.

59. What is property promotion, why is it required?
When a property is Promoted, it is exposed to the orchestration/send port filters etc.

60. What are un-typed messages, how does one create them?
A message created in BizTalk Orchestration is bound to a schema, this is a typed message. In un-typed messages, the message is bound to System.Xml.XmlDocument instead of a schema.

61. How does one enable subscriptions in BizTalk?
A filter on the Send Port is the first step to enable subscriptions in BizTalk.

62. What is the difference between a delay shape vs a listen shape?
A 'Delay' is very much similar to a sleep on the current thread. A 'Listen' shape is used to wait for an incoming resource, with a timeout period.

63. When you use Call Orchestration shape vs Start Orchestration shape?
A Call Orchestration returns the control back to the caller. A Start Ochestration shape starts the orchestration in a non-deterministic way.

64. What is the difference between a "Message Assignment" shape and an "Expression" shape?
A "Message Assignment" shape is used to create a new message and assign values to it. A Expression shape is used to assign values to variables and also write 'if' conditions.

65. Does BizTalk Orchestrations support recursion?
  An Orchestration does NOT support recursion.

66. What is the purpose of the property "Activate" in a Receive shape?
It is used to invoke a new instance of an Orchestration.

67. Can an orchestration Start without an Activatable receive?
A Nested Orchestration can be started without an Activatable receive

68. Is it necessary for all .NET components being called from an Orchestration be Serializable?
Yes it is necessary. There are cases where a .NET component need not be Serializable.


69. When do we need set the property "Synchronized" = true for a scope?
This needs to be set, when a variable is shared across the branches of a parallel shape.

70. In an Orchestration design, Orchestration "A" calls another Orchestration "B", and vice versa. Is it possible to implement this design?
It is NOT possible, since it forms a cyclic dependency.

71. List out the three important things to consider while designing a BizTalk orchestration!
The Incoming data format, The Business process and The Outgoing data format.


Biztalk interview questions 2004/2006/2010 Part :2



Biztalk interview questions :
Part 1

Part 3

Part 4

22. Is there a way to limit the number of active instances of a given orchestration?

BizTalk Server 2004 has no built-in mechanism for controlling the number of instances of a given orchestration. The BizTalk Server engine does its own throttling to maximize system throughput.
If you need to control the number of active instances because of external resource constraints (for example, availability of database connections), then the orchestration must does its own access control? Typically you do this by implementing a singleton or a fixed number of resource-controller orchestrations that dispense access to the resource.
Perhaps the simplest example of instance control is as follows: You want to control the number of instances of orchestration A that are doing work. Orchestration B is the singleton resource dispenser. On activation, A sends a request to B. B reads the request, determines if this new A can execute now, and returns a reply: yes or no. A reads the reply. If the reply is no, A delays for a period of time and then requests again. If the reply is yes, A executes. At completion, A sends another message to B telling B that it is finished.
As stated above, this is a simple example. In practice, you might need something more complex. More abstractly, you need to control the rate at which messages are activated to better match the rate that activated instances can complete their processing.

23. How can I share global variables across all instances of a given orchestration?
There is no easy way to share global variables across all instances of an orchestration. If the global variables are static values, you might consider storing them in a persistent storage, such as a configuration file or SQL database, and allowing each instance to get the values from storage. You can also share a static state in user code as long as locks are placed correctly on access and modification of the shared state.

24. Why is my orchestration instance suspended with the status of "Completed with Discarded Messages"?
"Completed with Discarded Messages" is one of the states an orchestration instance may end with. A message that is discarded in this way is called a "zombie" and typically occurs when an extra message is routed after control flow in the executing orchestration has passed the Receive shape with the matching subscription. This can be due to a time-out on a long-running transaction or a time-out of a Delay branch on a Listen shape. It can also occur in a loop that contains a Receive shape that exits before consuming all routed messages.
You can use a Windows Management Instrumentation (WMI) method to listen to the suspend events, find the message associated with the orchestration instance, and resubmit the message.

25. Many messages end up with the status of "Delivered Not Consumed" in HAT. Should I be concerned with them and where should I look?
A message is in the "Delivered Not Consumed" state when it is in the BizTalk Server internal work queue. It might be in this state because the engine is busy with other messages, or because the message destination is processing more slowly than expected.
You first need to determine where these messages are going: to the orchestration or to the send port. In HAT, you can figure this out by looking at what service the "delivered not consumed" references are associated with. Then you can check whether the destination orchestration or the send port is working correctly.

26. Why does the compiler require my variable to be serializable?

The XLANGs runtime may persist to the database (dehydrate) your orchestration, including all of its data, at any point (except in the atomic scope). When the orchestration dehydrates and rehydrates, user-defined variables are binary serialized and deserialized. In most cases, you need a serializable object. A non-serializable object can only be declared and used in an atomic scope. The XLANGs compiler gives you compilation errors if you try to use a non-serializable data type outside of an atomic scope.
Message definitions, whether with .NET types or with actual message types, require that the .NET types be XML serializable (for example, System.IntPtr cannot define a message), and that all the message parts (in the message type) be defined through either XML-serializable .NET types or schema types.

27. My object is serializable and implements an interface. When I try to access my object in an Expression shape of a non-atomic scope, the compiler complains that my object is non-serializable. Why?
Interfaces cannot be marked serializable, nor can you assume that they are serializable, because you never know how they are implemented. Therefore, XLANGs treats interfaces as non-serializable. Non-serializable objects must run inside atomic scopes. This is why interface-based programming must be done inside an atomic scope. In fact, in .NET, you cannot declare an interface to be serializable.

28. How does an orchestration invoke a COM/COM+ component?
XLANG generates C# code. All user-declared XLANGs variables are generated as C# variables. There is no special behavior except in the case of atomic transactions. When a serviced component (that is, an instance of a class that implements System.EnterpriseServices.ServicedComponent) is declared in an atomic scope, then and only then does XLANGs generate and use a real DTC COM+ transaction.
If a variable is referenced as an L-value (that is, it is written to) in the atomic scope, but is declared in an outer scope, the variable is cloned to support rollback. However, an object (such as an XmlDocument) can be modified inside a .NET function call when passed as an in-parameter, and thus XLANGs will miss that the object is being written to and it will not roll back correctly. The workaround in this case is to pass such objects as ref parameters.
The bottom line is that components should behave as they do in other C# programs.

29. Why doesn't my atomic transaction retry? How does the atomic transaction retry work?
An atomic transaction retries when a RetryTransactionException is deliberately thrown by the user or when a PersistenceException is raised at the time that the atomic transaction tries to commit. The latter could happen if, for example, your atomic transaction was part of a distributed DTC transaction and some other participant in that transaction aborted the transaction. Likewise if there were database connectivity problems at the time when the transaction was trying to commit, a PersistenceException would be raised.
There can be several root causes for PersistenceException, depending on the situation, but what you generally observe is that all the XLANGs actions in your atomic scope seem to go through correctly, but then instead of committing, the scope fails. If that happens for an atomic scope that has Retry=True, then the atomic scope will retry up to 21 times. The delay between each retry is two seconds by default (but you can modify that value). After 21 retries, if the transaction is still unable to commit, the whole orchestration instance gets suspended. Then you can manually resume it and it will start over, with a fresh counter, from the beginning of the offending atomic scope.
Note that only two exception types can cause an atomic scope to retry: RetryTransactionException and PersistenceException. Any other exception raised in your atomic scope cannot cause it to retry, even if you have the Retry property set to True. If you're having trouble trying to figure out why an atomic scope isn't retrying, double-check the exception type.
You can override the two-second default delay between consecutive retries by using a public property on RetryTransactionException (if that's the exception you're using to cause the retries).

30. Does orchestration support parallel activation?
Parallel-activating Receive shapes do work under the following conditions:
1. If one of the tasks of a parallel activation has an activatable Receive as the first shape, all of the tasks of that parallel activation must have an activatable Receive as the first shape, and all of those Receive shapes must initialize at least one correlation.
2. If a particular correlation is initialized on more than one task of a parallel activation by a Receive shape, each of the concerned activating Receive shapes must initialize exactly the same correlation.
This is the parallel convoy case. It is the only parallel activation that XLANGs supports.

31. Why do I sometimes get "could not find subscription error" when I send a message from the parent orchestration to the child orchestration, which was just started by the parent?
This is a race condition. Apparently you expect that the new orchestration will start in time to create the necessary subscriptions to receive the messages that will be sent to it. But you have no idea how long it will take to create the orchestration, because starting a new service is not a synchronous operation.
It would be better to have the newly created orchestration send a message back to its parent orchestration, reporting that it has started. Then have the new orchestration listen for its messages. In this scenario, the parent orchestration knows that there is a receiver for the messages before sending them. This also provides the necessary commit point to get the subscription to the MessageBox database.

32. How can I get context or other promoted properties from XLANGMessage?
In an Expression shape, you can use yourMessage(propertyName), for example, yourMessage(BTS.MessageID). However, if you want to access message properties from the XLANGMessage interface (for example, from user code), you would use the XLANGMessage methods SetPropertyValue and GetPropertyValue. You cannot use a context property for routing unless the property is in a correlation that is either initialized or followed in a Send shape.

33. I attach a dynamic send port to a logical port with Delivery Notification = Transmitted. However, the runtime does not seem to deliver any delivery notification. What is going on?
Dynamic ports are not designed to inherit all attributes and characteristics of the port whose address is assigned to the dynamic port. A dynamic port just gets an address, which is analogous to casting a void* pointer in C/C++ to a more structured pointer type. The pointer that initialized that address has had all its information stripped away. The XLANGs runtime only listens for delivery notification if the port is statically set up that way.

34. How can I perform dynamic transform in XLANGs?
You can use construct/transform code inside an Expression shape, to make it possible to assign the map dynamically. The code inside the Expression shape is similar to the following:
mapType = System.Type.GetType(mapName);construct Out_msg{ transform(Out_msg) = mapType(In_msg, In2_msg);}

36. I changed some message fields inside an Expression shape. However, when I send the message out, I do not see the updated values. Why?
In BizTalk Server, the messages are immutable. You can use a Construct shape to create a new message. Copy the original message to the new message and update the fields on the new message.

37. The orchestration calls a Web service with the SOAP send adapter and receives the response. When an exception occurs, the orchestration service is suspended with "Suspended (not resumable)". How can I retry the Send?
You can place the SOAP Send inside a scope with an exception handler and let the exception handler catch the resulting SoapException. Then you can retry the SOAP Send by nesting the scope inside a while loop.

38. What parameters control dehydration?
Three parameters control dehydration in BTSNTSvc.exe.config: MaxThreshold, MinThreshold, and ConstantThreshold. These work as follows:
MaxThreshold is the maximum time that a dehydratable orchestration is retained in memory before being dehydrated.
MinThreshold is the minimum time that a dehydratable orchestration is retained in memory before it is considered for dehydration.
Note
MaxThreshold and MinThreshold are upper and lower bounds for time-to-dehydration. The true time-to-dehydration fluctuates between the MinThreshold and MaxThreshold values. It takes into account both the history of how long it took that subscription to dehydrate in the past and stress/throttling
ConstantThreshold is used to attempt to ignore the throttling implication in deciding when to dehydrate. Changing this parameter is not recommended. -1 is the default value, and it tells the engine not to use a constant threshold.
History is used as follows in determining time-to-dehydration: Recycling the BizTalk service process resets the history. The history is kept parameterized by subscription; therefore, the history of a given Receive is independent of orchestration instance. The first time a subscription is seen, there is no history, so BizTalk Server chooses to dehydrate immediately. After the first dehydration, BizTalk Server uses the history.
The default for MaxThreshold is 30 minutes and the default for MinThreshold is one second. The default dehydration threshold is 30 minutes. With resource pressure this scales down to as little as MinThreshold. When a Receive blocks, BizTalk Server looks up past blocking times of this Receive for every instance of this orchestration and creates an estimate of how long it will take to receive a message to unblock. If this estimate is greater than the dehydration threshold, then BizTalk Server dehydrates. The first time through the loop with a single instance, there is no history so BizTalk Server dehydrates immediately.
BizTalk Server 2004 and BizTalk Server 2006 differ as follows:
In BizTalk Server 2004 only: If the history of a subscription across other instances has satisfied the subscription in less time than MaxThreshold, then BizTalk Server waits without dehydrating at that subscription forever or until it is satisfied.
In BizTalk Server 2006 only: BizTalk Server dehydrates if it has been waiting at any subscription with a non-empty history for more than 2*MaxThreshold.

39. When does the persistence of an orchestration happen?
Guaranteed persistence is at end-of-transaction (EOT), Send, and Suspend. Delay or Receive only persists if dehydration occurs. When end-of-service (EOS) or Terminate occurs, there is not a commit of any pending database operations, but the instance state is not persisted.
Commit points are optimized away in the following patterns:
· Two or more EOTs collapses to a single commit.
· One or more EOT followed by EOS collapses to a single commit.
· A Send followed by EOT or EOS collapses to a single commit. For example, Send immediately followed by EOT immediately followed by EOT immediately followed by EOS is a single commit. However, some potential optimizations are missed, for example, "Send, Send, Send, EOT" is three commits because we only coalesce a single "Send, EOT". Similarly, "Send, EOT, Send, EOT" is two commits.
On graceful shutdown BizTalk Server attempts to dehydrate and thus persist all orchestrations in memory. This is not always successful; sometimes orchestrations are not dehydratable and so the process ends without performing all the dehydrations. If this happens, the orchestration is restored on restart from the last persisted point.

40. How can an orchestration be updated without bringing down the BizTalk Server host?
To update an orchestration
1. Change the AssemblyInfo version number of the orchestrations, and then build and deploy the new assembly.
2. Bind the new orchestrations.
3. Manually perform the following steps:
a. Disable the receive location to temporarily prevent new messages from arriving. Of course, this implies that your service is unavailable to the outside world.
b. Unenlist the old version using BizTalk Explorer (do not stop it). This prevents new instances from starting while allowing old ones to finish.
c. Enlist the new version and start it. All new instances will be created using this one.
d. Enable the receive location.

41. How can I load a message to construct an XLANGMessage?
When constructing an XLANGMessage with a stream, the stream type must either implement IStreamFactory or else be a MemoryStream. The following code sample shows how to construct an XLANGMessage:
public class FileStreamFactory : IStreamFactory
{
string _fname;

public FileStreamFactory(string fname)
{
_fname = fname;
}

public Stream CreateStream()
{
return new FileStream
(
_fname,
FileMode.Open,
FileAccess.Read,
FileShare.Read
);
}
}

public static void AssignStreamFactoryToPart(XLANGMessage msg)
{
IStreamFactory sf = new FileStreamFactory( @”c:\data.xml” );
msg[0].LoadFrom( sf );
}

42. How can I make an orchestration output a string without any XML tags?
An orchestration always wraps the System.String string as an XML document when sending it out. For example, the following is the output of the string "mystring: from an orchestration:
mystring

to get a simple string without any XML tags, you need to define a custom-formatted part that serializes to raw text.
The following code shows an example of how to define a type that can be used in place of System.String to define such an XLANGs message part:
public abstract class BaseFormatter : IFormatter
{
public virtual SerializationBinder Binder
{
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
}

public virtual StreamingContext Context
{
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
}

public virtual ISurrogateSelector SurrogateSelector
{
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
}

public abstract void Serialize( Stream stm, object obj );
public abstract object Deserialize( Stream stm );
}

public class RawStringFormatter : BaseFormatter
{
public override void Serialize(Stream s, object o)
{
RawString rs = (RawString)o;
byte[] ba = rs.ToByteArray();
s.Write( ba, 0, ba.Length );
}

public override object Deserialize(Stream stm)
{
StreamReader sr = new StreamReader( stm, true );
string s = sr.ReadToEnd();
return new RawString( s );
}
}

[CustomFormatter(typeof(RawStringFormatter))]
[Serializable]
public class RawString
{
[XmlIgnore]
string _val;

public RawString(string s )
{
if (null==s)
throw new ArgumentNullException();
_val = s;
}

public RawString()
{
}

public byte[] ToByteArray()
{
return Encoding.UTF8.GetBytes( _val );
}

public override string ToString()
{
return _val;
}
}



Monday, August 8, 2011

Biztalk interview questions 2004/2006/2010 Part :1


Biztalk interview questions :
Part 2
Part 3
Part 4


What is BizTalk?
  • Biztalk is a messaging based integration tool.
  • Bonus: It consists of several different pieces including Business Processes (Orchestrations), BAM, Rules Engines, and HAT.
In BizTalk 2002, schemas were DTD based and allowed Xml Elements to be in any order inside a record using the <Any> keyword.  How is this different in BizTalk 2004?
  • BizTalk 2004 is XSD based.
  • BizTalk 2004 Elements default to <Sequence> and <Any> is no longer available.
What is a Message Type (i.e. BTS.MessageType) and how is it used in BizTalk?
  •  Message Type is a BizTalk System property that is promoted inside a Pipeline.  It is made up of Document Name Space # Root Node Name.
How do you call a Non-Serializable .Net helper class inside an Expression Shape?
  • Add a reference to that class.
  • Make sure your Orchestration is Long Running transactional.
  • Add an Atomic scope.
  • Create an Orchestration variable of that class inside the scope.
  • Create an instance on that object inside the scope.
  • Call the method.
  • Bonus: Mention the class must be strongly signed and in the GAC.
What if the class is Serializable?
  • No transactional Orchestration or Atomic scope is needed.
What does the Value Mapping Functoid do?
  • Returns the second parameter if the first parameter is true
How do you use Auto Mapping in the BizTalk 2004 mapper?
  • Select a top level node, hold down the Shift key, drag the top level node over to the other top level node.
What is the default mapping for Auto Mapping?
  • The default is by structure.  This can be change to by node name on the map properties. (This default in the auto map messes me up every time.)
Step-by-step, how do you set up a basic, pure messaging solution taking in a flat file and send an Xml File out to 5 different places?
  • Create a Flat File schema
  • Create a Custom Pipeline using the Flat File Disassembler
  • Create a Receive Port
  • Create 5 Send Ports
  • Create a Send Port Group
  • Add each Send Port to the Send Port Group
  • Create a Filer on the Send Port Group using Bts.ReceivePortName (or something close to this)
  • Additional: no map is required but it is ok to mention it
How do you achieve First-In-First-Out message processing of messages received from multiple sources using an Orchestration?
  • Use a Sequential Convoy to process the messages in the order they are received into the Message Box. 
  • Make sure Ordered Delivery is set to True inside the Orchestration Receive Port.
At high level, what do Receive Ports and Orchestration Send Port really do in terms of messaging?  What about Send Ports and Orchestration Receive Ports?
  • Receive Ports and Orchestration Send Port are both publishers.
  • Ports and Orchestration Receive Ports are both subscribers.
When working with Schemas, Maps, Pipelines, and Orchestrations how should the projects be structured?
  • Schemas and Maps in its own project
  • Or Schemas and Maps together in its own project
  • Orchestrations in its own project
  • Pipelines in it own project
What is direct binding?
  • Direct binding has three types: direct to message box, self correlating, and partner ports.
  • Used to route message between the message box and Orchestrations without using bindings or from one Orchestration to another Orchestration.
What is BAM used for?
  • BAM is used to monitor business milestones and key metrics in near real-time throughout a process in BizTalk.
What is the Rules Engine?
  • Rules are used to provide highly efficient, easily changeable business rules evaluation to Business Processes.  This allows rules to be changed without rebuilding and redeploying .net assemblies.  The Business Rules Engine (BRE) can also be called from any .net component through the API’s.
What are Persistence Points and what causes them?
  • Persistence is when the state of a running Orchestration is stored into SQL.
  • It is good enough to know various shape and actions cause persistence.  More specifically, it occurs: end of a transactional scope, at a send shape, at a start Orchestration shape, during dehydration, if the system shuts down expectedly or unexpectedly, or the business process suspends or ends.

What is Compensation?

  • Most of us are aware of an Atomic transaction, which can either be committed or rolled back. A Long Running (L-R) transaction is one which executes for several hours, days or even weeks and contains several atomic transactions. These smaller atomic transactions which are completed/committed cannot be rolled back and hence need to be compensated. This undo operation which consists of deleting a record, in the case of an insert operation is known as Compensation and such a transaction is known as a Compensatory Transaction
 Platinum 4-Prong Natural Diamond Stud Earrings (F-G, VS2, 1.50 cttw)-Certificate of AuthenticityPrincess Cut Diamond Engagement Ring and Wedding Band Set 2 Carat (ctw) in 14K White Gold

What group does a user need to belong to in order to submit messages to the message box? 
  • The user needs to be a member of the hot group or isolated host group (assuming a default installation).
 What user rights to you need to perform most actions in HAT?
  • BizTalk Server Administrator
When installing Biztalk in a multi-server configuration with a remote SQL and Analysis Services, what SQL components do you need on the Biztalk Server?
  • SQL Analysis Services Client Tools
When installing Biztalk and SQL on a Windows XP SP2 Desktop, what pre-requests are required?
  • Correct answer: A Lot.  The best answer something like I have a custom written installation document I use or I always referrer to the most current updated installation guide from Microsoft.