gitgabrio opened a new issue, #956:
URL: https://github.com/apache/incubator-kie-issues/issues/956

   During DMN evaluation, input values are validated against expected 
types/values.
   
   This is done mostrly inside `BaseDMNTypeImpl.isInstanceOf(Object)` and 
`BaseDMNTypeImpl.isAssignableValue(Object)`
   Those methods also take care of item inside collection, and are inherently 
recursive.
   Moreover, they delegate actual check to methods implemented in 
specialization classes (`SimpleTypeImpl `and `CompositeTypeImpl` )
   In theory, there is a clear semantic:
   `isInstanceOf` should verify only the type of the given object
   `isAssignableValue` should verify the value of the object itself, based on 
UnaryTest (`allowedValues` and `typeConstraint`)
   Current implementation has some flaws:
   1. there is not a clear separation of the two checks,
   2. at a given point, during the `isAssignableValue` check, the 
`isInstanceOf` is invoked (for `CompositeTypeImpl`)
   3. the `allowedValues` check is based on the `BaseType`, and the 
`typeConstraint` one is based on the `FeelType`
   4. during compilation, nested `ItemDef` (inside `CompositeType`) are mapped 
as `MapBackedType`, and if a collection is provided, it becomes a 
`GenListType<MapBackedType`
   5. during normal check, the `internalAllowedValueIsAssignableValue` is 
invoked; this should _**transparently**_ rely on BaseType/FeelType check; but 
for `CompositeTypeImpl`, this can't work, because the basetype/referred type is 
a `MapBackedType` and the recieved object is a java class; ant that requires 
the introduction of a workaround that, in such specific case, does not delegate 
evaluation but "manually" implement check
   6. possible solution for that could be:
   6.1. during compilation, map the given feel to some kind of "ObjectType", 
where needed, instead of always hardcoding as `MapBackedType`
   6.2 modify the `MapBakedType` to also allow/check for not-map objects, 
instead of implement that inside the `CompositeTypeImpl`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to