开发者

Biztalk - local variable in expression shape

开发者 https://www.devze.com 2022-12-26 23:09 出处:网络
Sometimes when I\'m writing XLANG/s code in an expression shape, it would be more readable if I could just use a temporary variable within the scope开发者_如何学JAVA of that one code block.I hate to c

Sometimes when I'm writing XLANG/s code in an expression shape, it would be more readable if I could just use a temporary variable within the scope开发者_如何学JAVA of that one code block. I hate to clutter up the entire orchestration with a variable declaration. Is there a way to declare a variable within an expression shape?


So, it appears that the correct way to do this is to use a scope shape and to put the expression shape inside it. You can set the scope shape's transaction type to "None" if you don't need any special transaction handling. The scope shape can have variables associated with it (or messages or correlation sets), and they are visible only to the shapes within it.

If you check out the XLANG/s code that's generated when you use a scope shape you'll see it uses a scope keyword. It turns out that you can put the same code within your expression! So you'd do something like this:

scope
  {
  System.String tempString;

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

精彩评论

暂无评论...
验证码 换一张
取 消