Author |
Message
|
mpong |
Posted: Fri Mar 31, 2017 9:25 am Post subject: auto increment value on attribute on mapping node |
|
|
Disciple
Joined: 22 Jan 2010 Posts: 164
|
I have (for each) mapping on mapping node, where the target xsd has attribute called id, which need to be assigned from 0 to n based on the number of for each.
I have an option to assign a value on the attribute but I am not sure how can i increment it by 1 for every for each, I don't want to implement outside of map node.
Still trying but no luck yet, pls let me know your thoughts[/img] |
|
Back to top |
|
 |
DeadPool |
Posted: Mon Apr 03, 2017 7:36 am Post subject: |
|
|
Apprentice
Joined: 27 May 2016 Posts: 30
|
I am assuming this is not a case of just cardinality but rather a check of what has been done looking at teh previous number and then adding 1 and entering that number.
I suspect you may have to write a custom esql or java transform to do this which would be callable within the mapping
Not the ideal way but is atleast 1 way |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Apr 03, 2017 8:33 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
A foreach and a submap? _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
timber |
Posted: Mon Apr 03, 2017 8:41 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Not sure whether the XPath position() function is supported by the Mapping node, and useful for this purpose? |
|
Back to top |
|
 |
mpong |
Posted: Mon Apr 03, 2017 2:54 pm Post subject: |
|
|
Disciple
Joined: 22 Jan 2010 Posts: 164
|
I have implemented thru custom esql but I will give it a try using XPath position() function |
|
Back to top |
|
 |
|