AUTO COMMIT : Published Webservice with Persistent enity for zero to many xml element

0
I had a requirement to create a WS in mendix which accepts zero or more values in xml element with few attributes within it. For this i created a persistent entity and the micrflow is exposed as a webservice. How when I execute the WS from SOAPUI or actually in Cloud, for each xml segment of this entity I have that many rows created in database table for that entity. Basically i dont want this to happen since I have a requirement that after few moderation's I need to create an entry in the table for this entity. Apparently now its doing it twice(once i do it in a micrflow and once its from the xml segment from request body) How to overcome this?
asked
1 answers
0

Ganesh,

From your question I gather that you have a microflow published as a webservice that has an input parameter (list of a certain entity) and in your microflow you create the object after some modifications. If this is correct then you probably are looping through the input list and creating the entity records after modifying them. You can do the modifications and just commit the changes to the objaects as they are already created. That way you'll only have the modified objects in your table once in stead of twice.

From the documentation:

Web service parameter handling:

Depending on which types of parameters are inputs to the published Microflow, two things can happen.

If an input is a Domain Entity, the XML is translated to the entity using an XML-to-Domain mapping. Note that these mappings create actual domain objects, depending on the mapping.

Normal parameters (integer, string etc) aren't converted in any way and used as inputs directly.

Microflow is executed

Once the parameters have been parsed from the XML, the microflow call proceeds as normal.

answered