[jboss-jira] [JBoss JIRA] (DROOLS-2317) FEEL Syntax error on function(bkm) containing `for` keyword
Matteo Mortari (Jira)
issues at jboss.org
Wed Feb 12 18:29:00 EST 2020
[ https://issues.redhat.com/browse/DROOLS-2317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13970551#comment-13970551 ]
Matteo Mortari edited comment on DROOLS-2317 at 2/12/20 6:28 PM:
-----------------------------------------------------------------
[~lukasz.hanik]
The symptoms are the same, but I can confirm is actually a different issue.
The problem in your uploaded DMN model, is that for the Decision {{Encapsulated input}} the type {{Any}} is specified, hence when later invoking the FEEL qualified expression
{code}
Encapsulated input. (...)
{code} no assumption can be made if {{Input for user}} is a property of the parent or not, given it's indeed specified as of type {{Any}}.
Now, because it contains a (potentially) reserved keyword, the keyword "for", the parser cannot go beyond the DMN spec hence throws the error.
I can confirm once you properly annotate type, the error disappears, as expected.
I notice you are using the Trisotech editor, creating the types based on the current design of the model can be achieved with the "Create Output Data type" menu entry, if I do so indeed as confirmed the error is disappeared as I would expect.
Further, I am led to believe the model will just work as expected, example:
!screenshot-1.png!
and for the records these are the types I believe correct based on the fact the InputData is of type FEEL string:
!screenshot-3.png!
which are assigned to the "Encapsulated input" decision which was the one lacking proper type annotation:
!screenshot-2.png!
Please notice this is only required because dynamic inference cannot go against the spec (in this case keyword "for" is used as part of a name in a property, but the specified type was "Any"), but indeed once properly annotating the type, it will work just fine.
Can you confirm this will solve your issue?
Also for the next time, please try to avoid commenting on an months old jira, it would be best to just open a new one and cross-link if desired; I appreciate you did the research, I'm just trying to avoid comments which might go lost if put on a Resolved months old issue ;)
Please let us know
was (Author: tari_manga):
[~lukasz.hanik]
The symptoms are the same, but I can confirm is actually a different issue.
The problem in your uploaded DMN model, is that for the Decision {{Encapsulated input}} the type {{Any}} is specified, hence when later invoking the FEEL qualified expression
{code}
Encapsulated input. (...)
{code} no assumption can be made if {{Input for user}} is a property of the parent or not, given it's indeed specified as of type {{Any}}.
Now, because it contains a (potentially) reserved keyword, the keyword "for", the parser cannot go beyond the DMN spec hence throws the error.
I can confirm once you properly annotate type, the error disappears, as expected.
I notice you are using the Trisotech editor, creating the types based on the current design of the model can be achieved with the "Create Output Data type" menu entry, if I do so indeed as confirmed the error is disappeared as I would expect.
Further, I am led to believe the model will just work as expected, example:
!screenshot-1.png!
and for the records these are the types I believe correct based on the fact the InputData is of type FEEL string:
!screenshot-3.png!
which are assigned to the "Encapsulated input" decision which was the one lacking proper type annotation:
!screenshot-2.png!
Please notice this is only required because dynamic inference cannot go against the spec, but indeed once properly annotating the type, it will work just fine.
Can you confirm this will solve your issue?
Also for the next time, please try to avoid commenting on an months old jira, it would be best to just open a new one and cross-link if desired; I appreciate you did the research, I'm just trying to avoid comments which might go lost if put on a Resolved months old issue ;)
Please let us know
> FEEL Syntax error on function(bkm) containing `for` keyword
> -----------------------------------------------------------
>
> Key: DROOLS-2317
> URL: https://issues.redhat.com/browse/DROOLS-2317
> Project: Drools
> Issue Type: Bug
> Components: dmn engine
> Reporter: Matteo Mortari
> Assignee: Fedor Gavrilov
> Priority: Major
> Attachments: DROOLS-2317.dmn, Dynamic composition.dmn, screenshot-1.png, screenshot-2.png, screenshot-3.png
>
>
> Attached model
> {code:java}
> Error compiling FEEL expression 'for item in Order.items return Federal Tax for Item( item )' for name 'Calculate Federal Taxes' on node 'Calculate Federal Taxes': syntax error near 'for'
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list