on 02-23-2011 4:05 PM
Hello,
I have a source message with a node that is 0... unbounded.
The node contains a field named "component_name" with occurence 1..1.
The target message contains only two single fields (component1, component2) and the task is to provide the first two occurences to these fields.
node occ.1
component <modul beta> -> component1
node occ.2
component <modul omega> -> component2
We can expect to have any case like these:
node is 0 -> no components provided
node is 1 -> one component provided (usual case) , so second field will be empty
node is 2 -> two components provided
node is > 2 -> need to pick the first two components to provide them to the target fields.
Does anybody here have an idea how to solve this mapping issue?
Your ideas are really welcome!
Best regards
Dirk
constant(1) \
node - index - equalA - ifwithoutelse - mapwithdefault(empty) - component1
component /
component2 similar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stefan's solution is very good, alternatively, if you are sure that you will always have at least two items you can do
source -> copyValue[0]-> target
source -> copyValue[1]-> target
please note: if you don't have at least two items in your source the copyValue function will throw an exception
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A UDF should solve your issue. Take the fields complete queue as the input. Check for the first occurance in code and return it. Similarly check for the second occurance and return. Should work.
VJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.