[jboss-jira] [JBoss JIRA] (DROOLS-5062) [DMN Designer] Systematically correct node prefix/trailing space on import

Matteo Mortari (Jira) issues at jboss.org
Fri Feb 14 08:13:03 EST 2020


    [ https://issues.redhat.com/browse/DROOLS-5062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13972166#comment-13972166 ] 

Matteo Mortari edited comment on DROOLS-5062 at 2/14/20 8:12 AM:
-----------------------------------------------------------------

We are lenient going AGAINST the principles of the spec, but we do it on the engine to avoid blowing up for a simple mistake like a trailing (superflous) space.
Frankly, this was a "smart" decision which we started to kind of regret on the engine side, as it's difficult to maintain and difficult to mitigate the impact on performance.

The spec in DMNv1.x is space-insensitive, and that's a fact.

So I would learn from our own mistake here, and doesn't make sense to name a node

{code:java}
"my decision "
{code}

or 

{code:java}
"my decision   "
{code}

and I would have any name corrected by the editor as

{code:java}
"my decision"
{code}

That said, clearly this must allow the user to input after introducing a space, so I'm NOT obviously saying that after entering

{code:java}
"my decision  "
{code}

it would become

{code:java}
"mydecision"
{code}

I hope this is not misunderstood :)

Finally bonus point for normalizing spaces such as:

{code:java}
" my        decision       "
{code}

becoming again
{code:java}
"my decision"
{code}

How about instead of relying on our own perspective, we ask for a UX "experiment" --which however should take into account the context, in this specific case what is the principles of the DMN spec? ;)

ps: in this comment, the double quote is only used to denote the beginning and end of the name


was (Author: tari_manga):
We are lenient going AGAINST the principles of the spec, but we do it on the engine to avoid blowing up for a simple mistake like a trailing (superflous) space.
Frankly, this was a "smart" decision which we started to kind of regret on the engine side, as it's difficult to maintain and difficult to mitigate the impact on performance.

The spec in DMNv1.x is space-insensitive, and that's a fact.

So I would learn from our own mistake here, and doesn't make sense to name a node

{code:java}
"my decision "
{code}

or 

{code:java}
"my decision   "
{code}

and I would have any name corrected by the editor as

{code:java}
"my decision"
{code}

That said, clearly this must allow the user to input after introducing a space, so I'm NOT obviously saying that after entering

{code:java}
"my decision  "
{code}

it would become

{code:java}
"mydecision"
{code}

I hope this is not misunderstood :)

Finally bonus point for normalizing spaces such as:

{code:java}
" my        decision       "
{code}

becoming again
{code:java}
"my decision"
{code}

How about instead of relying on our own perspective, we ask for a UX "experiment" --which however should take into account the context, in this specific case what is the principles of the DMN spec? ;)

> [DMN Designer] Systematically correct node prefix/trailing space on import
> --------------------------------------------------------------------------
>
>                 Key: DROOLS-5062
>                 URL: https://issues.redhat.com/browse/DROOLS-5062
>             Project: Drools
>          Issue Type: Bug
>          Components: DMN Editor
>            Reporter: Matteo Mortari
>            Assignee: Michael Anstis
>            Priority: Major
>         Attachments: ItemDefinition-white-space.png
>
>
> I understand [DROOLS-5017] has been re-purposed to allow Info and Warn level messages be displayed on Stunner Validation dialog. That is fine.
> But, imho, an UX point is not being considered, where is necessary instead.
> By the DMN spec, a node should not have a prefix/trailing space, as space insensitivity would mandate 1 trailing or 2 trailing spaces are simply ignored etc.
> The engine is lenient to avoid this crashing the evaluation, but still is a bad designed model to persist the node name (DRGElement name and its corresponding variable name) with those extra spaces IMHO.
> Further, I consider is just the Analyst which slipped a space.
> In my perspective, the editor should just strip away the prefix/trailing space:
> * While Importing a DMN model from file Upload
> * -While editing a DRGElement and hitting OK to save its name- (See [DROOLS-5060|https://issues.redhat.com/browse/DROOLS-5060])
> For your consideration, thanks.
> See [comment|https://issues.redhat.com/browse/DROOLS-5060?focusedCommentId=13970775&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13970775] on DROOLS-5060:-
> {quote}
> I'd like to move the other request ("While Importing a DMN model from file Upload") to a new JIRA for the following reason:
> * It is an automated correction/cleanse
> * We already have one automated correction (when layout information is missing or insufficient)
> * We may, in the future, want to support other automated corrections
> * I'd therefore like to consolidate the approach to how automated corrections are detected, ran and reported to the User. My initial opinion is that when opening (or importing or some other trigger to be determined) a DMN file we collect (probably via CDI discovery) all implementations of "Automated Fixers" (one of which if layout another is trim leading/trailing space etc). We then show the list of possible fixes to the User, they can select whatever they like and then we run them and save the file. Anyway, IMO, it's out of scope of this JIRA as it'd need some UX involvement.
> {quote}



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list