[ 
https://issues.apache.org/jira/browse/UNOMI-468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Serge Huber resolved UNOMI-468.
-------------------------------
    Resolution: Fixed

> Improve CopyPropertiesAction to handle property mapping
> -------------------------------------------------------
>
>                 Key: UNOMI-468
>                 URL: https://issues.apache.org/jira/browse/UNOMI-468
>             Project: Apache Unomi
>          Issue Type: Improvement
>            Reporter: Taybou
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Hi,
> We should improve the copy properties action to add the behavior that copies 
> a property using the automaticMappingsFrom list defined in a property type as 
> it's done in the AllEventToProfilePropertiesAction
> For example if we have a property type as this:
> {code}
> {
>     "metadata": {
>         "id": "firstName",
>         "name": "First name",
>         "systemTags": [
>             "properties",
>             "profileProperties",
>             "basicProfileProperties",
>             "personalIdentifierProperties"
>         ]
>     },
>     "type": "string",
>     "defaultValue": "",
>     "automaticMappingsFrom": [ "j:firstName" ],
>     "rank": "101.0"
> }
> {code}
> the behavior of the AllEventToProfilePropertiesAction is to copy any value 
> from an incoming "j:firstName" property to the "firstName" property. This is 
> the code that is used to perform this:
> {code:java}
> String propertyMapping = 
> profileService.getPropertyTypeMapping(entry.getKey());
> String propertyName = (propertyMapping != null) ? propertyMapping : 
> entry.getKey();
> event.getProfile().setProperty(propertyName, entry.getValue());
> {code}
> The same behavior should be integrated into the new CopyPropertiesAction 
> which is aimed at replacing the AllEventToProfilePropertiesAction over time 
> as it is now deprecated.
> The CopyPropertiesActionIT class should also be improved to add a test case 
> for this use case.
> Thank you



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to