gitgabrio commented on code in PR #6577:
URL:
https://github.com/apache/incubator-kie-drools/pull/6577#discussion_r2782094660
##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/ast/UnaryTestNode.java:
##########
@@ -224,77 +224,123 @@ static Boolean areElementsEqual(Object left, Object
right) {
() -> Boolean.FALSE)
);
}
+ private Object evaluateRightValue(EvaluationContext context, Object left) {
+ Object right;
+ // set the value if the expression contains ('?') question mark
+ if (containsQuestionMarkReference(value)) {
+ Object existing = context.getMapping("?");
+ if (Objects.equals(existing, left)) {
+ right = value.evaluate(context);
+ } else {
+ context.enterFrame();
+ try {
+ context.setMapping("?", left);
Review Comment:
HI @ChinchuAjith , related to previous comment, I'm doubtufl about that:
1. this is not a real mapping, i.e. if the key is always "?", we'll always
have at most one entry - my idea was to have a revers mapping, i.e. for each
referred element (e.g. for each inputText) verify if there is a mapping "?" -
the key should be - somehow, the identifier of the element - mind you I'm not
sure it could be done!
2. considering the above, the "setMapping" and "setValue" ends up having
exactly the same behavior, so they are redundant
3. I'm, not sure about all the possible implications of creating a new frame
here - it could be a nice solution, but then, maybe that context.setValue could
be enough (no need for the mapping at all)
Am I clear ? Does this make sense ?
--
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]