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 » CARDINALITY ISSUE

Post new topic  Reply to topic
 CARDINALITY ISSUE « View previous topic :: View next topic » 
Author Message
LH33
PostPosted: Thu Feb 05, 2004 8:30 am    Post subject: CARDINALITY ISSUE Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

I have a message flow that checks for values and then throws a user exception if the values are invalid. I am not getting my expected results. Can someone help me understand what I am doing wrong?

Thanks!! Lisa

Here is my code: The input value for FIL1 = XX the input value for FIL2 =MM

CODE:

IF ( FIL1 <> 'TR' ) THEN
SET OutputLocalEnvironment.Errors.FIL1 =
('Invalid Data sent from System.');
IF (FIL2 <> 'MM') THEN
SET OutputLocalEnvironment.Errors.FIL2 =
('Invalid Time sent from System.');

DECLARE C CHAR;
SET C = CARDINALITY(OutputLocalEnvironment.Errors.*[]);
IF C > 0 THEN
DECLARE ALLERRORS CHAR;
SET ALLERRORS = (OutputLocalEnvironment.Errors.FIL1 || ' ' ||
OutputLocalEnvironment.Errors.FIL2);
Throw user exception values (ALLERRORS);
END IF;
Back to top
View user's profile Send private message
EddieA
PostPosted: Thu Feb 05, 2004 9:28 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Haven't got time to actually run this, but I know it will fail if one of the error conditions DON'T happen. Concatenating strings that don't exist can lead to the result being set to NULL.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
LH33
PostPosted: Thu Feb 05, 2004 9:30 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

Thanks! In this case, the first error condition exists and it's still not working. Any ideas?

Lisa
Back to top
View user's profile Send private message
CoolDude
PostPosted: Thu Feb 05, 2004 10:34 am    Post subject: Reply with quote

Apprentice

Joined: 17 Jan 2004
Posts: 39

As Eddie has specified

Quote:
Concatenating strings that don't exist can lead to the result being set to NULL.



Try this:

SET OutputLocalEnvironment.Errors.FIL1 = ' ';
SET OutputLocalEnvironment.Errors.FIL2 = ' '; -- just to avoid null if not allocated any value in the code. Its basically initializing the variables.

and then your code.
Quote:

CODE:

IF ( FIL1 <> 'TR' ) THEN
SET OutputLocalEnvironment.Errors.FIL1 =
('Invalid Data sent from System.');
IF (FIL2 <> 'MM') THEN
SET OutputLocalEnvironment.Errors.FIL2 =
('Invalid Time sent from System.');

DECLARE C CHAR;
SET C = CARDINALITY(OutputLocalEnvironment.Errors.*[]);
IF C > 0 THEN
DECLARE ALLERRORS CHAR;
SET ALLERRORS = (OutputLocalEnvironment.Errors.FIL1 || ' ' ||
OutputLocalEnvironment.Errors.FIL2);
Throw user exception values (ALLERRORS);
END IF;



Also looking at your code what i understood is :

If -> IF - End if;

i think this should be

If ->IF -> end if -> end if;

thanks,

_________________
Correct Me from Wrong . If i am correct Appreciate Me
Back to top
View user's profile Send private message
LH33
PostPosted: Thu Feb 05, 2004 1:50 pm    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

I am using this processing in a Route To Message flow. In order to use the OutputLocalEnvironment, I need to check the LocalEnvironment and Message check box on the Advanced tab of the Compute node. When I do this I get an error saying that the Route to is unable to locate the Label node.

Is there anything else I can use to pass variables from one node to the next?

Thanks, Lisa
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Feb 05, 2004 5:29 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

LH33 wrote:
I am using this processing in a Route To Message flow. In order to use the OutputLocalEnvironment, I need to check the LocalEnvironment and Message check box on the Advanced tab of the Compute node. When I do this I get an error saying that the Route to is unable to locate the Label node.

Since you have to put the Label to route to into the OutputLocalEnvironment anyway, I suspect the problem is that you're doing something wrong, or not setting the destination in your error handling.

LH33 wrote:
Is there anything else I can use to pass variables from one node to the next?

There's always Environment instead of OutputLocalEnvironment. It's usually better to put your stuff into Environment.Variables, or Environment.<MsgFlowName>.Variables or some subtree that other people won't (or shouldn't!) touch, just so you're safe working with subflows and etc.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
LH33
PostPosted: Fri Feb 06, 2004 4:54 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

Jeff,

Thanks!!! Environment.variables worked great!!

Lisa
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 » CARDINALITY ISSUE
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.