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 » Problem accessing value in Reference Variable

Post new topic  Reply to topic
 Problem accessing value in Reference Variable « View previous topic :: View next topic » 
Author Message
edasnarik
PostPosted: Sun Jun 28, 2009 11:01 pm    Post subject: Problem accessing value in Reference Variable Reply with quote

Acolyte

Joined: 10 Mar 2009
Posts: 61

Hello All,

I have clicked on "Show Type Names" in the debug perspective and the structure in debug is as shown below.

Code:
var1
   CHARACTER  @IdRef = yyy
     Some Free form Txt Value


If we have not clicked on "Show Type Names" the structure is as below.
Code:

var1
   @IdRef = yyy
     Some Free form Txt Value

I am placing this to only avoid any confusion caused.

To further avoid confusion I have place the image of debug here.
http://www.sendspace.com/file/9143e3


var1 is the reference variable.
IdRef is an attribute present
and the actual value which needs to be accessed is Some Free form Txt Value

I tried the FIELDVALUE function also but in vain.

Please help me in this regard.


Last edited by edasnarik on Mon Jun 29, 2009 2:47 am; edited 3 times in total
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Jun 29, 2009 1:29 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Hi,

Looks as if the value is held in a child node of the attribute - but that's puzzling because
a) none of the XML domains will create a child nodes for the value of an attribute. Not usually, anyway.
b) If they did create the value as a child node, FIELDVALUE should return the correct value anyway.

Please
- tell us which domain you are using
- insert a Trace node and post the relevant fragment of the output
- post the fragment of XML which produced it
Back to top
View user's profile Send private message
edasnarik
PostPosted: Mon Jun 29, 2009 2:04 am    Post subject: Reply with quote

Acolyte

Joined: 10 Mar 2009
Posts: 61

Input's Domain is MRM and Output's Domain is XMLNS.

Code:
DECLARE contact admin  REFERENCE TO InputRoot.MRM.InsuranceSvcRs.PolicyInqRs.PolInfo.contact admin;

FOR refInRemarkText AS contact admin.RemarkText[]  DO
DECLARE entireRemarksSec CHARACTER refInRemarkText||'~';
SET UnderWritingNotesDetails = UnderWritingNotesDetails || getRemarksTextInReqdFormat(entireRemarksSec)||'<br>';
END FOR;


Input XML for that Part is :

Code:
</PersAutoLineBusiness>
     <RemarkText IdRef="yyy">8/27/08~Underwriter Decision Category: Cancel Cause~Underwriter Decision Reason: Nonpayment of Bill~Underwriter Decision comment:  Insured Contacted</RemarkText>
<RemarkText IdRef="yyy">7/27/2008~Underwriter Decision Category: Approve with Change~Underwriter Decision Reason: Driver Exclusion~Underwriter Decision comment:  Insured Contacted</RemarkText>
    </contact admin>
   </PolInfo>
  </PolicyInqRs>
 </InsuranceSvcRs>
</ACORD>


I am not getting any value in entireRemarksSec

Since the above code did not work as per requirement I tried to place refInRemarkText in another reference named var1 and whose debug is shown in my first post.
Back to top
View user's profile Send private message
Tanesh
PostPosted: Mon Jun 29, 2009 4:20 am    Post subject: Reply with quote

Newbie

Joined: 29 Jun 2009
Posts: 8

Well, your XML looks like this -

Quote:

Code:
</PersAutoLineBusiness>
<RemarkText IdRef="yyy">8/27/08~Underwriter Decision Category: Cancel Cause~Underwriter Decision Reason: Nonpayment of Bill~Underwriter Decision comment: Insured Contacted</RemarkText>
<RemarkText IdRef="yyy">7/27/2008~Underwriter Decision Category: Approve with Change~Underwriter Decision Reason: Driver Exclusion~Underwriter Decision comment: Insured Contacted</RemarkText>
</contact admin>
</PolInfo>
</PolicyInqRs>
</InsuranceSvcRs>
</ACORD>



And your code looks like -

Quote:


DECLARE contact admin REFERENCE TO InputRoot.MRM.InsuranceSvcRs.PolicyInqRs.PolInfo.contact admin;

FOR refInRemarkText AS contact admin.RemarkText[] DO
DECLARE entireRemarksSec CHARACTER refInRemarkText||'~';
SET UnderWritingNotesDetails = UnderWritingNotesDetails || getRemarksTextInReqdFormat(entireRemarksSec)||'<br>';
END FOR;


