Author |
Message
|
ramki |
Posted: Fri Jan 25, 2002 3:01 pm Post subject: |
|
|
Apprentice
Joined: 25 Sep 2001 Posts: 28
|
I used the "OutputDestinationList" as below in the if conditions as mentioned.
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueName='xxxx'
Thanks for the Solution. But there is still a problem here......
Actually I am also setting the OutputRoot as below based on the if condition.
IF CONDITION X = 'Y' THEN
SET OutputRoot.Properties.MessageType = 'm_message1';
TRANSFORMATION1
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueName = 'first.IN';
END IF;
IF CONDITION Z = 'Y' THEN
SET OutputRoot.Properties.MessageType = 'm_message1';
TRANSFORMATION2
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[2].queueName = 'second.IN';
END IF;
In my code i used the if conditions to Set the OutputRoot.Properties.MessageType and OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueName
The problem is I am getting the messages in the other Else-Queue and also in the target Queue. I mean I am getting extra messages on the second queue.
Please let me know if I shouldn't use this way. Thanks in advance.
|
|
Back to top |
|
 |
mpuetz |
Posted: Sat Jan 26, 2002 1:21 pm Post subject: |
|
|
Centurion
Joined: 05 Jul 2001 Posts: 149 Location: IBM/Central WebSphere Services
|
Hi,
I don't quite get the logic of this, so please elaborate.
Are you trying to say that you do all of this in a single compute
node like this
if condition1 then
transform1
detination1
end if
if condition2 then
transform2
destination2
end if
i.e. are conditions 1 and 2 mutually exclusive, or can both
be true at the same time ?
_________________ Mathias Puetz
IBM/Central WebSphere Services
WebSphere Business Integration Specialist |
|
Back to top |
|
 |
ramki |
Posted: Sat Jan 26, 2002 5:46 pm Post subject: |
|
|
Apprentice
Joined: 25 Sep 2001 Posts: 28
|
Yes I am trying to do these different transformations on one compute node.
The data Coming in is of the same format, but the data is transformed in the compute node based on If coditions into different Output formts and has to send to different Destination Queues.
IF CONDITION InputBody.elemet1 = 'Y' THEN
SET OutputRoot.Properties.MessageType = 'm_message_type1';
TRANSFORMATION1
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueName = 'Type1.IN';
END IF;
IF CONDITION InputBody.elemet1 = 'Z' THEN
SET OutputRoot.Properties.MessageType = 'm_message_type2';
TRANSFORMATION2
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[2].queueName = 'Type2.IN';
END IF;
I could solve this problem by sending the data from InputNode to three different
Compute nodes and do the respective transformations in each compute node and then send to OutputNode attached to each computeNode. This meathod makes the data send to 3compute nodes making the data parse 3times.
I really doubt if we can do this in one compute node way. Please let me know if it is possible.
better way.
Thanks In Advance.
|
|
Back to top |
|
 |
mpuetz |
Posted: Sun Jan 27, 2002 4:36 am Post subject: |
|
|
Centurion
Joined: 05 Jul 2001 Posts: 149 Location: IBM/Central WebSphere Services
|
Hi,
ok, so your conditions for transform1 and trandform2
are mutually exclusive. Then you can do it in a single
compute node.
Your mistake is to increment the DestinationData index to 2 in
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[2].queueName = 'Type2.IN';
since the DestinationData[1] has never been created you shouldn't
be able to access element number 2 (i.e. you should have gotten
a runtime error stating that you can't access the second element
of name DestinationData).
Always use DestinationData[1] and it should work. (acutally if you
leave out the index completely defaults to [1] anyway).
Since didn't get the runtime error for accessing the wrong index
I assume you have modified the DestinationData[] list before this
node in your flow and it might still contain some stale entries.
So do a
SET OutputDestinationList.Destination.MQDestinationList = NULL;
first to make sure no stale entries get in the way.
_________________ Mathias Puetz
IBM/Central WebSphere Services
WebSphere Business Integration Specialist |
|
Back to top |
|
 |
ramki |
Posted: Mon Jan 28, 2002 8:58 am Post subject: |
|
|
Apprentice
Joined: 25 Sep 2001 Posts: 28
|
"mutually exclusive". Can't we have some condition which is not mutually exclusive.
I mean, in the above problem there is one more condition which satisfies both the If conditions and has to go thru the different transformations with different OutputRoots. how can we assign the Destination list with two different formats and to different queues.
Thanks in advance!!
IF CONDITION InputBody.elemet1 = 'Y' THEN
SET OutputRoot.Properties.MessageType = 'm_message_type1';
TRANSFORMATION1
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueName = 'Type1.IN';
END IF;
IF CONDITION InputBody.elemet1 = 'Z' THEN
SET OutputRoot.Properties.MessageType = 'm_message_type2';
TRANSFORMATION2
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueName = 'Type2.IN';
END IF;
IF CONDITION InputBody.elemet1 = 'Y' OR 'A' THEN
SET OutputRoot.Properties.MessageType = 'm_message_typecommon';
TRANSFORMATION1
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[2].queueName = 'common.IN';
END IF;
|
|
Back to top |
|
 |
kirani |
Posted: Mon Jan 28, 2002 12:08 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Ramki,
Please see the code below for an example of destinationList. Hope this will help you in understanding how destinationlist works.
Lets say, depending on Value of “element1” you want to apply different transformations and the output should goto different queues. Here I am assuming that the conditions are "mutual exclusive".
The code for this is,
IF (condition 1) THEN
--TRANSFORMATION1
SET OutputRoot.Properties.MessageType = 'm_message_type1';
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueName = 'Type1.IN';
END IF;
IF (condition 2) THEN
--TRANSFORMATION2
SET OutputRoot.Properties.MessageType = 'm_message_type2';
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueName = 'Type2.IN';
END IF;
IF (condition 3) THEN
--TRANSFORMATION3
SET OutputRoot.Properties.MessageType = 'm_message_type3';
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueName = 'Type3.IN';
END IF;
You cannot apply different transformations in one compute node, if your conditions are not mutual exclusive. You cannot create 2 different output messages in one compute node. To achieve this kind of requirement you should use multiple compute nodes.
I hope its clear now.
Regards,
Kiran
|
|
Back to top |
|
 |
|