Wednesday, October 6, 2010

Exception handling in Orchestrations

Exception handling in Orchestrations

I am
At this post I would like to explain error handling in orchestrations and show how to make it with divide by zero exception.

1. first of all create new scope which will be the equivalent to tryin .NET
2. add expression to scope
3. set expression to
V = 6;
V = 5 / (6-V); // this line with throw divide by zero exception
where V is a decimal variable in orchestration
4. Right click on the scope and add exception block
5. Set
Exception Object Type to System.ArithmeticException
Exception Object Name to Ex
6. In exception block add Construct Message shape which will hold error description
7. Add Message Assignment shape to Construct Messageshape
8. Set assignment expression to
Message_3 = new System.Xml.XmlDocument();
Message_3.LoadXml(""+Ex.Message+"");
9. After Assignment shape insert Send shape which will sendMessage_3 to any location (FILE) you would like


No comments: