Author |
Message
|
sudeepm |
Posted: Mon Mar 10, 2008 5:19 am Post subject: Exception List |
|
|
Acolyte
Joined: 31 Jan 2008 Posts: 57
|
Can somebody tell me how can i find length or size of the exception list in java .
Actually i need to validate its length. |
|
Back to top |
|
 |
KIT_INC |
Posted: Mon Mar 10, 2008 6:01 am Post subject: |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
As far as I have seen, exceptionList is variable length. It can have many inserts. |
|
Back to top |
|
 |
sudeepm |
Posted: Mon Mar 10, 2008 6:05 am Post subject: |
|
|
Acolyte
Joined: 31 Jan 2008 Posts: 57
|
exactly,thats why i need a way to calculate the exact character count of the message and then use some logic depending upon that value.Also,i need to do this using java compute node.
thx |
|
Back to top |
|
 |
AkankshA |
Posted: Mon Mar 10, 2008 10:00 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
can u tell us what exactly is the requirement for which u need exception list count.... _________________ Cheers |
|
Back to top |
|
 |
sudeepm |
Posted: Mon Mar 10, 2008 10:19 pm Post subject: |
|
|
Acolyte
Joined: 31 Jan 2008 Posts: 57
|
I need to do two things.
1) I need to create an exception message and in that i have exceptionTrace element .here in this field i need to populate whole exception list.
2) then this whole exception message is passed to next flow where this message will be validated and i have to check whether the length of fields are with in the range or not.
so i need to check the size /length of the exception trace element also to validate it.
I hope I am clear .
And i need to use Java compute node only |
|
Back to top |
|
 |
AkankshA |
Posted: Mon Mar 10, 2008 10:29 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
sudeepm wrote: |
1) I need to create an exception message and in that i have exceptionTrace element .here in this field i need to populate whole exception list.
2) then this whole exception message is passed to next flow where this message will be validated and i have to check whether the length of fields are with in the range or not.
so i need to check the size /length of the exception trace element also to validate it.
|
in eSQL you can create a bitstream and use LENGTH function...
sudeepm wrote: |
And i need to use Java compute node only |
Not my flavor
If i remember correctly we do have toBitstream function but not sure if that can be called for exception list _________________ Cheers |
|
Back to top |
|
 |
sudeepm |
Posted: Mon Mar 10, 2008 11:53 pm Post subject: |
|
|
Acolyte
Joined: 31 Jan 2008 Posts: 57
|
I am able to do it.
below are the steps that i followed, this may help others
1)Created a env variable
2)as bitstream works only on root element`s last child (that means main payload) so we need to create a whole strutcure in env variable.
3)so env varable structure will be like this
1.Properties
2) MQMD
3)XML
RecoverableException elt
there i copied the whole exception list
then applied tobitstream on it. and got the byte array.
convert this byte array to string. |
|
Back to top |
|
 |
|