XLANG-s Variables and Operators


This section discusses the variables and operators used in the XLANG/s language.

Variables represent storage locations. Every variable has a type that determines what values can be stored in that variable. XLANG/s is type-safe, and its compiler guarantees that values stored in variables are always of the appropriate type. XLANG/s supports the following variable types:

  • Messages

  • Correlation sets

  • Service links

  • Ports

  • Distinguished built-in value types: Boolean, Byte, Char, Decimal, Double, Int16, Int32, Int64, SByte, Single, String, UInt16, UInt32, and UInt64

  • Objects

  • Enumeration types

XLANG/s provides initialization semantics for each of the preceding types. Such initialization can be viewed as an assignment to a variable of that type. In XLANG/s, a variable must be definitely assigned before its value can be obtained or used.

XLANG/s supports the following operators. They adhere closely to the functionality of the corresponding operators in C#.

checkedRaises error on arithmetic overflowchecked(x = y * 1000)
uncheckedIgnores arithmetic overflowunchecked(x = y * 1000)
newCreates an instance of a classmyObject = new MyClass;
typeofRetrieves a typemyMapType = typeof(myMap)
succeededTests for successful completion of transactional scope or orchestrationsucceeded(<transaction ID for child transaction of current scope or service>)
existsTests for the existence of a message context propertyBTS.RetryCount exists Message_In
+Unary plus+(int x)
-Unary minus-(int x)
!Logical negation!myBool
~Bitwise complementx = ~y
()Cast(bool) myInt
*TimesWeight = MyMsg.numOrders * 20
/Divided byx / y
+Plusx + y
-Minusx - y
<<Shift leftx << 2
>>Shift rightx >> 2
<Less thanIf (MyMsg.numOrders < 10)...
>Greater thanIf (MyMsg.numOrders > 10)...
<=Less than or equal toIf (MyMsg.numOrders <= 10)...
>=Greater than or equal toIf (MyMsg.numOrders >= 10)...
==Equal toIf (MyMsg.numOrders == 10)...
!=Not equal toIf (MyMsg.numOrders != 10)...

XLANG-s Data Types
XLANG-s Statements
XLANG-s Expressions
XLANG-s Reserved Words
XLANG-s to BPEL4WS Type Conversions

Community Additions