on 03-17-2009 6:23 PM
Hey Experts,
I am facing simple mapping problem.
My source structure is as follows
Details... 1...unbound
-
name..1..1
-
empid..1..1
Target structure is also same
I have following UDF
if(a.length == 0 )
Throw CustomException();
else
result.addValue(a[0]).
Mapping:
name - UDF - name
empid - UDF - empid.
I have given folloiwng values while testing
Details
-- name - abc
-- empid - 123
Details
-- empid - 234
If I am not giving the "name" at first level it is throwing custom exception
If I am not giving the "name: at second level ( like ex specified above) it is not throwing the custom exception it is throwing ArrayIndexOutOfBoundsException 0.
Can any one suggest me why?
Regards
Sowmya
Sowmya:
Your testing scenario violate your data type schema:
Your "Details" occur from 1, it means your your source message, you will have at least 1 "Details" node.
Inside your your "Details", you have "name" and 'empid", they are both 1:1, means under your "detals" node,
you have to pass "name" node and "empid" node.
However, in your test, you did not pass your "name" node, it violate your data type defination.
I think your UDF is "Queue" type, so it only process your first context, this is the reason that you got exception when you did not pass your first name. and you did not get exception for missing second "name".
If you change your UDF to "Context" type, you will see exception when you missing second "name"
Regards.
Liang
Edited by: Liang Ji on Mar 17, 2009 7:42 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sowmya,
Check out the all inputs to your UDF having same number of inputs or node context is set properly.
This problem is because of the context level. You can right click on node and set context level.
Hope this will help.
Nilesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.