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 » ELSE IF always defaulting

Post new topic  Reply to topic
 ELSE IF always defaulting « View previous topic :: View next topic » 
Author Message
LH33
PostPosted: Tue Mar 11, 2003 2:17 pm    Post subject: ELSE IF always defaulting Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

HI!

I have to check for required fields and throw a user eror if they are missing from the XML coming into my flow. My code always goes to the last ELSE IF and throws the last error (2592) even though my XML has valid values in the incoming tags. Can someone look at the following code and see if I messed up somehow? I appreciate it!!

IF ((InputRoot.XML.CreateJob.DataArea.Job.AgencyCode IS NULL) or
(InputRoot.XML.CreateJob.DataArea.Job.AgencyCode = '')) and
(InputRoot.XML.CreateJob.DataArea.Job.Location.Address.Streets.Name [1] IS NULL or
InputRoot.XML.CreateJob.DataArea.Job.Location.Address.Streets.Name[1] = ''))
THEN
Throw user exception message 2590 values ('Agency Code and Street Name Missing');
ELSE
IF (InputRoot.XML.CreateJob.DataArea.Job.AgencyCode IS NULL) or
(InputRoot.XML.CreateJob.DataArea.Job.AgencyCode = '')
THEN
Throw user exception message 2591 values ('Agency Code Missing');
ELSE
IF ((InputRoot.XML.CreateJob.DataArea.Job.Location.Address.Streets.Name[1] IS NULL) or
(InputRoot.XML.CreateJob.DataArea.Job.Location.Address.Streets.Name[1] = '')) THEN
Throw user exception message 2592 values ('Street Name Missing');
END IF;
END IF;
END IF;

Thanks!!!! LisaB
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Mar 11, 2003 8:03 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Can you post your input message here?
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
LH33
PostPosted: Wed Mar 12, 2003 5:20 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

Kiran, Thanks for your help!! Here is my input message:

<CreateJob revision="1.0.0" environment="Test">
<REFERENCE_CONTROL_AREA>
<CD_RQST_CD>CreateODL</CD_RQST_CD>
<CD_RQST_TYPE>STLT</CD_RQST_TYPE>
<KY_BA>2091378542</KY_BA>
<REFERENCE_NBR>123456789012</REFERENCE_NBR>
</REFERENCE_CONTROL_AREA>
<ApplicationArea>
<Sender>
<Component>GUIDance</Component>
<Confirmation>OnError</Confirmation>
<AuthorizationId>Identify the User of Origin</AuthorizationId>
</Sender>
<CreationDateTime>CCYY-MM-DDThh:mm:ss</CreationDateTime>
<BODId>1234567890123456</BODId>
</ApplicationArea>
<DataArea>
<Create confirm="Always"/>
<Job>
<AgencyCode>ODL</AgencyCode>
<ExternalNumbers>
<ExternalNumber index="1"/>
<ExternalNumber index="2"/>
</ExternalNumbers>
<Filters>
<Filter index="1">work district</Filter>
</Filters>
<LevelCode5>Grid</LevelCode5>
<Location>
<Address>
<ApartmentNumber>Premises Location 1</ApartmentNumber>
<CityCode>ANNAPOLIS JUNCTN</CityCode>
<CivicExtension>NO PFIX</CivicExtension>
<CivicNumber>Street Number</CivicNumber>
<FreeFormat>Address</FreeFormat>
<Streets>
<Street index="1">
<Article>CRDL DIR</Article>
<Direction>DIR SFIX</Direction>
<Name>Main</Name>
</Street>
<Street index="2">
<Article>CRDL DIR 2</Article>
<Direction>DIR SFIX 2</Direction>
<Name>Main</Name>
</Street>
</Streets>
<Suite>Premises Location 2</Suite>
<ZipCode>Zip</ZipCode>
</Address>
<Customer>
<Address>
<FreeFormat>Address</FreeFormat>
</Address>
<Comment>Trouble Types</Comment>
<Name>Name</Name>
</Customer>
<Latitude>Y Coordinate</Latitude>
<Longitude>X Coordinate</Longitude>
<Phones>
<Phone>
<Number>Home Phone</Number>
</Phone>
</Phones>
</Location>
<Origin>Origination</Origin>
<Priority/>
<Proximity>REAR</Proximity>
<Remarks>
<Remark index="0">
<Categorie>REMARKS</Categorie>
<Number>Remark Number 0</Number>
</Remark>
<Remark index="1">
<Categorie>REMARKS</Categorie>
<Number>Remark number 1</Number>
</Remark>
<Remark index="2">
<Categorie>REMARKS</Categorie>
<Number>Remark number 2</Number>
</Remark>
<Remark index="3">
<Categorie>REMARKS</Categorie>
<Number>Remark number 3</Number>
</Remark>
<Remark index="4">
<Categorie>REMARKS</Categorie>
<Number>Remark number 4</Number>
</Remark>
<Remark index="5">
<Categorie>REMARKS</Categorie>
<Number>Remark number 5</Number>
</Remark>
<Remark index="6">
<Categorie>REMARKS</Categorie>
<Number>Remark number 6</Number>
</Remark>
<Remark index="7">
<Categorie>REMARKS</Categorie>
<Number>Remark number 7</Number>
</Remark>
</Remarks>
<TimeLine>
<CreationDateTime>2003-02-28T02:20:22</CreationDateTime>
<EndBeforeDateTime/>
<StartAfterDateTime>Create date and Time CCYY-MM-DDThh:mm:ss</StartAfterDateTime>
</TimeLine>
<UDFS>
<UDF index="1">SPECIAL ACCESS</UDF>
</UDFS>
<WorkCode>EBLOCKOUT</WorkCode>
<WorkCodeUDFS>
<WorkCodeUDF index="1">Source</WorkCodeUDF>
<WorkCodeUDF index="2">Ccccalltaker</WorkCodeUDF>
<WorkCodeUDF index="3">Repeat</WorkCodeUDF>
<WorkCodeUDF index="4">Poleno</WorkCodeUDF>
<WorkCodeUDF index="5">PAL</WorkCodeUDF>
<WorkCodeUDF index="6">Specialloc</WorkCodeUDF>
<WorkCodeUDF index="7">Visible</WorkCodeUDF>
<WorkCodeUDF index="8">Transformer</WorkCodeUDF>
<WorkCodeUDF index="9">PendingCalls</WorkCodeUDF>
<WorkCodeUDF index="10">Fdr</WorkCodeUDF>
<WorkCodeUDF index="11">Account</WorkCodeUDF>
<WorkCodeUDF index="12">123456789</WorkCodeUDF>
<WorkCodeUDF index="13">Y</WorkCodeUDF>
</WorkCodeUDFS>
</Job>
</DataArea>
</CreateJob>
Back to top
View user's profile Send private message
lillo
PostPosted: Wed Mar 12, 2003 5:47 am    Post subject: Reply with quote

Master

Joined: 11 Sep 2001
Posts: 224

I found the problem. Replace
Code:
InputRoot.XML.CreateJob.DataArea.Job.Location.Address.Streets.Name [1]

with
Code:
InputRoot.XML.CreateJob.DataArea.Job.Location.Address.Streets.Street.Name[1]

You were missing Street

Cheers
_________________
Lillo
IBM Certified Specialist - WebSphere MQ
Back to top
View user's profile Send private message
LH33
PostPosted: Wed Mar 12, 2003 5:50 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

Lilo - Thank you - Thnak you - Thank you!! i had dreams of that code!!
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 » ELSE IF always defaulting
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.