ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Attributes in the Environment

Post new topic  Reply to topic
 Attributes in the Environment « View previous topic :: View next topic » 
Author Message
EnOne
PostPosted: Tue Apr 12, 2005 12:54 pm    Post subject: Attributes in the Environment Reply with quote

Centurion

Joined: 09 Oct 2002
Posts: 100
Location: Kansas City

using MQv5.3 and WBIMBv5.0
I am trying to do my work in the compute nodes within the Environment tree like so...

SET OutputRoot.XML.Parent.Child[1] = 'Pebbles';
SET OutputRoot.XML.Parent.Child[2] = 'BamBam';
SET Environment.XML = OutputRoot.XML;
SET OutputRoot.XML = NULL;

this keeps me from have to copy the entire XML tree (SET OutputRoot = InputRoot; )everytime I go into a compute node. Now I only copy the headers and do my transformations within the Environment tree which allows my flow to execute faster.

(my actual XML tree is much larger but this is enough to explain my problem)

It was all working fine until I tried
SET OutputRoot.XML.Parent.Child[1] = 'Pebbles';
SET OutputRoot.XML.Parent.Child[1].(XML.Attribute)type = 'F';
SET OutputRoot.XML.Parent.Child[2] = 'BamBam';
SET OutputRoot.XML.Parent.Child[2].(XML.Attribute)type = 'M';
SET OutputRoot.XML.Parent.(XML.Attribute)mom = 'Wilma';
SET OutputRoot.XML.Parent.(XML.Attribute)dad = 'Fred';
SET Environment.XML = OutputRoot.XML;
SET OutputRoot.XML = NULL;

which should have created
<Parent mom='Wilma' dad='Fred'>
<Child type='F'>Pebbles</Child>
<Child type='M'>BamBam</Child>
</Parent>

When I tried to put the message back into XML it only returned the following

<Parent>
<Child>Pebbles</Child>
<Child>BamBam</Child>
</Parent>

the mom and dad attributes on Parent were missing. I checked the XML and mom and dad are a part of parent before they go in Environment, but not when they come out. Is there a simple way to set Attributes so they can survive the Environment tree?
Back to top
View user's profile Send private message
JT
PostPosted: Tue Apr 12, 2005 1:23 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

To copy XML attributes, you have to use the FIELDVALUE function.

Based on your example however, doesn't it make more sense to set the elements in the Environment tree directly?

Code:
SET Environment.XML.Parent.Child[1] = 'Pebbles';
SET Environment.XML.Parent.Child[1].(XML.Attribute)type = 'F';
SET Environment.XML.Parent.Child[2] = 'BamBam';
SET Environment.XML.Parent.Child[2].(XML.Attribute)type = 'M';
SET Environment.XML.Parent.(XML.Attribute)mom = 'Wilma';
SET Environment.XML.Parent.(XML.Attribute)dad = 'Fred';

You'll save yourself the overhead incurred from the copy/nullify of the OutputRoot tree.
Back to top
View user's profile Send private message
EnOne
PostPosted: Tue Apr 12, 2005 4:46 pm    Post subject: Reply with quote

Centurion

Joined: 09 Oct 2002
Posts: 100
Location: Kansas City

This flow is a part of many flows when that call different procedures. When the information leaves the flow then it needs to be as an XML message with the attributes intact. Within the flow I would like for it to be within the Environment tree. write an individual line of code that converts all of the attributes into elements then passes these elements into the Environment tree and at the end convert these elements back to attributes but I was hoping for something a little simpler like an Environment version of attribute.

I'm thinking you are suggesting transforming

<Parent mom='Wilma' dad='Fred'>
<Child type='F'>Pebbles</Child>
<Child type='M'>BamBam</Child>
</Parent>

into

<Environment>
<XML>
<Parent>
<mom>Wilma</mom>
<dad>Fred</fred>
<Child>Pebbles</Child>
<Child>BamBam</Child>
<type>F</type>
<type>M</type>
</Parent>
</XML>
</Environment>

and then transforming it back to XML when I'm done with it.
Back to top
View user's profile Send private message
JT
PostPosted: Wed Apr 13, 2005 5:31 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

No, I'm suggesting you set the elements & attributes in the Environment tree instead of the OutputRoot tree, and then when you need the elements & attributes set in the OutputRoot tree, use the FIELDVALUE function against the Environment tree.
Back to top
View user's profile Send private message
nathanw
PostPosted: Fri Apr 15, 2005 2:38 am    Post subject: Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

except of course that Bambam is Barney and Bettys child not Fred and Wilmas

Last edited by nathanw on Fri Apr 15, 2005 5:19 am; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
mgk
PostPosted: Fri Apr 15, 2005 3:32 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

The statement:

Code:
SET Environment.XML = OutputRoot.XML;


does not create an XML parser in the environment. For this to work
you need to create an XML parser using the CREATE statement with the DOMAIN clause before you do this assignment.

Once you have CREATEd an XML parser then you can assign elements to and their attributes will be intact.
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
jfluitsm
PostPosted: Sat Apr 16, 2005 12:16 pm    Post subject: Reply with quote

Disciple

Joined: 24 Feb 2002
Posts: 160
Location: The Netherlands

This is now documented in FP5, ESQL CREATE. See ftp://ftp.software.ibm.com/software/integration/wbibrokers/docs/messagebroker_esql.pdf, page 175
_________________
Jan Fluitsma

IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Attributes in the Environment
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.