How to fill a field in a schema with a variable?

Home Page Forums BizTalk 2004 – BizTalk 2010 How to fill a field in a schema with a variable?

Viewing 1 reply thread
  • Author
    Posts
    • #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

    • #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.

       

      • #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

        • #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.)

          • #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

            • #25647

              Hi,

              As for me – I prefer to call external assembly as much as possible. Don’t like to see “strange” code in orchestrations.

              • #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

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.