on 06-08-2010 9:12 AM
Hello All
Case: There is 0..n node in message. I need to get one field and map it to destination field but from one specific record in that node (i.e. satisfying some logical conditions based on other fields). How to create such mapping?
TIA
Best Regards
Maciej
Still doesn't work for multiple node elements...
When I have only one source element - logic works fine. But when there is more than one element in source collection - it still takes only first element under consideration. If the first element doesn't satisfy condition, the second one does - still only first is taken and mapping returns empty string...
How to make it work for whole collection?
Logic is built on two date comparators, one AND block and IF block which puts either empty string or value from source depending on conditions.
Regards
Maciej
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's how my logic looks like:
I've noticed one more thing that seems to be wrong: in queuea of both DateAfter/Before CurrentDate is only single value in input queue, but validFrom/To are multiplied (correct, as there are many records in input data).
Maybe I'm using some wrong approach to whole thing?
What I need to do is map field "symbol" to some destination field, choosing "symbol" from record which meets date based condition...
Any help will be appreciated
Regards
Maciej
Source structure:
Message 1..1
Datatype1 1..1
attr1
attr2
...
Datatype2 0..n
validFrom
validTo
symbol
Destination structure:
JDBC XML SQL message, where node ACCESS is 1..1 and there is attribute
Distributionsymbol 1..1 which is target for this mapping. There is no vf/vt in target structure, I just nieed to choose correct value from source and map it.
Regards
Maciej
Datatype2 0..n
validFrom
validTo
symbol
Destination structure:
JDBC XML SQL message, where node ACCESS is 1..1 and there is attribute
Distributionsymbol 1..1 which is target for this mapping.
There is no vf/vt in target structure, I just nieed to choose correct value
from source and map it.
in your source the node 1..1 and you have in your source multiple node. this no posible you need to
change the occurrence in your target.
what are the conditions....there could be n number of assumptions for your requirement!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
you can use Graphical Functions but is litle complicate or an UDF like example.
DateFormat df = new SimpleDateFormat ("yyyy/MM/dd");
Date datenow = new java.util.Date();
String result = "";
try{
Date d1 = df.parse(date_from);
Date d2 = df.parse(date_to);
if(d1.before(datenow) && datenow.before(d2))
result ="true";
}
catch(Exception e){
result = "false";
}
return result;
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.