As per the XML, it seems you have <ACORD> element in the incoming message which you have not included while declaring the reference. Please try including the element.[/quote]
Back to top
View user's profile Send private message
edasnarik
PostPosted: Mon Jun 29, 2009 4:54 am    Post subject: Reply with quote

Acolyte

Joined: 10 Mar 2009
Posts: 61

I am accessing in the right way only.
If I include the ACORD also, it is going to be entire root i.e., properties MQMD and then message.
Back to top
View user's profile Send private message
vmcgloin
PostPosted: Mon Jun 29, 2009 5:32 am    Post subject: Reply with quote

Knight

Joined: 04 Apr 2002
Posts: 560
Location: Scotland

So where did you try FIELDVALUE? FIELDVALUE(refInRemarkText)?

Also, I don't know if it is a good idea to have your DECLARE in the FOR loop.
Back to top
View user's profile Send private message
edasnarik
PostPosted: Mon Jun 29, 2009 6:07 am    Post subject: Reply with quote

Acolyte

Joined: 10 Mar 2009
Posts: 61

First let me think of a working code and then I can go for performance.

I copied the refInRemarkText to another reference like this
Code:
DECLARE var1 REFERENCE TO refInRemarkText;


and since var1 had values like in the first post I tried to use FIELDVALUE over there i.e.,

Code:
FIELDVALUE(var1)

Off course with a valid correlation name.
Back to top
View user's profile Send private message
vmcgloin
PostPosted: Mon Jun 29, 2009 6:48 am    Post subject: Reply with quote

Knight

Joined: 04 Apr 2002
Posts: 560
Location: Scotland

Hi,

I was not thinking of performance, I was just thinking the concatenation would not work, but I see what you are trying to do now... I stand by the idea that FIELDVALUE(refInRemarkText) should give you the text you wanted.

Why don't you try the middle thing that kimbert suggested?
- insert a Trace node and post the relevant fragment of the output
Would it help to post a trace of the input too?

(I can't access the jpeg you posted so that does not help.)

Cheers,
Vicky
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jun 30, 2009 12:28 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Please explain why you are parsing your input XML using MRM XML, but writing the output message using XMLNS.

Quote:
Why don't you try the middle thing that kimbert suggested?
- insert a Trace node and post the relevant fragment of the output
Would it help to post a trace of the input too?

Please put the Trace node immediately before the Compute node.

If you still cannot see what is going wrong, please take a user trace - the answer will almost certainly be in there somewhere.
Back to top
View user's profile Send private message
edasnarik
PostPosted: Tue Jun 30, 2009 5:07 am    Post subject: Reply with quote

Acolyte

Joined: 10 Mar 2009
Posts: 61

I could not figure out anything with the trace.
Enclosed is the part of the input trace.

Code:
            )
            (0x01000013):RemarkText           = (
              (0x0300000D):@IdRef = 'yyy'
              (0x0200000B):       = '8/27/08~Underwriter Decision Category: Cancel Cause~Underwriter Decision Reason: Nonpayment of Bill~Underwriter Decision comment:  Insured Contacted'
            )
            (0x01000013):RemarkText           = (
              (0x0300000D):@IdRef = 'yyy'
              (0x0200000B):       = '7/27/2008~Underwriter Decision Category: Approve with Change~Underwriter Decision Reason: Driver Exclusion~Underwriter Decision comment:  Insured Contacted'
            )
          )
        )
      )
    )


The output Trace for this element is blank.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jun 30, 2009 5:17 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

- You did not answer my question 'why MRM XML on input?'
- Your attribute @IdRef is not modeled correctly - that's why the MRM parser has put a '@' at the start of the name. Not necessarily a problem, but I'm just saying...
- User trace will tell you why the output element is blank.
Back to top
View user's profile Send private message
edasnarik
PostPosted: Tue Jun 30, 2009 5:28 am    Post subject: Reply with quote

Acolyte

Joined: 10 Mar 2009
Posts: 61

kimbert wrote:
- 'why MRM XML on input?'

It is an acord message set.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jun 30, 2009 5:31 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

That is a fact, not a justification for your design.
Why does that fact make it a good idea to use MRM XML on input, but XMLNS on output? And why not use XMLNSC for both?
Back to top
View user's profile Send private message
edasnarik
PostPosted: Fri Jul 03, 2009 2:06 am    Post subject: Reply with quote

Acolyte

Joined: 10 Mar 2009
Posts: 61

It was a problem with accessing mixed element.
It is solved now with the syntax as below.
Code:
DECLARE entireRemarksSec CHARACTER refInRemarkText.*[<1] ||'~';


Thanks to all of you ..
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 » Problem accessing value in Reference 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.