|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Usage of Default Values within CWF Message Set |
« View previous topic :: View next topic » |
Author |
Message
|
harish_td |
Posted: Mon Feb 18, 2008 6:15 pm Post subject: Usage of Default Values within CWF Message Set |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
All,
I have a XML to CWF flow. The copybook(CWF Output) is a fairly big one considering that it has a lot of fields.
During the course of transformation we would initialize zeros/spaces to all the fields that were mandatory in the copybook but no values would be assigned to them for useful business mapping.
Ex:
SET OR.field1 = '';
SET OR.field2 = IR.MRM.XMLField1;
SET OR.field3 = 0;
SET OR.field4 = CAST(IR.MRM.XMLField2 AS INTEGER);
.
.
.
SET OR.field999 = '';
and so on
This works fine except that we have to re-do the initializations over and over again for every project in which this message set is used.
In order to overcome this i assigned default values to each field in the message set. Space for Strings and 0 for integers.
So in my flow i earlier had MQInput --> Compute --> MQOutput
I would like to add that the compute node now has code that maps the fields that are necessary for our business.
Now i have MQInput --> Compute --> ResetContentDescriptor --> MQOutput.
The fields not necessary to the specific requirement are not created at all. Since the message set has defaults set within them, every absent field would be populated by its default value at the o/p of the RCD Node.
Voila!! it works fine.
As per the MB Bible(Info-centre), it is perfectly legal to do so as the RCD merely reparses the message with the parser specified
(In my case CWF to CWF re-parsing)
Is my understanding right or am i unknowingly creating a bug? Do let me know if there is another way of overcoming lengthy initialization statements within ESQL.
Thanks in Advance,
Harish |
|
Back to top |
|
 |
kimbert |
Posted: Tue Feb 19, 2008 2:13 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
the RCD merely reparses the message with the parser specified
(In my case CWF to CWF re-parsing) |
It depends what you mean by 're-parse'. The RCD node simply sets some properties associated with the message and associates the specified parser with the message. If the parser supports on-demand parsing, no parsing will happen in the RCD node. Even if you force the parsing to occur ( by setting Parse Timing to 'Immediate' ) the MRM parser never uses defautl values when parsing. Not when parsing XML. Not when parsing CWF. Not when parsing TDS. So 'reparsing' will not cause default values to be used.
You should not need the RCD node. The CWF physical format always uses default values when writing a message, so you should get what you want using MQinput -> Compute -> MQOutput. |
|
Back to top |
|
 |
harish_td |
Posted: Wed Feb 20, 2008 2:01 am Post subject: |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
Quote: |
You should not need the RCD node. The CWF physical format always uses default values when writing a message, so you should get what you want using MQinput -> Compute -> MQOutput. |
Thanks Kimbert. Was trying to see through the debugger instead of the destination queue  |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|