Biztalk - local variable in expression form

Sometimes, when I write XLANG / s code in expression form, it would be more readable if I could just use a temporary variable within that one code block. Hate to clutter up all the orchestration with variable declaration. Is there a way to declare a variable in expression form?

+2


a source to share


1 answer


So it seems like the correct way to do this is to use a scope form and put the expression form in it. You can set the transaction type of the form to "None" if you do not need special transaction handling. An area shape can have variables (or messages or correlation sets) associated with it, and these are only visible to the shapes within it.

If you look at the XLANG / s code generated when using the region form, you can see that it uses the keyword scope

. It turns out you can put the same code in your expression! So, you would do something like this:



scope
  {
  System.String tempString;

  body
  {
    tempString = someCalculation;
    // etc.
  }
}

      

+6


a source







All Articles