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 » Scope of Reference variable to Environment variable

Post new topic  Reply to topic
 Scope of Reference variable to Environment variable « View previous topic :: View next topic » 
Author Message
ruchir
PostPosted: Mon Nov 28, 2011 10:32 pm    Post subject: Scope of Reference variable to Environment variable Reply with quote

Guest




Hi All,

May be this is already asked previously, so i m sorry if i m asking it again, but i hav a small issue about the scope of refrence variable to Environment variable.In my flow i have two compute node. In one compute node i m declaring a reference variable and in the other compute i tried to fetch that value.

I declared a refrence to Enviroment variable in the first compute node as :
Code:
DECLARE envRef REFERENCE TO Environment;


Then i stored value in that reference variable as
Code:
envRef.Header.abc = 'hi';

when i m trying to get value of this refrence variable in second compute node it is giving error as follows
Quote:
The correlation name 'envRef.Header.abc' is not valid.The first element of a field reference must be a valid correlation name, from those in scope.


Plz me why i m facing this issue and how can i solve this problem.
Back to top
mqjeff
PostPosted: Tue Nov 29, 2011 2:16 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It's probably as simple as the scope of your DECLARE.

You probably have your DECLARE inside your Compute MODULE. You would need it to at least be at the schema level.
Back to top
View user's profile Send private message
ruchir
PostPosted: Tue Nov 29, 2011 3:17 am    Post subject: Reply with quote

Guest




Hi mqjeff,

Thanks for the reply.

I got it but environment variable is available in other COMPUTE module in the same flow. So its reference shld also have the same scope. As reference variable is same as the variable to which it is referring , or it has diff functionality.

Plz confirm.
Back to top
mqjeff
PostPosted: Tue Nov 29, 2011 3:20 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The Environment TREE is available in the other compute node.

Your POINTER to the Environment Tree is *not*. Unless you take steps to make it available. By declaring it in the right scope.
Back to top
View user's profile Send private message
ruchir
PostPosted: Tue Nov 29, 2011 3:37 am    Post subject: Reply with quote

Guest




If POINTER to Environment Tree is not available in other compute node, then how we can share a reference variable between 2 compute node. I tried to declare it outside the COMPUTE MODULE but it is giving SYNTAX error saying :
Quote:
Identifier "Environment" cannot be resolved

Plz tell how to declare so that it is in right scope.
Back to top
mqjeff
PostPosted: Tue Nov 29, 2011 3:47 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Ooo. Interesting twist. I'd forgotten that. I don't think it's possible to declare a reference to nothing, and then later move it somewhere. So you might not be able to declare reference in schema scope and then move it to a valid tree location in the compute module.

Why do you think you need to share the pointer? The tree exists and is immutable between the two nodes. So if you redeclare the reference in both compute modules you achieve the end result. And there's very little extra work - there shouldn't be any noticable performance impact - from doing the declare twice.

Or of course you could move the logic into a procedure and call the procedure from both modules.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Nov 29, 2011 6:32 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Or use solidDB and/or a Singleton.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Nov 29, 2011 6:33 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
Or use solidDB and/or a Singleton.


Back to top
View user's profile Send private message
ruchir
PostPosted: Tue Nov 29, 2011 10:19 pm    Post subject: Reply with quote

Guest




Hi mqjeff,

Thanks a ton for ur reply
my problem is solved. . I declared the reference again and then got all the values.

Thanks a lot.
Back to top
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Scope of Reference variable to Environment variable
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.