[ 
https://issues.apache.org/jira/browse/OFBIZ-3473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832905#action_12832905
 ] 

Dimitri Unruh commented on OFBIZ-3473:
--------------------------------------

David,

sorry, I don't agree with you. Maybe my description was not so clear, so I try 
it again:

Have a look at the following example:

 <simple-map-processor name="newPerson">
     <process field="USER_FIRST_NAME">
      ....
      </process>
      <process field="...">
       ....
      </process>           
      <process field="birthDate ">          
          <not-empty><fail-property .... /></not-empty>
          <validate-method method="isDate"><fail-property 
.../></validate-method>
          <validate-method method="isDateBeforeToday"><fail-property 
.../></validate-method>
      </process>
      <process field="...">
       ....
      </process> 
 </simple-map-processor>

1. case: we got an empty value for birthDate 
Message: "birthDate is a required field"

2. case: birthDate is 12/12/2020
Message: "birthDate is invalid because you are not M.J.Fox :)"

3. case: birthDate is "abc"
Messages: "birthDate has a from format" and "birthDate is invalid because you 
are not M.J.Fox :)"

And that's the pont: the second message is (in my optinion) a failure here. You 
talking about frustrating a user, I guess this one would let him stop the 
process (just look at some useability studies for ecommerce).
We have to tell a user everytime what is going on and give him an exact message 
as a feedback to his input.

I hope this makes my intention more clear, so I will reopen this issue.

Dimitri

> SimpleMapProcessor don't stop after the first error
> ---------------------------------------------------
>
>                 Key: OFBIZ-3473
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3473
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Dimitri Unruh
>            Assignee: David E. Jones
>             Fix For: SVN trunk
>
>         Attachments: SimpleMapProcess.patch
>
>
> Hi @all,
> the SimpleMapProcessor don't stop the validation for a given field after the 
> first error.
> For example:
> I need to validate  a birthdate from an input field. So I process two 
> validation for the field:
> 1. isDate
> 2. isDateBeforeToday
> If the string is not a proper date, the process should stop here, because the 
> secand validation would throw an exception.
> I modified this. Hopefully you like it :)
> Dimitri

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to