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 IndexWebSphere Message Broker (ACE) SupportWMB 8 Graphical Mapping Issue

Post new topicReply to topic
WMB 8 Graphical Mapping Issue View previous topic :: View next topic
Author Message
new_to_wmb8
PostPosted: Fri May 31, 2013 6:45 am Post subject: WMB 8 Graphical Mapping Issue Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

Hi All,

I am working on mapping node , using Graphical mapping in MB 8. In Input object I have three Fields like "Color" , "Size" and "Price" of string type and I have to get the values of these 3 fields into Single Field like “Field” of the same string type. I have tried to use String Function ( fs:Concat) and normal Concat , none of them is working as expected.

For example what should happen :
Color = RED
Size = 38
Price = 1000

So after Concatenation , Field = “RED 38 1000” but it is coming nothing in “Field”.
I also tried to use custom ESQL , but not able find how to give reference for esql file. In property , it shows ESQL Imports but I am not able add any esql.
Can anybody find same kind of problem in MB v8. Please can anyone give some help on this issue.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri May 31, 2013 7:07 am Post subject: Reply with quote

Jedi Knight

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

Have you attended the nine days of training?

You can only concat like types. When the types are different, you must transpose the value into the other type.

Mapping node is not ideally suited to do anything but map XML to XML fields directly, where the types of the data are similar. It is possible to do using mapping node, but there are other ways to do that that are more efficient.
_________________
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
new_to_wmb8
PostPosted: Fri May 31, 2013 7:17 am Post subject: Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

No..company is not paying for the training.
when i am send only one record like
<RECORD>
<COLOR>456</COLOR>
<SIZE>789</SIZE>
<PRICE>1000</SIZE>
</RECORD>
this is working , FIELD = 4657891000. but when two records are coming it is giving error. I think it is not able to handle the cardinality.
while debugging it is giving this error " Text:CHARACTER:Caught BrokerXCIDynamicException
Insert
Type:INTEGER:5
Text:CHARACTER:IXJXE0459E: [ERR 0408][ERR XPTY0004] A sequence of more than one atomic value cannot be cast to type 'xs:string?'."
Can any one tell me what is the problem here
Back to top
View user's profile Send private message
new_to_wmb8
PostPosted: Fri May 31, 2013 7:28 am Post subject: Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

i am sending input like this,
<RECORD>
<STYLE>123</STYLE>
<COLOR>456</COLOR>
<SIZE>789</SIZE>
<WORKCOSTVALUE>25.29 </WORKCOSTVALUE>
</RECORD>
<RECORD>
<STYLE>qwerty</STYLE>
<COLOR>BLUE</COLOR>
<SIZE>42</SIZE>
</RECORD>
so in this the concat is only working for first Record and the value in Field = 123456789
any idea why in output both records is not coming with concat values.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri May 31, 2013 7:36 am Post subject: Reply with quote

Jedi Knight

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

new_to_wmb8 wrote:
No..company is not paying for the training.


How about you? Will you invest your own money in your own schooling?


The reason your flow fails is due to this error: A sequence of more than one atomic value cannot be cast to type 'xs:string?
_________________
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
kunal07
PostPosted: Sat Jun 01, 2013 8:59 am Post subject: Reply with quote

Acolyte

Joined: 05 Dec 2012
Posts: 72

ok..might be two or more than two xml tags cannot be concat, but when i tried to use custom function by esql code. i am not able to add the esql files.
Back to top
View user's profile Send private message
new_to_wmb8
PostPosted: Sun Jun 02, 2013 10:26 am Post subject: Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India


how to add custom esql file for mapping. i am not able to add the files..can any done this ... [/code][/list]
Back to top
View user's profile Send private message
new_to_wmb8
PostPosted: Sun Jun 02, 2013 9:05 pm Post subject: Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

Hi All,

i have tried to used custom Xpath for the Above requirment. with xpath expresssion multiple xml tags from the source are getting concat to single tag in the output.
see the example what is happing,
Input XML Message :
<RECORD>
<STYLE>123</STYLE>
<COLOR>456</COLOR>
<SIZE>789</SIZE>
</RECORD>
<RECORD>
<STYLE>qwerty</STYLE>
<COLOR>BLUE</COLOR>
<SIZE>42</SIZE>
</RECORD>
Output XML coming at Field1 as : <Field1>123 qwerty 456 BLUE 789 42 </Field1>
the values are concat but it should come as like this: 123 456 789 qwerty BLUE 42
can any one tell that this can be achived or not ??
Back to top
View user's profile Send private message
goffinf
PostPosted: Sun Jun 02, 2013 11:44 pm Post subject: Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

