@ -569,47 +569,48 @@ public class CalculatedFieldEntityMessageProcessor extends AbstractContextAwareM
}
private Map < String , ArgumentEntry > mapToArguments ( CalculatedFieldCtx ctx , EntityId entityId , AttributeScopeProto scope , List < AttributeValueProto > attrDataList ) {
var argNames = ctx . getLinkedAndDynamicArgs ( entityId ) ;
var args = ctx . getLinkedAndDynamicArgs ( entityId ) ;
Map < ReferencedEntityKey , Set < String > > relatedEntityArgs = ctx . getRelatedEntityArguments ( ) ;
if ( args . isEmpty ( ) & & relatedEntityArgs . isEmpty ( ) ) {
return Collections . emptyMap ( ) ;
}
List < String > geofencingArgumentNames = ctx . getLinkedEntityAndCurrentOwnerGeofencingArgumentNames ( ) ;
Map < ReferencedEntityKey , String > relatedEntityArgs = ctx . getRelatedEntityArguments ( ) ;
return mapToArguments ( entityId , argNames , geofencingArgumentNames , relatedEntityArgs , scope , attrDataList ) ;
return mapToArguments ( entityId , args , geofencingArgumentNames , relatedEntityArgs , scope , attrDataList ) ;
}
private Map < String , ArgumentEntry > mapToArguments ( EntityId entityId , Map < ReferencedEntityKey , Set < String > > args , List < String > geofencingArgNames , Map < ReferencedEntityKey , Set < String > > relatedEntityArgs , AttributeScopeProto scope , List < AttributeValueProto > attrDataList ) {
Map < String , ArgumentEntry > arguments = new HashMap < > ( ) ;
if ( ! relatedEntityArgs . isEmpty ( ) | | ! argNames . isEmpty ( ) ) {
for ( AttributeValueProto item : attrDataList ) {
ReferencedEntityKey key = new ReferencedEntityKey ( item . getKey ( ) , ArgumentType . ATTRIBUTE , AttributeScope . valueOf ( scope . name ( ) ) ) ;
Set < String > argNames = relatedEntityArgs . get ( key ) ;
if ( argNames ! = null ) {
argNames . forEach ( argName - > {
arguments . put ( argName , new SingleValueArgumentEntry ( entityId , item ) ) ;
} ) ;
}
argNames = args . get ( key ) ;
if ( argNames = = null ) {
continue ;
}
for ( AttributeValueProto item : attrDataList ) {
ReferencedEntityKey key = new ReferencedEntityKey ( item . getKey ( ) , ArgumentType . ATTRIBUTE , AttributeScope . valueOf ( scope . name ( ) ) ) ;
Set < String > argNames = relatedEntityArgs . get ( key ) ;
if ( argNames ! = null ) {
argNames . forEach ( argName - > {
if ( geofencingArgNames . contains ( argName ) ) {
arguments . put ( argName , new GeofencingArgumentEntry ( entityId , item ) ) ;
} else {
arguments . put ( argName , new SingleValueArgumentEntry ( item ) ) ;
}
arguments . put ( argName , new SingleValueArgumentEntry ( entityId , item ) ) ;
} ) ;
}
argNames = args . get ( key ) ;
if ( argNames = = null ) {
continue ;
}
argNames . forEach ( argName - > {
if ( geofencingArgNames . contains ( argName ) ) {
arguments . put ( argName , new GeofencingArgumentEntry ( entityId , item ) ) ;
} else {
arguments . put ( argName , new SingleValueArgumentEntry ( item ) ) ;
}
} ) ;
}
return arguments ;
}
private Map < String , ArgumentEntry > mapToArgumentsWithDefaultValue ( CalculatedFieldCtx ctx , EntityId entityId , AttributeScopeProto scope , List < String > removedAttrKeys ) {
var argNames = ctx . getLinkedAndDynamicArgs ( entityId ) ;
Map < ReferencedEntityKey , String > relatedEntityArguments = ctx . getRelatedEntityArguments ( ) ;
if ( argNames . isEmpty ( ) & & relatedEntityArguments . isEmpty ( ) ) {
var args = ctx . getLinkedAndDynamicArgs ( entityId ) ;
var relatedEntityArg s = ctx . getRelatedEntityArguments ( ) ;
if ( args . isEmpty ( ) & & relatedEntityArgs . isEmpty ( ) ) {
return Collections . emptyMap ( ) ;
}
List < String > geofencingArgumentNames = ctx . getLinkedEntityAndCurrentOwnerGeofencingArgumentNames ( ) ;
return mapToArgumentsWithDefaultValue ( entityId , argName s , ctx . getArguments ( ) , geofencingArgumentNames , relatedEntityArgument s , scope , removedAttrKeys ) ;
return mapToArgumentsWithDefaultValue ( entityId , args , ctx . getArguments ( ) , geofencingArgumentNames , relatedEntityArgs , scope , removedAttrKeys ) ;
}
private Map < String , ArgumentEntry > mapToArgumentsWithDefaultValue ( CalculatedFieldCtx ctx , AttributeScopeProto scope , List < String > removedAttrKeys ) {
@ -633,7 +634,6 @@ public class CalculatedFieldEntityMessageProcessor extends AbstractContextAwareM
SingleValueArgumentEntry argumentEntry = buildSingleValue ( removedKey , defaultValue , System . currentTimeMillis ( ) ) ;
arguments . put ( argName , new SingleValueArgumentEntry ( msgEntityId , argumentEntry ) ) ;
} ) ;
continue ;
}
argNames = args . get ( key ) ;
if ( argNames = = null ) {