Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
Recently I implemented a BizTalk web services interface that required the need to support SoapFault messages. I quickly fell into a common trap and received a compiler error:
error X2162: must receive before sending a fault message on an implemented port
(see Scott Colestock's post that nicely outlines his experience with the same issue)
As Scott describes, the solution involved using the succeeded() function to first test if a transaction scope had succeeded or not in order to send out my soap-fault correctly. I vaguely recalled this function but never used it in anger before. After having spent a hour or so I will never get back, I made a note-to-self to seek out and reacquaint myself with the other operators and functions available to use in expression shapes within an orchestration.
Here is the full list taken from the online documentation:
Operator
Description
Example
checked()
raise error on arithmetic overflow
checked(x = y * 1000)
unchecked()
ignore arithmetic overflow
unchecked(x = y * 1000)
new
create an instance of a class
myObject = new MyClass;
typeof
Type retrieval
myMapType = typeof(myMap)
succeeded()
test for successful completion of transactional scope or orchestration
succeeded(<transaction ID for child transaction of current scope or service>)
exists
test for the existence of a message context property
BTS.RetryCount exists Message_In
+
unary plus
+(int x)
-
unary minus
-(int x)
!
logical negation
!myBool
~
bitwise complement
x = ~y
()
cast
(bool) myInt
*
times
Weight = MyMsg.numOrders * 20
/
divided by
x / y
plus
x + y
minus
x - y
<<
shift left
x << 2
>>
shift right
x >> 2
<
less than
If (MyMsg.numOrders < 10)...
>
greater than
If (MyMsg.numOrders > 10)...
<=
less than or equal to
If (MyMsg.numOrders <= 10)...
>=
greater than or equal to
If (MyMsg.numOrders >= 10)...
==
equal to
If (MyMsg.numOrders == 10)...
!=
not equal to
If (MyMsg.numOrders != 10)...
&
and
If (myByte & 255)...
^
exclusive or
If (myByte ^ 1)...
|
or
If (myByte | 1)...
&&
conditional and
If (MyMsg.numOrders > 10) && (MyMsg.numOrders < 100)
||
conditional or
If (MyMsg.numOrders < 10) || (MyMsg.numOrders > 100)
//
commenting
Since then, this little exercise has helped in a few occasions, particularly the need for the exists function when working with optional property schema fields.
I knew I should of read the manufacturers instructions
Remember Me