Geeks With Blogs
mipsen

Imagine a huge BizTalk-project. Loose coupling has been taken very seriously and a lot of this is done via the MessageBox and subscriptions. Very complex workflows are distributed over lots of Orchestrations. Commands in the messages tell the system which Orchestration to call next, which backend-system to call, etc. Nice... :-)

Then one day during developer-testing something strange happend. We started a process with Command_A. We inspected the progress of our Workflow-Armada in DebugView. It started out normally like "Start processing. Command_A". Then the next Orchestration started and it was the wrong one: "Start Processing. Command_B", but we expected it to be Command_Y! But it started getting better: After processing the wrong Command_B the Orchestration to cal the backend-system started and told us: "Invalid Command: Command_C". Our first reaction was: "What!?!?!". We spent a long time searching where the wrong commands were set, examining all Orchestration-paths and helpers. Nothing. It should have worked. We took another test-system. It worked as expected, but we were able to reproduce the strange behaviour on the main-system.

After a while the penny dropped: The commands were defined in an Enum. We thought we were fine, because we added numbers explicitly to the commands (like Command_A = 456). But someone had included new commands just in the middle of our existing commands without definfing numbers. So the index of the enum was not correct. We had to recompile the whole lot (enums are included in the IL of the classes using them) and it worked again. What a day... ;-) 

 

Posted on Wednesday, February 24, 2010 8:46 AM .NET | Back to top


Comments on this post: Enum Fun

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © mipsen | Powered by: GeeksWithBlogs.net