div #techmela a:link
text-decoration:none;}div #techmela a:visited
text-decoration:none;}div #techmela td
I was told that I write when i am upset. Well this time im not upset :). More or less in thought. I have been lucky. This is a very relative statement and it greatly depends on your frame of mind.
I have seen that you or me is just one person in this world and we can only make a difference to just a few more people in this world. What others say like you change lives etc is a very debatable statement. Eg . Charles Babbage didnt invent the analytical engine so that he would change the life of millions. That would only be an ego boost but the prime purpose is to satisfy the craving in oneself.
The only lives he managed to affect were probably limited to his family and some close friends and nothing more. His inventions are acts and these are only changes could have been done by anyone . I personally dont care if he or a freaking alien came up with it as the person is not important and only his act. I say this cause currently this is been a hot topic of discussion.
So with that being said I have pretty much understood that your acts might matter to some people but you arent born to change the world.
Now this doesnt mean you are not important. This means that you understand your importance is limited to a few and once you have realized that then you are at peace. You do what you want to do but you should never forget what you do might be missed even by the ones who are closest to you.
I believe the pursuit of happiness is not a pursuit but a state of mind and being lucky is also the same. A lake in the dessert has more importance not by virtue of it being a lake but only because of the dessert. So if your lucky its only cause your mind feels that everything else inspite of it being barren land has still found some water.
I have a family and things anyone could ask. I wish to think I am lucky. But i crave to get out of the dessert or atleast forget about the desert like i used to before.
When a workflow runs an activity and that activity throws some kind of unhandled exception you would notice that your workflow get terminated. I have see in many articles that explain how the termination happens. Now this is fine only for a rare set of hello world scenarios. When it comes to an enterprise application we usually expect to notify that some error has happened and probably redo our work.
Now if the workflow terminates how the heck are we supposed to re-execute the workflow cause its already terminated right and you get the “Workflow not found in persistence store” when you use a store like SQL . Now this happens when our activity doesn’t have a fault handler associated with this it. So one of the solutions we tried for state machine error handling was this.
- View the FaultHandlers in the event driven activity in the state.
- Add a new Fault activity and set the fault type to System.Exception (this is to capture generic faults and nothing fancier) you can customize this but then again we are trying to avoid workflow termination here.
- in the fault handler use a CallExternalMethodActivity.
- How to catch the exception – You can promote the Fault property as a dependency property. Another easy way would be to call a methodInvoked(ie the method to be executed before the callExternal method is invoked) and in that access the exception as the fault property in the parent of the callExternalMethodActivity.
- You can then pass on what ever data you get to the external method.
I believe there are many more ways of fault handling. I even know of cases where customers hacked the stored procedure of Insertworkflow to avoid workflow deletion on termination.
Anyway this is just on of the easier ways out to clean up incase you have better practices do leave a link