Yossi Dahan [BizTalk]

Google
 

Friday, June 23, 2006

Wish list: setting context properties to null

I wish it was possible to set a context property to null.
If you try to do that now an exception is thrown (and the property is not set)

This is somewhat related to my other wish list post from today about being able to use decision shpae inside a construct message.

But basically - say you need to set a context property to a value only if a certain condition applies. if you could have a decision shape inside the construct container that would not be an issue, but since you can't the only way to do that is to pass your message together with whatever information you need to make the decision to a .net method in an external assembly that will make the decision and if needed use the message API to write to the message context.


Another approach I hoped would work (again - ignoring the decision shape option) is to call an external method to make the decision and have it return the value to set or null (if there's nothing to promote).

This would make perfect sense as even currently - if you try to read a context property that does not exist - you get a null reference. so it follows the same idea of a null proeprty value when not set. (which, btw - is a pain by its own)
This would also help us avoid needed all those nasty references

But evidently - you cannot assign a null value to a context property, so that does not help.

0 Comments:

Post a Comment

<< Home