How do you map a variable value to an output schema?
Greetings,
Is it possible to map the value of an orchestration variable to an output schema using a functoid? (Or any other method, for that matter.) I don't see how this would be accomplished.
Thanks,
BCB
You can't do it inside a map. but you can do it inside a Message Assignment shape inside the Construct Message Shape (just put the assign shape right after the transform one inside the same construct), and either set a distinguished field or the xpath function to assign the value.
I added the "Message Assignment" shape within the "Construct Message" shape and immediately following the "Transform" shape. I created an expression that assigned a string value (just to see if I can make this work) to the attribute field in my output schema. I first had to promote the attribute field in the output schema to a "distinguished field" - intellisense reported an error if I did not do this.
The map shows that there is no mapping for the output schema attribute field for which I am assigning a value in the "Message Assignment" script. This seems OK to me and my application builds properly. However, when I use the Test Map feature my output Xml is missing the attribute that I assigned in the "Message Assignment" expression. Its not just missing the value I assigned - the entire attribute is missing.
Can you tell me what I've done wrong?
Thanks for your help.
BCB
BCB,
Yes, marking the field as a distinguished field is the easiest way to do it.
As for the other thing, it's normal for the transform shape to complain, as it usually expects to create the entire document instance and does a bit of validation to that effect.However, you can easily work around it by simply initializing the field to a default value inside the map (it's not obvious, but if you select the field in the destination schema inside the map editor and go to the property page there's a property to do that).