Kettle for updating stock and supplier info

I have been asked if it is possible to automate the process of setting correct and complete supplier and stock information for products. [Ideally this data should have been set cleanly during the conversion from RxWorks, but it was put off to be done after conversion.]

Does the following seem to be a viable approach for the supplier info:

  1. truncate etl_log to empty it of any previous data
  2. generate a csv file specifying the required information (for the supplier data: product entity id, supplier entity id, and all the info in entityRelationship.productSupplier)
  3. build and run a Kettle transform to set the required entries in etl_log so that the product and supplier can be found by the OpenVPMS loader
  4. build and run a Kettle transform that uses an Execute SQL step to delete any existing supplier entries for each product in the csv file - this requires the use of two Delete calls, the first to purge entries from entity_relationship_details, and the second to purge the entity_relationships record.
  5. build and run a kettle transform that uses the OpenVPMS loader to set the fields in entityRelationship.productSupplier from the csv file info

As similar approach can be used for the stock information - though there is the complication that the current stock quantity may not be accurate since there may have been transactions since the stock count.

[Now that we have the price export/import running, we should consider cloning this to allow bulk updates of the product/supplier and product/stockLocations data.]

Regards, Tim G

Comment viewing options

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

Re: Kettle for updating stock and supplier info

That will work, although given the hoops you have to jump through in order to run the loader it may be just as quick to do all the transforms in SQL.

Re: Kettle for updating stock and supplier info

Tim - after some internal discussion and my understanding that all the products involved can be identified by name (its all pet food), and the supply of a product list from the two vendors involved, it turns out that the easiest approach is a) set all the current products to inactive; b) use Kettle to load the replacement product set, setting all the details that need to be set.  And I can generate the Kettle code very quickly by cloning the stuff I used for conversion.

Thanks for your input.  Regards, Tim G

 

Syndicate content