|
Home > Archive > BizTalk Server General > March 2005 > Need help with expression
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Need help with expression
|
|
| Dean Cyril Wood 2005-03-01, 7:47 am |
| I have come across a strange situation in the way an expression is evaluates
and am hoping someone out there has some feedback.
I have a decide shape and need to have an expression evaluate to true only
under certain conditions and false under all other.
- The decide shape expression evaluates 3 tags.
- there is no guarantee that all 3 tags exists. If they exist then they can
be either null or non-null.
- Only the following situations need to evaluate to true
- all 3 tags exist and are NULL
- all 3 tags exist and have the same value.
- all other conditions should evaluate to false.
I currently have the following expression "ReceiveDOCBO.SellingCountry ==
ReceiveDOCBO.ShippingCountry && ReceiveDOCBO.SellingCountry ==
ReceiveDOCBO.CustomerCountry)
What I found is that if one of the tags do not exist the expression
evaluates to true if the other two tags exist and have the same value. I need
this to evaluate to false.
I tried understanding how BizTalk deals with an expression like I have above
when one or more of the reference tags are missing from message. Does it drop
that part of the expression where a non-existing node is referenced?
Any ideas/explanations?
Any suggestions on how I can get the expected results? I tried finding
expressions that I can use to test whether or not a node exists but have not
found one yet that I can use in an expression (other than in a receive shape
which I cannot use).
thanks,
Dean Cyril Wood
| |
|
| Try abstracting the problem into orchestration variables (string), cast your
data into those string variables, convert the values to "" or " ", some
identifier
Then evaluate the orchestration variables instead of your data, in essence,
remove null from your equation.
cheers
"Dean Cyril Wood" <DeanCyrilWood@discussions.microsoft.com> wrote in message
news:C9911FF3-A03C-446F-868A-32E2902E46B9@microsoft.com...
>I have come across a strange situation in the way an expression is
>evaluates
> and am hoping someone out there has some feedback.
>
> I have a decide shape and need to have an expression evaluate to true only
> under certain conditions and false under all other.
>
> - The decide shape expression evaluates 3 tags.
> - there is no guarantee that all 3 tags exists. If they exist then they
> can
> be either null or non-null.
> - Only the following situations need to evaluate to true
> - all 3 tags exist and are NULL
> - all 3 tags exist and have the same value.
> - all other conditions should evaluate to false.
>
> I currently have the following expression "ReceiveDOCBO.SellingCountry ==
> ReceiveDOCBO.ShippingCountry && ReceiveDOCBO.SellingCountry ==
> ReceiveDOCBO.CustomerCountry)
>
> What I found is that if one of the tags do not exist the expression
> evaluates to true if the other two tags exist and have the same value. I
> need
> this to evaluate to false.
> I tried understanding how BizTalk deals with an expression like I have
> above
> when one or more of the reference tags are missing from message. Does it
> drop
> that part of the expression where a non-existing node is referenced?
>
> Any ideas/explanations?
>
> Any suggestions on how I can get the expected results? I tried finding
> expressions that I can use to test whether or not a node exists but have
> not
> found one yet that I can use in an expression (other than in a receive
> shape
> which I cannot use).
>
> thanks,
>
> Dean Cyril Wood
>
|
|
|
|
|