Skip to Content

PI / HCI useOneAsMany mapping question

Hello everyone,

let's say we have following node structure :

/compoundemployee/person/employment_information -> 0:1 records

custom_string1

end_date

start_date

user_id

...

/compoundemployee/person/personal_information -> 0:n records

end_date

start_date

....

Question:

For selection of personal_information, personal_information/start_date needs to be >= employment_information/start_date <= personal_information/end_date.

I tried the mapping below, but for attached test data I get for person_id 2714 the personal_information from 2810. For 2810 I get the personal_information from 2830. There seems to be some context issue, but can't exactly point out why.

The personal_information/end_date value can be null, so I have added 'mapWithDefault'. To keep the queue consistent, I have added 'mapWithDefault' to personal_information in 'useOneAsMany', as i.e person_id 20 has no personal_information.

The context of employment_information/start_date below is changed to /person, this is a 0:1.

Test data attached :

  • the used xsd file
  • xml file with sample data
  • person_id's with no or multiple personal_information records are 20, 2090, 2112, 2173, 2490, 2510, 2671, 2714, 2791, 2810

Any clue?

Thanks again, appreciated -

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 06, 2016 at 10:20 AM

    Hi Kevin,

    Use below mapping.start_date and end_date from personal_information context should be person.

    Regards,

    Praveen.


    map30.png (26.2 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Apr 06, 2016 at 09:17 AM

    Hi Kevin,

    You need to maintain consistent context. Please see the mapping below:

    personal_information/startdate and personal_information/enddate context should be set

    to person. That way there is no need to use format by example. Please let me know if the output is correct 😊

    Regards,

    Mark


    test.ong.png (39.6 kB)
    Add comment
    10|10000 characters needed characters exceeded