Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Use variable in a map?
- This topic has 6 replies, 1 voice, and was last updated 7 years, 4 months ago by community-content.
-
AuthorPosts
-
-
August 31, 2010 at 2:10 AM #25805
Hi there.
I have a map with more than one page. Now I need a value which I get after using some funtoids in page 1 and I need it in page 2 and 3. Is there a way to build a variable to get access to this value from page 2 and 3?
Thanks in advanced.
Wolfgang
-
August 31, 2010 at 4:48 AM #25808
this could be a solution :
you can realize all you mapping with the BizTalk Mapper, then you right-clic on the map and choose validate to access the generated xsl and extension object.
Then you can modify you xsl to use the result of you some functoid for the other.
I’m not sure you can realize what you want with the Mapper and there may be some tips but i’m not sure it will be keep if you decide to change one thing in the map (because the mapper generatevariable name)
-
August 31, 2010 at 5:32 AM #25811
A simple method would be to use C# scripting functoids:
One page one have a C# scripting functoid with this code:
string globalVariable = null;
public string SetVariable(string param)
{
globalVariable = param;
return param;
}Then on page 2 add a C# scripting functoid
public string GetVariablePage2()
{
return globalVariable;
}And on page 3
public string GetVariablePage3()
{
return globalVariable;
}-
August 31, 2010 at 9:41 AM #25825
Hi.
Thanks for your helps and tips. Nice to know there are some more ways to go! 😉
First I tried the way with the “globalVariable” – but I didn’t get the value of the variable to another page. I did it like greg wrote and used it in another scripting functoid on page 2. The compiler didn’t brought an error because of the “new” variable in the code, so I know the variable was recognized in the code. I will do some further checks, why the variable will loose the value if I use it an page 2…
But thanks again for your help so far.
Wolfgang
-
September 1, 2010 at 9:18 AM #25842
Please correct me if I’m wrong, but as I understand it BizTalk maps execute by building the destination from the top down. I would suggest linking the script functoid that sets the global variable on page 1 to the root node of the destination schema to ensure that it executes prior to any other node.
-
September 1, 2010 at 9:48 AM #25844
Hi.
Yes, a good idea. I will have a look at it.
Thanks a lot.
Wolfgang
-
-
-
March 10, 2016 at 6:09 AM #26561
Hey i found this 5 years later and it still works, thank you 🙂
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.