Author |
Message
|
brgmo |
Posted: Thu Apr 14, 2005 3:27 am Post subject: How to expore ExceptionList |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
Hi Guys
I have a doubt regarding exception list.Suppose if i have a message which has one of its tag missing.At the time the exception is thrown by the node and exception list is populated,how would my flow know that this exception occured because of missing tag.Probably i can dig up the exception list and find out this exception occured because of missing tag.But how far i should go in the exception list tree that i get the information that exception occured due to this error.So,basically i am not getting an idea as how the code should be written to get the exact reason for exception because the exception list has numerous children and i dont know where the error message is hidden.So,does it mean that i keep on parsing each and every child of exception list.
brgmo. |
|
Back to top |
|
 |
waugh |
Posted: Thu Apr 14, 2005 5:57 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 225
|
SET OutputRoot.XML.MYException.ExceptionData = InputExceptionList;
then explore OutputRoot.XML.MYException.ExceptionData.*[1] for what you need...
for example, following code gives you the description of exception.
DECLARE start REFERENCE TO OutputRoot.XML.MYException.ExceptionData.*[1];
SET OutputLocalEnvironment.InsertData ='';
WHILE start.Number IS NOT NULL DO
MOVE start LASTCHILD;
IF start.Number IS NOT NULL
THEN
DECLARE DataCount INT;
SET DataCount =1;
DECLARE Count INT;
SET Count =1;
DECLARE CountInsert INT;
SET CountInsert = CARDINALITY (start.[]);
WHILE Count <= CountInsert DO
IF FIELDNAME(start.[Count]) = 'Insert' THEN
SET Environment.TempInsertData[DataCount] = '[Error Data Value:] '||start.[Count].Text||' ';
SET OutputLocalEnvironment.InsertData = OutputLocalEnvironment.InsertData||OutputLocalEnvironment.TempInsertData;
SET DataCount =DataCount +1;
END IF;
SET Count =Count +1;
END WHILE;
SET Environment.DescriptionData = start.Text||' - '||start.Insert[<].Text;
END IF;
END WHILE;
-- You should have your excetion description in Environment.DescriptionData, inserts in OutputLocalEnvironment.InsertData now.....
hope this helps.... |
|
Back to top |
|
 |
JT |
Posted: Thu Apr 14, 2005 11:36 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
|
Back to top |
|
 |
angka |
Posted: Sun Jan 08, 2006 7:12 pm Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi waugh,
I tried out your code and I ve a few questions which I hope you can help me with. If my sender is a publisher and it sends a message to a few subscribers and more than one transmission queues is full I can't get all the error queues because of the LASTCHILD function. Correct me if I am wrong. The LASTCHILD function will get to the last child of the parent and if my xml error structure consists of more than one error, I will only be able to get the last error. I tried out using NEXTSIBLING, PREVIOUSCHILD function but it still don't work for me. Is there any simpler way to get all the error queues?? Thank you in advance.
Rgds. |
|
Back to top |
|
 |
angka |
Posted: Tue Jan 10, 2006 6:10 pm Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
Can anyone help? Thanks
Rgds. |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Jan 10, 2006 10:22 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi angka,
It took me some time to figure out what u wanted....i'm still not sure
Anyway, if your problem is that you are getting multiple complex tags(with insert tags) in every previous complex type and you want to go to each one of these complex types, then
MOVE start NEXTSIBLING should work....
Why dont you paste the Error message you have, indicating what all fields you want to pick and also the code you have tried.
Regards. |
|
Back to top |
|
 |
aks |
Posted: Thu Jan 12, 2006 9:11 pm Post subject: |
|
|
Voyager
Joined: 19 Jul 2002 Posts: 84
|
Try this
Code: |
CREATE PROCEDURE writeExceptions(INOUT errorRef REFERENCE, IN exceptionRef REFERENCE)
BEGIN
DECLARE path CHARACTER '';
DECLARE start REFERENCE TO exceptionRef.*[1];
-- Loop through the exception list children
WHILE (start.Number IS NOT NULL) DO
SET path = path || COALESCE(start.Text, '') || ' - ' || COALESCE(start.Insert[<].Text, '');
-- Move start to the last child of the field to which it currently points
MOVE start LASTCHILD;
END WHILE;
SET errorRef."ErrorText" = path;
END; |
errorRef is a node where errors are written, and exceptionRef is a reference to InputExceptionList
Alan |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Jan 12, 2006 9:28 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi aks,
You created a procedure out of the second while which waugh posted...
But this is not the problem which angka is facing I think else the previous code should have worked.
Regards. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 13, 2006 4:40 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I think, since the original post was from April of last year, that angka is not still looking for an answer. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
elvis_gn |
Posted: Sun Jan 15, 2006 8:26 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
jeff:
Her last post saying
Quote: |
Can anyone help? Thanks |
Was on Jan 11-2006
Regards. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jan 16, 2006 6:44 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I missed that someone hijacked the thread. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|