Need to add the data from one entity to another

0
I want to add the data from one entity list to another entity list. I added a microflow where I am fetching the data from one entity list(OrderLine list) and trying to add into another list (OrderStored List). The issue I am facing here is: Suppose there are 2 objects in the first list(OrderLine List), I am looping through that list and using change list activity and adding the objects in 2 list which is (OrderStored list), at the end, I am only getting one objects been copied or stored in my 2 list which is(OrderStored List). Why is it so and how do I resolve this please? Also here in micrflow I ma retriveing the sea entity from dtaabse before the loop and after the loop the values are different in both the retrieve activities.  Please find the screenshots of microflow and the domain model here: Domain Model: Microflow:   Diffence of total objects in the same list before and after the loop:
asked
1 answers
0

I usually use the following approach:

 1° I perform the first retrieve of the entity that contains the data;

 2° I create an empty list of the second entity;

 3° I create an iterator over the retrieved list

      3.1 For each object in the itarator create a new object of the second entity;

      3.2 add to list (empty list)

 4° Outside the iterator I commit the new list created.

 This way the two entities will be equally populated

answered