-
Notifications
You must be signed in to change notification settings - Fork 219
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
KOGITO-2651 : Allow expressions in output assignments #3363
Conversation
Jenkins execute full downstream build |
Jenkins execute compile downstream build |
Jenkins execute compile downstream build |
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.
Hi @inodeman,
looks good to me, just couple of minor nitpick. Thank you!
|
||
assertNull(view.getModel().getExpression()); | ||
view.setExpression("{hello}"); | ||
assertEquals(view.getModel().getExpression(), "{hello}"); |
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.
New test doesn't test constant, but expression. So {hello}
should be reverted back to hello
.
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 don't see the issue yet @hasys here, what you mean? I understand the view has some model which contains an expression field (String). The expression has to be set using some syntax (eg: {expr}
), also the view shows the raw expression (with complet syntax) on the UI field, which makes sense to me also because this way the view is "agnostic" to the expression syntax (that's maybe a presentation stuff). So for me looks fine to return the {hello}
back from the view.getModel().getExpression()
...
As an example, think on the view just being an HTML input element - you would write the complete text with syntax as the value, also you'll expect the same value when you obtain it's value.
WDYT?
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.
@inodeman what's wrong here is the order of the arguments for the assertEquals
, the first one is the expected
value, and second one is the actual
. So please try to fix those, if any others. Thanks!
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.
Hi @romartin, yes it's a bit frustrating. Main idea was to allow put constants to the output value. But test was changed from test Constants to test Expression. So it was possible to set expression before as well, but wasn't possible to set Constants but after the change constants aren't tested any more.
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 problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getModel().setExpression(expression); | ||
} | ||
} | ||
|
||
private static boolean isConstant(String expression) { |
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.
Method can be removed now since it had only one invocation.
notification.fire(new NotificationEvent(StunnerFormsClientFieldsConstants.INSTANCE.Only_expressions_allowed_for_output(), | ||
NotificationEvent.NotificationType.ERROR)); | ||
processVarComboBox.textBoxValueChanged(""); | ||
} else { | ||
getModel().setExpression(expression); |
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.
Some spaces can be removed here since it is now on method level.
Jenkins execute full downstream build |
Hey @inodeman, this needs rebase plz |
Jenkins execute full downstream build |
Hi @romartin rebased, tested and builds re-fired |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information The version of Java (1.8.0_202) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11. |
Hi @romartin @handreyrc can you review this PR? Change is simple, there was a check before to show a warning if the variable is output and expression. I removed the custom message and constants and updated test code. Let me know