[
https://issues.jboss.org/browse/DROOLS-4724?page=com.atlassian.jira.plugi...
]
Matteo Mortari commented on DROOLS-4724:
----------------------------------------
Thank you for the analysis [~jomarko].
Hi [~manstis] I believe the proper answer is to follow the expectation of the XSD, to
avoid saving something which would fail at being a valid xml.
Meaning for ContextEntry for the XSD we must provide an Expression, hence the NPE in the
marshaller implementation:
!screenshot-1.png|thumbnail!
While for Decision node that is optional, hence this work:
!screenshot-2.png|thumbnail!
Being expression optional also applies to functionDefinition's body and
businessKnowledgeModel nodes' expression.
That said, I believe we can reasonably act on the ContextEntry behaving different on the
basis of the DMN specification itself.
Additionally, I believe is confusing to drop-in just an empty LiteralExpression with no
content whatsoever, as that appears to be one of the source of confusion for new-users, as
reported for instance by [~mfusco] during the last sanity checks.
Hence I would conclude by proposing the following:
* the current behaviour appears to be working fine AND valid for most of the elements,
proving it's okay
* for contextEntry, if missing an expression during the save, we should drop-in a
LiteralExpression with {{null}} as its content, so to make it more explicit that was
caused by the user saving without having filled that field. We can even have it as:
{code:java}
null // auto-filled on save by the editor to avoid missing empty expression for entry
{code}
this is my perspective, let me know if the second bulletpoint in your view can be
implemented WB side or your view is for it to be filled by the -backend marshaller.
/cc [~tirelli]
[DMN Designer] Do not default to a LiteralExpression when no
expression is defined
----------------------------------------------------------------------------------
Key: DROOLS-4724
URL:
https://issues.jboss.org/browse/DROOLS-4724
Project: Drools
Issue Type: Enhancement
Components: DMN Editor
Reporter: Matteo Mortari
Assignee: Michael Anstis
Priority: Major
Labels: drools-tools
Attachments: error.log, image-2019-11-04-19-39-01-113.png,
image-2019-11-04-19-40-27-201.png, save-context.webm, screenshot-1.png, screenshot-2.png
Currently, the DMN Editor will default to a blank LiteralExpression on Save if the user
did not provide an expression for an element.
However Error message is reported anyway to the user:
!image-2019-11-04-19-39-01-113.png|thumbnail!
This also as the (imho undesired) side-effect that if the user was to re-open later that
file, instead of a empty element, it would be a blank LiteralExpression
!image-2019-11-04-19-40-27-201.png|thumbnail!
so the current behavior is not consistent across re-open of the editor.
Let's revert this default.
The DMN Editor on save should +not+ default to a blank LiteralExpression if the user did
not provide an expression for the element.
Once this change is applied from the f/e side, I am happy to be involved in order to
assess which of the messages reported by the Validator or the Compiler are causing issue
to the WB (if any).
Currently, the DMN Compiler will throw 1 Warning.
Currently, the DMN Validator will throw 1 Error (I can align this to be a Warn too).
Currently, the DMN Validator schema check is not reporting any XSD violation.
h2. Manual acceptance test
Try to save default / empty
h3. Business Central
- Decision node (/)
- BKM node (/)
- Cleared Function (/)
- Context entry (x) [^error.log] [^save-context.webm]
- Invocation (/)
h3. Kogito
- Decision node (/)
- BKM node (/)
- Cleared Function (/)
- Context entry (/)
- Invocation (/)
--
This message was sent by Atlassian Jira
(v7.13.8#713008)