Export data to web service in complex mapping

0
I am working on one web service. In that I need to pass data as a input to the web service in the form of list.  In below attachment image I am having one entity named “BureauCompanyDTO” and another is “FieldDTO”. Now I need to pass the data as a input to web service in such a way that all the attribute name means all attribute header names from “BureauCompanyDTO” should be the comes into Name attribute in “FieldDTO” entity one by one and alll the values of attributes from “BureauCompanyDTO ” entity should be comes into Value attribute in “FieldDTO” entity one by one may be it will form list of “FieldDTO” entity. Export Data to web service:     For Example :
asked
2 answers
0

I might be mistaken your problem here, but since you can create the NP objects yourself with microflows to reflect whatever you want I do not understand the problem you are facing.

Regards,

Ronald

My assumption is that you have persistent objects containing the information. Is my assumption correct that those are the top two objects? Then in a microflow just create the the top object create the AfieldList object and connect it to the top object and now iterate over BureauCompany and create FieldDTO objects and attach those to the AfieldList entity.

answered
0

I believe I understand what you are going for here. You would like to programatically create a ‘FieldDTO’ object for each ATTRIBUTE in the BureauCompanyDTO object, but can’t see a way to loop through all the attributes on an entity and perform an action at each step. You could write a microflow using the ‘MxModelReflection’ module that would allow you to retrieve all the attributes on that entity and then perform your loop.  However, it might just be easier to do this manually in a microflow: Pass in a BureauCompantDTO, then create a new FieldDTO object and for each one, hard code the ‘Name’ field, and for each ‘Name’ you could get the value. You could do something more programatic in Java, using the Runtime API method linked here, but if you write the microflow and annotate it well, it may be easier to maintain depending on your company’s familiarity with Java extensions.

answered