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 » Parsing Environment Variables

Post new topic  Reply to topic
 Parsing Environment Variables « View previous topic :: View next topic » 
Author Message
deepak_paul
PostPosted: Tue Mar 16, 2010 8:21 am    Post subject: Parsing Environment Variables Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

All,

I am storing teh whole input body to Environment variables and then after two three comput nodes, i am retrieving teh field value stored in the environment variables. I am not mentioning any Parser to Environemnet variables tree to get parsed.

Code:
SET Environment.Variables.MyMessage = InputBody;
SET OutputRoot.XMLNSC.MyMsg.Third = FIELDVALUE(Environment.Variables.MyMessage.First.Second.Third);
      SET OutputRoot.XMLNSC.MyMsg.Sis = FIELDVALUE(Environment.Variables.MyMessage.First.Second.Sub);


I have tested this case with XML and MRM input messsages. I am succesfully able to get thoses fields from Environment variables.

I am just wondering whether we should really mention the parser name to Environment variables to get parsed as desired. in What scenero, it is a must thing.

Note: My flow dsign as follows:
MQInput[Completely Parsed by respective Parser(MRM/XMLNSC)] --> Compute[assigning to ENV]-->Compute2[retriving from ENV]-->MQOutput
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Mar 16, 2010 8:28 am    Post subject: Re: Parsing Environment Variables Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

deepak_paul wrote:
Note: My flow dsign as follows:
MQInput[Completely Parsed by respective Parser(MRM/XMLNSC)] --> Compute[assigning to ENV]-->Compute2[retriving from ENV]-->MQOutput


Why? What's the requirement for this? It seems a bit cumbersome...
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
deepak_paul
PostPosted: Tue Mar 16, 2010 9:39 am    Post subject: Re: Parsing Environment Variables Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

Vitor wrote:
deepak_paul wrote:
Note: My flow dsign as follows:
MQInput[Completely Parsed by respective Parser(MRM/XMLNSC)] --> Compute[assigning to ENV]-->Compute2[retriving from ENV]-->MQOutput


Why? What's the requirement for this? It seems a bit cumbersome...


Vitor,
It is test message flow. You need not dive deep into it.

Please share if you have any clue....
_________________
Regards
Paul
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Mar 16, 2010 10:03 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

If you are copying parsed data into the Environment or LocalEnvironment tree, it is always best to create the parent node using the CREATE statement with the DOMAIN clause. Make sure that the parser specified by the DOMAIN clause is the same as the one which parsed the data.

If you don't follow this rule, the parser-specific data in the field type will get zeroed during the copy. That will produce a whole range of unpredictable results, depending on what the original parser was. One common symptom is that XML attributes turn into tags.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Mar 16, 2010 10:11 am    Post subject: Re: Parsing Environment Variables Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

deepak_paul wrote:
It is test message flow. You need not dive deep into it.


Yes, but clearly you're testing this for some reason. What I'm trying to work out is why you feel the need to store the input message in the Environment tree so as to better answer your question.

deepak_paul wrote:
Please share if you have any clue....


Clues are what I'm trying to get from you. If you're just asking do you need to associate a parser with data in the Environment then it's yes. I'm just trying to add a little value with a better solution.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
deepak_paul
PostPosted: Tue Mar 16, 2010 11:06 am    Post subject: Re: Parsing Environment Variables Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

Vitor wrote:
deepak_paul wrote:
It is test message flow. You need not dive deep into it.


Yes, but clearly you're testing this for some reason. What I'm trying to work out is why you feel the need to store the input message in the Environment tree so as to better answer your question.


OK. The actual requirement for which i was trying out with a test message flow is to call a subflow in between the main flow but need to process the (subflow) response with the actual input message. So i have been thinking to store the whole input body messsage to environment variables which can be later retrieved fieldwise and processed with Subflow response fields.
_________________
Regards
Paul
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Mar 16, 2010 11:10 am    Post subject: Re: Parsing Environment Variables Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

deepak_paul wrote:
OK. The actual requirement for which i was trying out with a test message flow is to call a subflow in between the main flow but need to process the (subflow) response with the actual input message. So i have been thinking to store the whole input body messsage to environment variables which can be later retrieved fieldwise and processed with Subflow response fields.


Why not decouple the subflow & use an MQGet node? Or a collector?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
deepak_paul
PostPosted: Tue Mar 16, 2010 11:28 am    Post subject: Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

kimbert wrote:
If you are copying parsed data into the Environment or LocalEnvironment tree, it is always best to create the parent node using the CREATE statement with the DOMAIN clause. Make sure that the parser specified by the DOMAIN clause is the same as the one which parsed the data.

If you don't follow this rule, the parser-specific data in the field type will get zeroed during the copy. That will produce a whole range of unpredictable results, depending on what the original parser was. One common symptom is that XML attributes turn into tags.


I think I can consider this as a best practice, as i think that, as long as those statements from me did not result any error, it can be valid anyway.
_________________
Regards
Paul
Back to top
View user's profile Send private message
deepak_paul
PostPosted: Tue Mar 16, 2010 11:31 am    Post subject: Re: Parsing Environment Variables Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

Vitor wrote:
deepak_paul wrote:
OK. The actual requirement for which i was trying out with a test message flow is to call a subflow in between the main flow but need to process the (subflow) response with the actual input message. So i have been thinking to store the whole input body messsage to environment variables which can be later retrieved fieldwise and processed with Subflow response fields.


Why not decouple the subflow & use an MQGet node? Or a collector?


I feel it is not as much complicated as to buy a queue and/or play with collector nodes but a doable in compute node itself.
_________________
Regards
Paul
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Mar 16, 2010 11:53 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I think I can consider this as a best practice, as i think that, as long as those statements from me did not result any error, it can be valid anyway.
I assume you mean 'I think I can ignore this advice on my project'. That's fine - as long as you understand exactly what the parser-specific bits of the field type are used for, and you are sure that your project will never ever use them.
Back to top
View user's profile Send private message
deepak_paul
PostPosted: Tue Mar 16, 2010 12:19 pm    Post subject: Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

Yes Kimbert. We dont handle with Attributes at the input request in our projects. This may be a small reason i prefered tha way.

I would certainly apply your advice when i come to.

One curious question is how environment variables store the whole input message with the structure?[stores the logical tree?]
_________________
Regards
Paul
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Mar 16, 2010 2:38 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
We dont handle with Attributes at the input request in our projects. This may be a small reason i prefered tha way.
What about all of the other XML constructs which make use of parser-specific field types? Are you certain that your project will never, ever use any of them?
Back to top
View user's profile Send private message
deepak_paul
PostPosted: Tue Mar 16, 2010 2:46 pm    Post subject: Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

When there is a need, i will certainly use your advice.
_________________
Regards
Paul
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Mar 16, 2010 2:48 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

deepak_paul wrote:
When there is a need, i will certainly use your advice.


Why build something now which will need to be changed later?

Also make sure the business owner of the flow has signed off on this design. If a major redesign is needed later because someone wants to use attributes in XML then you'll need to be covered. Or they'll need to be told they can't add attributes to the XML.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
deepak_paul
PostPosted: Tue Mar 16, 2010 2:57 pm    Post subject: Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

Vitor wrote:
deepak_paul wrote:
When there is a need, i will certainly use your advice.


Why build something now which will need to be changed later?

Also make sure the business owner of the flow has signed off on this design. If a major redesign is needed later because someone wants to use attributes in XML then you'll need to be covered. Or they'll need to be told they can't add attributes to the XML.


This is also a good advice. Thanks guys.
_________________
Regards
Paul
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Parsing Environment Variables
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.