Author |
Message
|
pcelari |
Posted: Mon Jan 29, 2007 1:09 pm Post subject: where to set default value to xml msg element? |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
I want to assign certain fields of my xml msg to default value, like company name, etc. instead of assigning them all in compute node.
However, unlike TDS format, I couldn't find a place to do this in the msg definition pane for a xml msg.
Also, why do I have to set the value of the Xml element. Why can't I just leave them empty?
Am I missing sth?
currently, I got the exception when the msg reaches MQOutput node: "manditory element has no value or default value assigned".
thanks for any insight. _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
kimbert |
Posted: Mon Jan 29, 2007 1:20 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Default values are only applied when writing a fixed-length bitstream (i.e. a bitstream in which there are no delimiters ). In practice, that means that default values will be used when writing an MRM CWF or Fixed Length MRM TDS message. Default values are never automatically inserted when parsing, and cannot be used to populate a message tree.
Sorry to bring bad news  |
|
Back to top |
|
 |
pcelari |
Posted: Mon Jan 29, 2007 1:52 pm Post subject: |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
thanks a lot for clarifying this.
So it means I'll have to set all elements in my ESQL code even they are empty? Or is there a way around this? _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jan 29, 2007 1:55 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can create a static message that has default values populated, then you can use CREATE FIELD... PARSE... to turn this into a message tree.
Then you can update necessary fields from Input message. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
pcelari |
Posted: Mon Jan 29, 2007 2:05 pm Post subject: |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
jefflowrey wrote: |
You can create a static message that has default values populated, then you can use CREATE FIELD... PARSE... to turn this into a message tree.
Then you can update necessary fields from Input message. |
that's what I did in my C program, where the static msg is in a file. But how can I read a static file from a compute node?
thanks a lot. _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jan 29, 2007 2:06 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can't read a static file from a Compute node.
You can read a static file from a JavaCompute node.
You can also store the static data in a single User Defined Property, or in a database table.
Or you can hardcode it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
pcelari |
Posted: Mon Jan 29, 2007 2:43 pm Post subject: |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
thanks for pointing out all these options. I've got to find and read about them all in the manual. I still wonder if I can simply copy and paste a file containing the xml tree as a string into, say LocalEnvironment.Variables.
In the mean time, I think I better use a mapping node instead, where I can set the target values.
many thanks G.M.! _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
|