Home Page › Forums › BizTalk 2004 – BizTalk 2010 › How to fill a field in a schema with a variable?
- This topic has 6 replies, 1 voice, and was last updated 9 years, 1 month ago by
community-content.
-
AuthorPosts
-
-
August 12, 2010 at 1:09 AM #25611
Hi.
In an expression shape of an orchestration I have a variable.
After different kind of shapes and mappings in the orchestration I want to fill a field of the last mapping schema with this variable. Is this possible? Can I do this with a functoid or do I have to programm this?
Thanks in advance for your tipps and help.
Wolfgang
-
August 12, 2010 at 8:00 AM #25614
Hi Wolfgang,
If that field of the last mapping schema is a promoted property, you can assign it the variable in a Message Assignment shape. If not, you can use an XPath expression on your message to assign the variable to that field in an Expression shape.
Daniel.
-
August 13, 2010 at 4:18 AM #25625
Hi Daniel.
Unfortunately the field is not a promoted protery, so I have to use XPath. It tried to fill an attribute called “Mandant” in the node “customer”. But I always get the xml file without the attribute. It is just the “customer” in the xml file without the attribute field called “Mandant”. One more thing, I use two different namespaces.
Here is the XPath I use – perhaps you can see if I have the wrong syntax:
xpath(Response2Billing,(“string(/*[local-name()=’ResponseMM’ and namespace-uri()=’http://www.company.org/billing/ResponseMMEnvelope’%5D/*%5Blocal-name()=’Customer’ and namespace-uri()=’http://www.company.org/billing/ResponseMM’%5D/@*%5Blocal-name()=’Mandant’ and namespace-uri()=”]) = Mandant”));
Thanks a lot.
Wolfgang
-
August 13, 2010 at 5:47 AM #25627
Hi,
Did you build your XPath manually? If so – next time you can open your schema, point on a desired field, and in property window – copy the exact XPath.
Another approach – is using external assembly for assigning data to messages (used usuaully with XmlDocument help variable, string for XPath, and object for value.)
-
August 16, 2010 at 1:34 AM #25638
Hi Yonathan.
Yes, I used the exact Xpath copy of the field property of the schema. I think the best way will be to use an external assembly. But first I will give it one more try to programm it in an expression shape. Just to see how I have to programm in it. 🙂
Thanks so far.
Wolfgang
-
August 16, 2010 at 12:07 PM #25647
Hi,
As for me – I prefer to call external assembly as much as possible. Don’t like to see “strange” code in orchestrations.
-
August 18, 2010 at 6:28 AM #25667
Hi Yonathan.
You’re right I call a assembly within an orchestration now. I tried to programm it in Expression Shaps, Looping shapes and so on and then I have to use Atomic ….
Just call a assembly is by far much more easier – at least for me.
cheers
Wolfgang
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.