How to modify mapping attributes in assign

Long story short: Is there a way to change mapping from entitie's attributes to an enitity and vice versa in an assign?

Now the long story:

I have this specific issue. I have 2 Entities, which are not fully compatible and I need to assign an instance of one entity into an instance of another entity. An assing by default provides a mapping for each attribute, so I can set each of the attribute however I need. However I have found a limitations to this

I have a case that I need to map a Record of Entities to another Record of Entities. Now sometimes the assign mapping tool lets me assign whole objects, sometimes it lets me assign all objects attributes. Is there a way to control or change this?

A quick example (for details check an attached .oml file): I have two Entities, Square and Triangle, they have some attributes in common, some can't be easily mapped (you can guess which properties of squares and triangles are/n't simillar). Then I have two structures, let's say an input structure "RawShapesSet" (attributes: MajorSquare, MinorSquare, DateOfManufacture) which I need to assign into "ProcessedShapesSet" (attributes: MajorTriangle, MinorSquare, DateOfManufacture). In an assign I get the following mapping:

For Triangle I get an assignment for all of its attributes, for Square I get a whole Entity assignment (and for DateOfManufacture I get a Date assignment). Is there a way to change mapping from entitie's attributes to an enitity and vice versa in an assign so I can for use for example a SquareToTriangle function as there are benefits of much better reusability and maintainability?

Finally I would like to say, that this is a very simplified example, my actual project is way more complex (mainly I need to map lists of records instead of just records) and although I need to implement any solution to this problem, I would really prefer to solve it by this mapping in an assign. One of the worst case scenarion I can think of straight away is to manually iterate through the source list and manually process each record. I can't use the all attributes manual assignment, I need to use the "SquareToTriangle" function


If anyone has a really clever tip, it would be great!

I also faced the same problem on different occasions, but unfortunately, I believe there is no way so far..

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.