Paul D.
Paul D.

Reputation: 181

How to export a certain row from a table when it changes the value as an XML using Mule?

Apologies if this question has been asked before.

I am new to Mule and I need a bit of help on how to export a certain row from a Table as an XML. Is it a good idea to use the poll scope to handle this?

I need the XML to plug it in an external program. Any ideas or simple examples I can play with?

thanks and Have a good day

Upvotes: 0

Views: 46

Answers (3)

Naveen Kumar
Naveen Kumar

Reputation: 31

Using Poll or HTTP Request depends on your requirement, if you need to get the records based on a particular schedule then you can Use Poll(where this jus acts as a schedule for the database call). If you want this to happen with any external trigger then go for HTTP. Then use the Database transformer/message Processor from the pallette, configure your Database and in the configuration you can write the select query with what ever the fields required. then you can play the with the structure returned with value to map with the xml transformer object.

Hope this helps you, people have given the same answer but i thought this should be add on to those and helps.

Upvotes: 1

Manik Magar
Manik Magar

Reputation: 1401

You can use Poll scope with Database connector in it to select the records you want to transform. Then yo can use DataWeave to transform that to xml or Object to XML transformer to convert to XML as-is.

Upvotes: 1

vijay dhanakodi
vijay dhanakodi

Reputation: 175

Use a Database Component to poll out records from database. In my knowledge there is no connector to transform database to xml as you need. Use a custom transformer to convert database resultset to xml.

Go through This link

Db to XMl tranformation in Mule

Once you got the required xml the its your scope to decide where to you to push that output.

Kindly share the xml config to help further.

Cheers!

Upvotes: 0

Related Questions