Global Variable & Local Variable in Orchestration

zhaozj2021-02-16  104

In the Orchestration View, global variables and local variables can be defined for the Orchestration

The variable added in the Variables of Orchestration View is global variable. This variable can be int, string system type, or it can be .NET Class type; this variable can be used in any expression editor of the Orchestration. If it is .NET Class Type, the value of this variable can be used directly without creating NEW, BizTalk will initialize the variable when it is used for the first time, and it is necessary to note that the .NET Class is required to be used in the XLANG. Net Class must be [Serilizable], the Assembley where the Class is located must be deployed to the GAC to be used by BizTalk.

EG:

Using system; using system.xml;

Namespace microsoft.samples.biztalk.mathlibrary {[serializable] public class mathhelper {public mathhelper () {}

Public Int Add (int A, int b) {RETURN A B;}

Public int subtract (int A, int b) {RETURN A-B;}}

Public class helper {private helper () {} public static xmldocument constructdoc (int isum) {xmldocument doc = new system.xml.xmldocument (); doc.loadXML ("

http://methodcallsample.outputschema/>>

xmlns = / "/"> " isum.tostring () "

"); RETURN DOC;

}}}

After compiling and deploying the above Class, BizTalk can reference the DLL and select the Microsoft.Samples.bizTalk.mathlibrary.MathHelper type when creating a variable, you can use the object provided in Xlang.

Local variables can be defined in each transaction (Scope Shape) in Orchestration, which is only valid within the transaction. The method used to use with global variables


New Post(0)