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 » add element in DFDL using compute node

Post new topic  Reply to topic
 add element in DFDL using compute node « View previous topic :: View next topic » 
Author Message
sasad
PostPosted: Sun Sep 07, 2014 11:38 pm    Post subject: add element in DFDL using compute node Reply with quote

Acolyte

Joined: 30 Apr 2014
Posts: 67

Hi everyone,

I have a scenario in which I need to add two new elements in input message that is DFDL. I am trying to do this using below ESQL

SET OutputRoot.DFDL.Interchange.UNB.S004.E0017 = datePart;
SET OutputRoot.DFDL.Interchange.UNB.S004.E0019 = timePart;

But this results in a new 'Interchange' node in ouput DFDL.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Sep 08, 2014 12:39 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Sorry - but a two-line problem description is not enough. Please take time ( your time ) to describe the problem carefully and correctly.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
sasad
PostPosted: Mon Sep 08, 2014 1:54 am    Post subject: Reply with quote

Acolyte

Joined: 30 Apr 2014
Posts: 67

Sorry, I thought it would clearly describe my problem.

I have following message flow,

FileInput -> Mapping Node -> Compute Node

Input file is XML, then I map this xml to EDIFACT CODECO message type. I use Compute node to set values in two fields (UNB.S004.E0019 and UNB.S004.E0017). Below is the complete ESQL,

CALL CopyEntireMessage();
DECLARE datetime TIMESTAMP;
DECLARE datePart CHARACTER;
DECLARE timePart CHARACTER;
SET datetime = CAST(InputLocalEnvironment.XMLNSC.EDIFACT_XML.InterchangeHeader.PreparationDateTime AS TIMESTAMP FORMAT 'yyyy-MM-dd HH:mm:ss');

SET datePart = CAST(datetime AS CHARACTER FORMAT 'yyyyMMdd');
SET timePart = CAST(datetime AS CHARACTER FORMAT 'HHmmss');

SET OutputRoot.DFDL.Interchange.UNB.S004.E0017 = datePart;

SET OutputRoot.DFDL.Interchange.UNB.S004.E0019 = timePart;


I need to set values in existing Interchange node, but above lines creates a new Interchange node under OutputRoot.DFDL.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Sep 08, 2014 2:34 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Have you put a trace node (set to display ${Root} before the MQ Output node? This will show you the whole output tree. Then you will see the proper path to the output element that you need to put in your code.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
sasad
PostPosted: Mon Sep 08, 2014 3:18 am    Post subject: Reply with quote

Acolyte

Joined: 30 Apr 2014
Posts: 67

I don't have MQ Output node in my messaeg flow. I checked the input message in debug and I am adding elements on correct path.

Basically after executing earlier mentioned ESQL, IB adds up new Interchange message in Output instead of updating the existing one.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Sep 08, 2014 3:20 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Ok, put the trace node after the compute node.
My point still remains the same.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Sep 08, 2014 4:50 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I expect the 'Interchange' that was copied from InputRoot has a namespace.
So 'OutputRoot.DFDL.Interchange' is not the same as 'InputRoot.DFDL.someNamespace:Interchange.
So smdavies99 is correct - you should add a Trace node.

In general, the debugger only tells you what the flow did - it cannot tell you why. Trace nodes and user trace can are often more useful if the debugger is not giving you the necessary information.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
vicentius
PostPosted: Tue Sep 09, 2014 12:27 am    Post subject: Reply with quote

Apprentice

Joined: 01 Mar 2013
Posts: 28

Instead of using SET statements to both alter the structure of the message and assign values, you could treat the OutputRoot as the tree that is really is. So declare a reference to the tree root, then use MOVE statements to position the reference to the correct node in the tree, then use tCREATE/ATTACH/DETACH statements to alter the tree structure. Only Then take care of the values.
You do write a bit more code in the end, but it makes it more clear what you want to do and easier to trace compared to blind SETs.
Back to top
View user's profile Send private message
sasad
PostPosted: Tue Sep 09, 2014 12:55 am    Post subject: Reply with quote

Acolyte

Joined: 30 Apr 2014
Posts: 67

I added trace after comput node and here what got printed in trace
( ['dfdl' : 0x21c22710]
(0x01000000:Name)http://www.ibm.com/dfdl/edi/un/edifact/Transport/D96A:Interchange = (
(0x01000000:Name):UNB = (

So, how should I use namespace it in ESQL??
Back to top
View user's profile Send private message
vicentius
PostPosted: Tue Sep 09, 2014 1:09 am    Post subject: Reply with quote

Apprentice

Joined: 01 Mar 2013
Posts: 28

Well, you can DECLARE a NAMESPACE, you can SET namespace attributes to nodes, you can CREATE fields with both NAME and NAMESPACE, you can also MOVE in the message tree identifying fields by NAME and NAMESPACE. Quite a lot of options
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Sep 09, 2014 1:20 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

You can even get the namespace from the incoming message with the FIELDNAMESPACE function.

Try a few things and come back here if you continue to have problems.
don't be afraid of trying a few things and failing. That is all part of the learning process.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
sasad
PostPosted: Fri Sep 19, 2014 4:14 am    Post subject: Reply with quote

Acolyte

Joined: 30 Apr 2014
Posts: 67

Thanks @smdavies99 @vicentius and @kimbert.... It was resolved by adding namespace. Thanks alot guys, you are great!!
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 » add element in DFDL using compute node
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.