Author |
Message
|
seraphim119 |
Posted: Mon Sep 04, 2006 12:34 am Post subject: help me,,MB problem about routetolabel |
|
|
Acolyte
Joined: 04 Sep 2006 Posts: 57
|
this is my xml example:
<?xml version="1.0" encoding="gb2312"?>
<MSG>
<head>
<msgid>0000000001</msgid>
<msg type="card" />
<time>20060829</time>
<queuefrom>cardrtn<queuefrom>
</head>
<body>
收到的信息
</body>
<process type="complex" steps="2" now="1">
<processing id="1">
<queen>111</queen>
<status>ok</status>
<rtncode></rtncode>
<rtnmsg></rtnmsg>
</processing>
<processing id="2" request="no">
<queen>222</queen>
<status></status>
<rtncode> </rtncode>
<rtnmsg></rtnmsg>
</processing>
</process>
</MSG>
if i want to put the message to the queen accouding to the <queen> value,how should i write code in esql compute?? anyone can help me??
if anyone know how write in a javacompute please tell me too,,thank you very much!!! |
|
Back to top |
|
 |
jbanoop |
Posted: Mon Sep 04, 2006 12:59 am Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
|
Back to top |
|
 |
seraphim119 |
Posted: Mon Sep 04, 2006 1:10 am Post subject: |
|
|
Acolyte
Joined: 04 Sep 2006 Posts: 57
|
i had searched almost all the info about routetolabel,but it didn't work...
CREATE PROCEDURE Route() BEGIN
--set OutputRoot."XML"."MSG.process.processing[1].queen"='aaa';
--if InputRoot.XML.MSG.process.processing[1].queen<>'' then
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname =FIELDNAME(InputRoot.XML.MSG.process.processing[1].queen);
--else
--SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname ='other';
--end if;
END;
the javacompute i have checked too,but i can't find anything,,give me a sample please please please... |
|
Back to top |
|
 |
jbanoop |
Posted: Mon Sep 04, 2006 1:23 am Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
what exactly did u do .. could you explain your flow structure a bit.
I guess you would know that the combinations of route-to-label and label nodes should be used for achieving this and that the label name you set in ESQL/java to the local environment should match the name property of the label node.
use
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname =InputRoot.XML.MSG.process.processing[1].queen;
if you need to set the label name to the value present in the queen tag (if i have not misunderstood)
Describe what you did and what were the problems/errors you faced.
Regards,
Anoop |
|
Back to top |
|
 |
seraphim119 |
Posted: Mon Sep 04, 2006 1:23 am Post subject: |
|
|
Acolyte
Joined: 04 Sep 2006 Posts: 57
|
i will wait online,is anyone help me????!!!!!!!! |
|
Back to top |
|
 |
seraphim119 |
Posted: Mon Sep 04, 2006 1:29 am Post subject: |
|
|
Acolyte
Joined: 04 Sep 2006 Posts: 57
|
your code i have used ,but can't work,
if i write directly String like:
OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = "111";
it will work right |
|
Back to top |
|
 |
jbanoop |
Posted: Mon Sep 04, 2006 1:31 am Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
if you set the label as
OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = "111";
then you should have a label node in that flow with name property as 111.
Also, you should change properties of compute node to allow message and local environment
Anoop |
|
Back to top |
|
 |
seraphim119 |
Posted: Mon Sep 04, 2006 1:35 am Post subject: |
|
|
Acolyte
Joined: 04 Sep 2006 Posts: 57
|
yes,you are right ,i have set that as you say,but my question is :
if i want to set the label as the value of queen tag,how can i write,,,
i can't get it,,, |
|
Back to top |
|
 |
jbanoop |
Posted: Mon Sep 04, 2006 1:38 am Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
Quote: |
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname =InputRoot.XML.MSG.process.processing[1].queen; |
u need to be reading up the basics of MB before just diving into questions .. read through the other posts carefully and if u cant understand then i guess u need to work on ur MB basics first.
http://publib.boulder.ibm.com/infocenter/wbihelp/v6rxmx/index.jsp
Anoop |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 04, 2006 1:41 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
seraphim119 wrote: |
if i want to set the label as the value of queen tag,how can i write,,,
|
Are you trying to set the label at run time from within a node? AFAIK that's not possible! Labels have to be set and deployed at run time.
Can you give us some idea of your requirements - why do you need to do this? Or have I misunderstood?  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
seraphim119 |
Posted: Mon Sep 04, 2006 1:45 am Post subject: |
|
|
Acolyte
Joined: 04 Sep 2006 Posts: 57
|
i have 2 queen, 111 and 222 , just for example
when the xml is sent to the esql compute,the esql compute read the value of <queen> tag, then according to this value,the message will be sent to the queen 111 or 222 pass by a routetolabel and 2 labels
do i describe particular??? |
|
Back to top |
|
 |
jbanoop |
Posted: Mon Sep 04, 2006 1:52 am Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
My understanding was that depending upon the value of the queen tag he needs to route it to one of many labels .. the standard use of labels..
yes the labels have to be defined at deployment. To which label a request would be routed wld depend on that actual input at runtime.
Anoop |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 04, 2006 1:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
You describe a message flow with labels in it!
So in your sample you have these two <queen> tags each with a separate value and you want to route all or part of this message to 2 subflows via labels, yes?
I recommend you read the posts which have answered your question, especially the advice of jbannoop to read up on some flow basics! _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
seraphim119 |
Posted: Mon Sep 04, 2006 2:30 am Post subject: |
|
|
Acolyte
Joined: 04 Sep 2006 Posts: 57
|
but i have no time ,can you give me a code first,then i will study step by step,,,hoho : ) |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 04, 2006 2:45 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
seraphim119 wrote: |
but i have no time ,can you give me a code first,then i will study step by step,,,hoho : ) |
No problem, as we have no prior existing arrangement you'll need to pay me up front but my hourly rates are very reasonable. Please provide full statement of requirements and invoicing address...
Seriously, people have provided about as much code as you need already and this forum is not intended either as a training camp or a pool of coding resources. Also if you use us to meet an unreasonable deadline, they'll just give you a shorter deadline next time because they think you can work fast! Push back, get more time, you're worth it!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|