-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complements support for FEEL Parser isDynamicResolution #1208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am getting for the test
FlightRebookingTest.testSolutionAlternate()
18:16:29.695 [main] WARN org.kie.dmn.core.util.MsgUtil.logMessage:68 - Missing expression for Decision Node 'Rebooked Passengers'
which I'll need to investigate with more time, but as mentioned @etirelli I preferred to anticipate this PR for any further comments please?
@@ -198,7 +198,7 @@ | |||
<contextEntry> | |||
<variable name="Best Alternate Flight" typeRef="kie:tFlight"/> | |||
<literalExpression> | |||
<text>Flight List[ From = Original Flight.From and | |||
<text>Flights[ From = Original Flight.From and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was pointing to a InputData instead of the BKM parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing it.
@@ -95,7 +95,7 @@ | |||
<text> status priority( Passenger1.Status ) < status priority( Passenger2.Status ) or | |||
( status priority( Passenger1.Status ) = status priority( Passenger2.Status ) and | |||
Passenger1.Miles > Passenger2.Miles ) | |||
)</text> | |||
</text> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a superfluous additional end parenthesis )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@@ -180,7 +180,7 @@ public void startVariable(Token t) { | |||
} | |||
|
|||
public boolean followUp(Token t, boolean isPredict) { | |||
boolean follow = this.currentScope.followUp( t.getText(), isPredict ); | |||
boolean follow = ( isDynamicResolution() && FEELParser.isVariableNameValid( t.getText() ) ) || this.currentScope.followUp( t.getText(), isPredict ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately you will have to create a new method: FEELParser.isVariablePartNameValid(). For instance, a variable can contain numbers, but cannot start with a number. So I am afraid what you have here will fail for a name like: "My Variable 1", because the method will be called for each token: "Variable" (succeeds), "1" (fails).
Looks good, just see my comment on the variable name check. |
Internal CI error:
Jenkins test again |
unrelated test error
Jenkins test again 🎱 |
Internal CI error:
Jenkins test again 🎱 |
@tarilabs I don't think the last failure is "internal CI error". One of the tests (randomly) failed. |
@psiroky but the build status is SUCCESS, if a failing test was failing it would have mentioned FAILURE ? |
Internal CI error (SSH channel is closed)
Jenkins test again 🎱 |
@tarilabs no, the Maven result will always be SUCCESS in case some of tests fail (see the previous builds for example). The reason for that is that we need to distinguish between three results:
If the Maven build would fail for the test failures, it would be harder to distinguish between 1) and 2) as the build would always be RED. Note: there is of course specific configuration for that ( |
@psiroky I'm a bit confused because normally in scenario n2 I get the list of the failing test in the Jenkins "landing page" of the build. |
@tarilabs correct. Looking at https://kie-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/drools-pullrequests/1030/ (which is the build in question), the failures are there. |
the build mentioned in https://github.com/kiegroup/drools/pull/1208#issuecomment-294150716 |
It may be possible I have not noticed the test failure (1) because with the same test failure of the previous build in the build sequence on CI, only "new failing test" are reported in the summary - if the landing page has this behavior for that section. |
/** | ||
* Either namePart is a string of digits, or it must be a valid name itself | ||
*/ | ||
public static boolean isVariableNamePartValid( String namePart ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
highlighting main change since last review is this^ method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tarilabs unfortunately, it is not only digits that are valid... all the additional characters listed in the spec would also need to be supported (see https://github.com/kiegroup/drools/blob/master/kie-dmn/kie-dmn-feel/src/main/antlr4/org/kie/dmn/feel/parser/feel11/FEEL_1_1.g4#L191 ). But since this is a temporary solution until we have proper type support, lets go with this as is and focus on implementing type support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging, as all tests passed. |
…apache#1208) * Demonstrate isDynamicResolution limitation * Resolve isDynamicResolution limitation for variable name tokens check * Solution 2 to resolve isDynamicResolution limitation for variable name tokens check (cherry picked from commit 913ed2e)
No description provided.