Aggiunto controllo su email valida nelle persone di riferimento.
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -747,10 +747,9 @@ public class UtilityString {
|
||||
}
|
||||
|
||||
public static boolean isEmail(String email) {
|
||||
String regex = "^(.+)@(.+)$";
|
||||
String regex = "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$";
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
Matcher matcher = pattern.matcher(email);
|
||||
return matcher.matches();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -444,4 +444,15 @@ when
|
||||
$vtbDist : VtbDist(numCmov !=null && operation == OperationType.DELETE )
|
||||
then
|
||||
throw new CheckConstraintException("Non è possibile cancellare una distinta già registrata.");
|
||||
end
|
||||
end
|
||||
|
||||
rule "checkEmailAnag"
|
||||
no-loop
|
||||
when
|
||||
eval(checkRulesEnabled)
|
||||
$vtbCliePersRif : VtbCliePersRif (eMail !=null && operation != OperationType.DELETE )
|
||||
eval(!UtilityString.isEmail($vtbCliePersRif.geteMail()))
|
||||
then
|
||||
throw new CheckConstraintException(String.format("Attenzione! Email non valida per la persona di riferimento %s.",
|
||||
$vtbCliePersRif.getPersonaRif()));
|
||||
end
|
||||
|
||||
@@ -675,6 +675,9 @@ public class SystemController {
|
||||
activity.setActivityTypeId("TICKET");
|
||||
}
|
||||
|
||||
if (activity.getParentActivityId() == null)
|
||||
throw new Exception( "Attenzione, 'parentActivityId' obbligatorio");
|
||||
|
||||
activity.setActivityDescription(HtmlUtils.htmlUnescape(activity.getActivityDescription()));
|
||||
|
||||
String notificationType;
|
||||
|
||||
Reference in New Issue
Block a user