new_to_wmb8 wrote:
Hi All,

i have tried to used custom Xpath for the Above requirment. with xpath expresssion multiple xml tags from the source are getting concat to single tag in the output.
see the example what is happing,
Input XML Message :
<RECORD>
<STYLE>123</STYLE>
<COLOR>456</COLOR>
<SIZE>789</SIZE>
</RECORD>
<RECORD>
<STYLE>qwerty</STYLE>
<COLOR>BLUE</COLOR>
<SIZE>42</SIZE>
</RECORD>
Output XML coming at Field1 as : <Field1>123 qwerty 456 BLUE 789 42 </Field1>
the values are concat but it should come as like this: 123 456 789 qwerty BLUE 42
can any one tell that this can be achived or not ??


Well it's pretty difficult to tell without seeing your Xpath expression so why don't you post that.

As a tip, posting all of the relevant facts about your issue is typically going to get you a more targeted response than just doing it piece-meal.
Back to top
View user's profile Send private message
new_to_wmb8
PostPosted: Mon Jun 03, 2013 12:39 am Post subject: Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

the Xpath expression is :
--(/WORKCOST/DETAIL/RECORD/STYLE, /WORKCOST/DETAIL/RECORD/COLOR, /WORKCOST/DETAIL/RECORD/SIZE)
-- fn:string-join(($STYLE, $COLOR, $SIZE), ' ')
where STYLE,COLOR,SIZE values needs to concat at output in FIELD1.both expression are giving the same result. as posted earlier the concat not working as expected.
Back to top
View user's profile Send private message
goffinf
PostPosted: Mon Jun 03, 2013 3:31 am Post subject: Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

new_to_wmb8 wrote:
the Xpath expression is :
--(/WORKCOST/DETAIL/RECORD/STYLE, /WORKCOST/DETAIL/RECORD/COLOR, /WORKCOST/DETAIL/RECORD/SIZE)
-- fn:string-join(($STYLE, $COLOR, $SIZE), ' ')
where STYLE,COLOR,SIZE values needs to concat at output in FIELD1.both expression are giving the same result. as posted earlier the concat not working as expected.


Right, so its working exactly as you've coded it then :-

/WORKCOST/DETAIL/RECORD/STYLE

picks out all occurences of the STYLE element with the specified ancestry :-

123querty

and concats that to :-

COLOR

123querty456BLUE

and finally SIZE :-

123querty456BLUE78942

So what it seems you need is to process EACH RECORD structure. So you either need to do that in an iterator (For Each) or if you will always have exactly 2 occurences you could do it yourself by changing the XPath to include the instance id, such as :-

/WORKCOST/DETAIL/RECORD[1]/STYLE .....
Back to top
View user's profile Send private message
new_to_wmb8
PostPosted: Mon Jun 03, 2013 4:25 am Post subject: Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

thank you very much @goffinf
a bit change in requirment like ,
Input :
<RECORD>
<COLOR>456</COLOR>
<SIZE>789</SIZE>
<PRICE>1000</SIZE>
</RECORD>
<RECORD>
<STYLE>qwerty</STYLE>
<COLOR>BLUE</COLOR>
<SIZE>42</SIZE>
</RECORD>

so in output two tags of Field1 will populate and having output message like,
<Field1>456 789 1000 </Field1>
<Field1>querty BLUE 42</Field1>
this can be done using Xpath or i have to use esql
Back to top
View user's profile Send private message
new_to_wmb8
PostPosted: Mon Jun 03, 2013 10:35 pm Post subject: Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

Back to top
View user's profile Send private message
new_to_wmb8
PostPosted: Wed Jun 05, 2013 1:45 am Post subject: Reply with quote

Centurion

Joined: 28 May 2013
Posts: 127
Location: Hyderabad, India

now it is working...thanks to all for replies
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportWMB 8 Graphical Mapping 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.