Loading EntityLinks via the Kettle Loader

I am having trouble working out how to load entityLinks via Kettle...If i attempt to load a customer with no practice defined I get

2016/03/28 23:05:15 - customerPerson.0 - Failed to process row 2986: Factory org.openvpms.component.business.service.archetype.JXPathGenericObjectCreationFactory@361f4240 could not create an object for path: /entityLinks

​The loader looks like (you get the idea)

Field name    Map to    Exclude null    Value    Remove default objects
active    <party.customerperson>active    N        Y
adName    <party.customerperson>companyName    Y        Y
createdDate    <party.customerperson>createdDate    Y        Y
FirstName    <party.customerperson>firstName    Y        Y
LastName    <party.customerperson>lastName    Y        Y
Title    <party.customerperson>title    Y        Y
ACCTYPE    <party.customerperson>type[0]    Y    <lookup.customerAccountType>code=$value    Y
oCIDdescr    <party.customerperson>identities[0]<entityIdentity.code>description    Y        Y
oCID    <party.customerperson>identities[0]<entityIdentity.code>code    Y        Y

I had assumed it would assign the default.

I have tried

with the value set as the entity_id of the practice I want to assign.

<party.customerperson>practice[0]<entityLink.organisationLocation>target

I also tried

<party.customerperson>practice   and set the Value to <party.organisationLocatin>entity_id=$value

 

Anyone have any ideas.

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Loading EntityLinks via the Kettle Loader

I have not used Kettle in anger for a couple of years - and in those days it was all entityRelationships.  I just has a look at how I glued patients to customers.

First I loaded all the customers and all the patients, then I ran another transform to glue the patients to the customers - and the OpenVPMS step for this was:

So in your case, I would load the customers without setting the practice location and then add a step to link the customers with the practice - by creating the entityLink.customerLocation records.

I just looked at how I loaded products - and that was done the same way - ie load the raw product data, then run separate steps to link to productType, supplier, etc

Regards, Tim G

Re: Loading EntityLinks via the Kettle Loader

You should be able to do it in a single transform. If CustomerID is your "Id Field Name":

Field Name Map To Value
CustomerID <entityLink.customerLocation>source <party.customerperson>$value
LocationID <entityLink.customerLocation>target <party.organisationLocation>$value
.... other customer mappings .....

That said, I've used Kettle less recently than Tim G.

Re: Loading EntityLinks via the Kettle Loader

I think the problem is that the loader appears to require the entityLink be populated when the customer is created....if I leave the practice field blank it basically throws the error I reported above - my solution was to revert the archetype in the database to a version with no entitylink and then upload the customers - then basically change it back once I was done.  

This worked but its a pretty bad fudge

I dont think you can create the entityLink at the same time as the party because it would appear to create a circular dependency.

ie CustomerID isnt in the etl Log until the customer is loaded.

 

The other issue I mentioned on  Dev forum is the ANYTHING with a derived value is failing validation using the loader. on version 1.8.1

ie 

Failed to validate Description of Patient (Pet): Failed to get value

Unticking the derive value checkbox and reloading kettle solves this..

 

Am I correct in saying that as soon as the Kettle OpenVPMS loader plugin gets a database connection it loads the archetypes once - you actually have to unload kettle altogether to refresh archetypes in the loader?

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Loading EntityLinks via the Kettle Loader

You can't do a partial population of the entityLink as the source and target nodes are both required.

You can do it in the same transform as the customer information; the loader will take care of the source so long as you use the same Id as the "Id Field Name" in the mapping.

The plugin caches archetypes, so if you change them you'll need to restart Kettle.

 

 

Re: Loading EntityLinks via the Kettle Loader

Ill try loading it the same loader cheers Tim

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Loading EntityLinks via the Kettle Loader

I would say this might be the issue

29 Mar 2016 21:53:56,549  WARN ArchetypeDescriptorCacheDB,Thread-11:166 - Failed to load descriptor entityLink.HL7PharmacyGroupPharmacy.1.0 b/c of error  [java.lang.ClassNotFoundException: org.openvpms.component.business.domain.im.common.EntityLink].
29 Mar 2016 21:53:56,549  WARN ArchetypeDescriptorCacheDB,Thread-11:166 - Failed to load descriptor entityLink.HL7ServiceLocation.1.0 b/c of error  [java.lang.ClassNotFoundException: org.openvpms.component.business.domain.im.common.EntityLink].
29 Mar 2016 21:53:56,550  WARN ArchetypeDescriptorCacheDB,Thread-11:166 - Failed to load descriptor entityLink.HL7ServiceReceiver.1.0 b/c of error  [java.lang.ClassNotFoundException: org.openvpms.component.business.domain.im.common.EntityLink].
29 Mar 2016 21:53:56,550  WARN ArchetypeDescriptorCacheDB,Thread-11:166 - Failed to load descriptor entityLink.HL7ServiceSender.1.0 b/c of error  [java.lang.ClassNotFoundException: org.openvpms.component.business.domain.im.common.EntityLink].
29 Mar 2016 21:53:56,550  WARN ArchetypeDescriptorCacheDB,Thread-11:166 - Failed to load descriptor entityLink.HL7ServiceUser.1.0 b/c of error  [java.lang.ClassNotFoundException: org.openvpms.component.business.domain.im.common.EntityLink].
29 Mar 2016 21:53:56,550  WARN ArchetypeDescriptorCacheDB,Thread-11:166 - Failed to load descriptor entityLink.practiceServiceUser.1.0 b/c of error  [java.lang.ClassNotFoundException: org.openvpms.component.business.domain.im.common.EntityLink].
29 Mar 2016 21:53:56,551  WARN ArchetypeDescriptorCacheDB,Thread-11:166 - Failed to load descriptor entityLink.batchLocation.1.0 b/c of error  [java.lang.ClassNotFoundException: org.openvpms.component.business.domain.im.common.EntityLink].
29 Mar 2016 21:53:56,551  WARN ArchetypeDescriptorCacheDB,Thread-11:166 - Failed to load descriptor entityLink.batchManufacturer.1.0 b/c of error  [java.lang.ClassNotFoundException: org.openvpms.component.business.domain.im.common.EntityLink].
29 Mar 2016 21:53:56,551  WARN ArchetypeDescriptorCacheDB,Thread-11:166 - Failed to load descriptor entityLink.batchProduct.1.0 b/c of error  [java.lang.ClassNotFoundException: org.openvpms.component.business.domain.im.common.EntityLink].
29 Mar 2016 21:53:56,551  WARN ArchetypeDescriptorCacheDB,Thread-11:166 - Failed to load descriptor entityLink.locationProductType.1.0 b/c of error  [java.lang.ClassNotFoundException: org.openvpms.component.business.domain.im.common.EntityLink].
29 Mar 2016 21:53:56,552  WARN ArchetypeDescriptorCacheDB,Thread-11:166 - Failed to load descriptor entityLink.productIncludes.1.0 b/c of error  [java.lang.ClassNotFoundException: org.openvpms.component.business.domain.im.common.EntityLink].
29 Mar 2016 21:53:56,552  WARN ArchetypeDescriptorCacheDB,Thread-11:166 - Failed to load descriptor entityLink.productPharmacy.1.0 b/c of error  [java.lang.ClassNotFoundException: org.openvpms.component.business.domain.im.common.EntityLink].

THis is using 1.8.1 and I confirmed the jars in the loader and the webapp were the same

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Loading EntityLinks via the Kettle Loader

Again this was caused by having old framework jars in the classpath...

due to the previous issues with spring . and kettle 3.2

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au
Syndicate content