I am trying to insert the contents of an JSON to a MySql database using Mule ESB. The JSON looks like:
{ "id":106636, "client_id":9999, "comments":"Credit", "salesman_name":"Salvador Dali", "cart_items":[ {"citem_id":1066819,"quantity":3}, {"citem_id":1066820,"quantity":10} ] }
On mule I want to insert all data on a step like:
Currently i have come this far on Mule: MuleSoft Flow
There is an excellant article here http://www.dotnetfunda.com/articles/show/2078/parse-json-keys-to-insert-records-into-postgresql-database-using-mule that should be of help. You may need to modify as you need to write the order_header data first and then use a collection splitter for the order_detail and wrap the whole in a transaction.