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 » Invalid Code

Post new topic  Reply to topic
 Invalid Code « View previous topic :: View next topic » 
Author Message
LH33
PostPosted: Tue Oct 07, 2003 6:10 am    Post subject: Invalid Code Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

I have a message flow that needs to set an output tag based on the value of an input tag. I use a CASE statement to set the output tag. When I test it using the valid values, everything is okay. When I test it using a bad value (DD) for the input tag, it does not work. Can someone see what I may be doing wrong? Here is my input XML and the code:

<SyncSpecDutyIn revision="1.0.0" environment="Test">
<DataArea>
<SpecDutyIn>
<Crew>
<DefaultWorkCenter>DD</DefaultWorkCenter>
</SpecDutyIn>
</DataArea>
</SyncSpecDutyIn>

CODE:
DECLARE DWC CHAR;
SET DWC = InputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.DefaultWorkCenter;
SET OutputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.DefaultWorkCenter =
CASE DWC
WHEN 'CK' THEN 'Cockeysville'
WHEN 'FS' THEN 'Front St.'
WHEN 'HW' THEN 'Western'
WHEN 'DO' THEN 'Dorsey'
END;
IF (OutputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.DefaultWorkCenter <> 'Cockeysville' and
OutputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.DefaultWorkCenter <> 'Front St.' and
OutputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.DefaultWorkCenter <> 'Western' and
OutputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.DefaultWorkCenter <> 'Dorsey') THEN
SET OutputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.DefaultWorkCenter = 'Front St.';
END If;

Here is the output XML:

<SyncSpecDutyIn revision="1.0.0" environment="Test">
<DataArea>
<SpecDutyIn>
<Crew>
</SpecDutyIn>
</DataArea>
</SyncSpecDutyIn>

What I need the output XML to be is:

<SyncSpecDutyIn revision="1.0.0" environment="Test">
<DataArea>
<SpecDutyIn>
<Crew>
<DefaultWorkCenter>Front St.</DefaultWorkCenter>
</Crew>
</SpecDutyIn>
</DataArea>
</SyncSpecDutyIn>

Thanks, Lisa
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Tue Oct 07, 2003 6:47 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

From your code it looks like the 'bad' one needs to be set to 'Front St.', if this is the case: add the ELSE clause (like below)

Code:
DECLARE DWC CHAR;
SET DWC = InputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.DefaultWorkCenter;
SET OutputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.DefaultWorkCenter =
CASE DWC
WHEN 'CK' THEN 'Cockeysville'
WHEN 'FS' THEN 'Front St.'
WHEN 'HW' THEN 'Western'
WHEN 'DO' THEN 'Dorsey'
ELSE 'Front St.'
END;


Michael
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

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