Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
ipTopicInheritanceValidator-anchor
ipTopicInheritanceValidator-anchor
ipTopicInheritanceValidator
Questa validazione verifica che sia inserito almeno una Area Tematica (ipTopic).
Controllo prima se ho un brevetto padre collegato
Se non ne ho, sono un prioritario e controllo se ho degli elementi "miei"
Se ne ho, sono una estensione, controllo prima gli elementi "miei" e poi quelli di mio padre
Per maggiori dettagli cfr. il modello modello dati dell'entità in questione.
Code Block
languagejs
linenumberstrue
collapsetrue
		
				var wfItem = object;
				var parentWfItemLinkSet = wfItem.getParentWfItemLinkSet("priorityExtensionLink");
				
				if(parentWfItemLinkSet == null || parentWfItemLinkSet.isEmpty()){
					// sono in un prioritario
					var ipTopicSet = FragmentUtil.getCurrentFragmentSetByParentAndDiscriminator(wfItem, "it.cilea.wf.model.WfItemElement","ipTopic", wfService);
					
					if(ipTopicSet == null || ipTopicSet.isEmpty())
						errors.rejectAndLocate("error.patent.ipTopic.required", "ipTopic");				
				}else{
					//sono in una estensione
					
					// controllo prima se ne ho io
					var ipTopicSet = FragmentUtil.getCurrentFragmentSetByParentAndDiscriminator(wfItem, "it.cilea.wf.model.WfItemElement","ipTopic", wfService);
					
					// se non ne ho, controllo mio padre
					if(ipTopicSet == null || ipTopicSet.isEmpty()){
						
						var ipTopicSetInherited = wfUtilWfUtil.getWfItemElementSetFromWfItemLinkParent(wfItem, "priorityExtensionLink", "ipTopic", wfService);
					
						if(ipTopicSetInherited == null || ipTopicSetInherited.isEmpty())
							errors.rejectAndLocate("error.patent.ipTopic.inherited.required", "ipTopic");					
					}
				}
				
		

Anchor
trlInheritanceValidator-anchor
trlInheritanceValidator-anchor
trlInheritanceValidator
Questa validazione verifica che sia inserito almeno una voce Technology Readiness Level (trl).
Controllo prima se ho un brevetto padre collegato
Se non ne ho, sono un prioritario e controllo se ho degli elementi "miei"
Se ne ho, sono una estensione, controllo prima gli elementi "miei" e poi quelli di mio padre
Per maggiori dettagli cfr. il modello modello dati dell'entità in questione.
Code Block
languagejs
linenumberstrue
collapsetrue
		
				var wfItem = object;
				var parentWfItemLinkSet = wfItem.getParentWfItemLinkSet("priorityExtensionLink");
				
				if(parentWfItemLinkSet == null || parentWfItemLinkSet.isEmpty()){
					// sono in un prioritario
					var trlSet = FragmentUtil.getCurrentFragmentSetByParentAndDiscriminator(wfItem, "it.cilea.wf.model.WfItemElement","trl", wfService);
					
					if(trlSet == null || trlSet.isEmpty())
						errors.rejectAndLocate("error.patent.trl.required", "trl");				
				}else{
					//sono in una estensione
					
					// controllo prima se ne ho io
					var trlSet = FragmentUtil.getCurrentFragmentSetByParentAndDiscriminator(wfItem, "it.cilea.wf.model.WfItemElement","trl", wfService);
					
					// se non ne ho, controllo mio padre
					if(trlSet == null || trlSet.isEmpty()){
						
						var trlSetInherited = wfUtilWfUtil.getWfItemElementSetFromWfItemLinkParent(wfItem, "priorityExtensionLink", "trl", wfService);
					
						if(trlSetInherited == null || trlSetInherited.isEmpty())
							errors.rejectAndLocate("error.patent.trl.inherited.required", "trl");					
					}
				}
				
		

Anchor
applicationInheritanceValidator-anchor
applicationInheritanceValidator-anchor
applicationInheritanceValidator
Questa validazione verifica che sia inserito almeno una Domanda di Deposito (application).
Controllo prima se ho un brevetto padre collegato
Se non ne ho, sono un prioritario e controllo se ho degli elementi "miei"
Se ne ho, sono una estensione, controllo prima gli elementi "miei" e poi quelli di mio padre
Per maggiori dettagli cfr. il modello modello dati dell'entità in questione.
Code Block
languagejs
linenumberstrue
collapsetrue
		
				var wfItem = object;
				var parentWfItemLinkSet = wfItem.getParentWfItemLinkSet("priorityExtensionLink");
				
				if(parentWfItemLinkSet == null || parentWfItemLinkSet.isEmpty()){
					// sono in un prioritario
					var applicationSet = FragmentUtil.getCurrentFragmentSetByParentAndDiscriminator(wfItem, "it.cilea.wf.model.WfItemElement","application", wfService);
					
					if(applicationSet == null || applicationSet.isEmpty())
						errors.rejectAndLocate("error.patent.application.required", "application");				
				}else{
					//sono in una estensione
					
					// controllo prima se ne ho io
					var applicationSet = FragmentUtil.getCurrentFragmentSetByParentAndDiscriminator(wfItem, "it.cilea.wf.model.WfItemElement","application", wfService);
					
					// se non ne ho, controllo mio padre
					if(applicationSet == null || applicationSet.isEmpty()){
						
						var applicationSetInherited = wfUtilWfUtil.getWfItemElementSetFromWfItemLinkParent(wfItem, "priorityExtensionLink", "application", wfService);
					
						if(applicationSetInherited == null || applicationSetInherited.isEmpty())
							errors.rejectAndLocate("error.patent.application.inherited.required", "application");					
					}
				}
				
		

...

Anchor
checkDatePublicEngagement-anchor
checkDatePublicEngagement-anchor
checkDatePublicEngagement
Questa validazione verifica che il campo "Data di svolgimento dell’iniziativa (al)" sia compilato SOLO se una delle seguenti casistiche viene verificata:

  • booleanMap[periodicEvent] a false o non presente, booleanMap[oneDayOnlyEvent] a false o non presente, booleanMap[knownEndDate] a true
  • booleanMap[periodicEvent] a true, booleanMap[oneDayOnlyEvent] a false o non presente, booleanMap[knownEndDate] a true
  • booleanMap[periodicEvent] a true, booleanMap[oneDayOnlyEvent] a true, booleanMap[knownEndDate] a true

...

la coerenza delle informazioni temporali dell'iniziativa di PE.
Vengono applicate le regole esplicitate dalla seguente tabella.
Nella colonna note viene riportato "NON NECESSARIO" nel caso in cui la validazione NON viene implementata perché già prevista una validazione di obbligatorietà per un campo.
Ad esempio la validazione "C" non è necessaria perché la combinazione valida il caso in cui knownEndDate sia vuoto.
Questa condizione però non si potrà mai verificare perché l'attributo è sempre obbligatorio.
Ragionamento analogo per le altre validazioni non necessarie.

periodicEventoneDayOnlyEventknownEndDateCONDIZIONE DI ERRORENOTE
ASISISIendDate is null or numTotalDay<>1
BSISINOendDate is not null or numTotalDay<>1
CSISIEMPTYendDate is not null or numTotalDay<>1NON NECESSARIA
DSINOSIendDate is null or numTotalDay=1
ESINONOendDate is not null or numTotalDay=1
FSINOEMPTYendDate is not null or numTotalDay=1NON NECESSARIA
GSIEMPTY*knownEndDate is not null or endDate is not nullNON NECESSARIA
HNOSISIendDate is null or numTotalDay<>1 or endDate-startDate+1<>1
INOSINOla configurazione è di suo un errore
LNOSIEMPTYla configurazione è di suo un erroreNON NECESSARIA
MNONOSIendDate is null or numTotalDay=1 or numTotalDay is null or endDate-startDate<>numTotalDay+1
NNONONOendDate is not null or numTotalDay is not null
ONONOEMPTYendDate is not null or numTotalDay is not nullNON NECESSARIA
PNOEMPTY*knownEndDate is not null or endDate is not nullNON NECESSARIA

...

  • la coerenza degli attributi numHoursIfLessThanOneDay (valore ammesso tra 1 e 7 solo con iniziative di un solo giorno)
  • periodicity (necessario se evento periodico)
  • periodicity (se presente numTotalDay) rispetti i seguenti vincoli
    periodicitycheckmessaggio di errore
    publicEngagementPeriodicity.continuednumTotalDay==nullLa periodicità è continuativa e la durata in giorni quindi deve essere vuota
    publicEngagementPeriodicity.weeklynumTotalDay<7La periodicità è settimanale e la durata in giorni quindi deve essere inferiore a 7
    publicEngagementPeriodicity.monthlynumTotalDay<31La periodicità è mensile e la durata in giorni quindi deve essere inferiore a 31
    publicEngagementPeriodicity.annualnumTotalDay<366La periodicità è annuale e la durata in giorni quindi deve essere inferiore a 366
  • numTotalDay (se presente sia <=36600)
Code Block
languagejs
linenumberstrue
collapsetrue

			var periodicEvent=object.getBooleanMap().get("periodicEvent");
			var oneDayOnlyEvent=object.getBooleanMap().get("oneDayOnlyEvent");
			var knownEndDate=object.getBooleanMap().get("knownEndDate");
			
			var periodicity=object.getWfDictionaryMap().get("
Code Block
languagejs
linenumberstrue
collapsetrue

			var periodicEvent=object.getBooleanMap().get("periodicEvent");
			var oneDayOnlyEvent=object.getBooleanMap().get("oneDayOnlyEvent");
			var knownEndDate=object.getBooleanMap().get("knownEndDate");
			
			var periodicity=object.getWfDictionaryMap().get("periodicity");
			var numTotalDay=object.getIntegerMap().get("numTotalDay");
			var numHoursIfLessThanOneDay=object.getIntegerMap().get("numHoursIfLessThanOneDay");
			var endDate=object.getDateMap().get("endDate");
			var startDate=object.getDateMap().get("startDate");
			
			
			//endDate>=startDate
			if(endDate != null && startDate != null){
				if(startDate.getTime().after(endDate.getTime())){
					errors.rejectValue("dateMap[startDate]","error.date.startDateEndDateNotCompatible");
					errors.rejectValue("dateMap[endDate]","error.date.startDateEndDateNotCompatible");
				}
			}	
			
			//A
			if(Boolean.TRUE.equals(periodicEvent) && Boolean.TRUE.equals(oneDayOnlyEvent) && Boolean.TRUE.equals(knownEndDate)){
				if(periodicity==null)
					errors.rejectValue("wfDictionaryMap[periodicity]", "error.notNull.fieldLabelKey", [messageUtil.findMessage("label.publicEngagement.periodicity")], null);
					
				if(!new Integer(1).equals(numTotalDay))
					errors.rejectValue("integerMap[numTotalDay]", "error.publicEngagement.numTotalDayMustBeOne");
				
				if(numHoursIfLessThanOneDay!=null && (numHoursIfLessThanOneDay.compareTo(new Integer(0))<=0 || numHoursIfLessThanOneDay.compareTo(new Integer(8))>=0))
					errors.rejectValue("integerMap[numHoursIfLessThanOneDay]", "error.publicEngagement.numHoursIfLessThanOneDayMustBeBetween1And7");
				
				if (endDate==null)
					errors.rejectValue("dateMap[endDate]", "error.notNull.fieldLabelKey", [messageUtil.findMessage("label.publicEngagement.endDate")], null);
					
					 
				if(numTotalDay!=null && startDate!=null && endDate !=null && (startDate.getTime().before(endDate.getTime()) || startDate.getTime().equals(endDate.getTime()))){
					var durationInDays=WfUtil.getDurationInDays(startDate.getTime(), endDate.getTime());
					if (durationInDays.compareTo(numTotalDay)<0)
						errors.rejectValue("integerMap[numTotalDay]", "error.publicEngagement.periodicEvent.numTotalDayMustBeCoherentWithStartAndEndDate");
				}
			} 
			
			//B
			if(Boolean.TRUE.equals(periodicEvent) && Boolean.TRUE.equals(oneDayOnlyEvent) && Boolean.FALSE.equals(knownEndDate)){
				if(periodicity==null)
					errors.rejectValue("wfDictionaryMap[periodicity]", "error.notNull.fieldLabelKey", [messageUtil.findMessage("label.publicEngagement.periodicity")], null);
					
				if(!new Integer(1).equals(numTotalDay))
					errors.rejectValue("integerMap[numTotalDay]", "error.publicEngagement.numTotalDayMustBeOne");
				
				if(numHoursIfLessThanOneDay!=null && (numHoursIfLessThanOneDay.compareTo(new Integer(0))<=0 || numHoursIfLessThanOneDay.compareTo(new Integer(8))>=0))
					errors.rejectValue("integerMap[numHoursIfLessThanOneDay]", "error.publicEngagement.numHoursIfLessThanOneDayMustBeBetween1And7");
				
				if (endDate!=null)
					errors.rejectValue("dateMap[endDate]", "error.publicEngagement.endDateMustBeEmpty");
			}
			
			//CD
			if(Boolean.TRUE.equals(periodicEvent) && Boolean.FALSE.equals(oneDayOnlyEvent) && Boolean.TRUE.equals(knownEndDate)){
				if(periodicity==null)
					errors.rejectValue("wfDictionaryMap[periodicity]", "error.notNull.fieldLabelKey", [messageUtil.findMessage("label.publicEngagement.periodicity")], null);
					
				if(numTotalDay!=null && numTotalDay.compareTo(new Integer(1))<=0)
					errors.rejectValue("integerMap[numTotalDay]", "error.publicEngagement.numTotalDayMustBeGreaterThanOne");
				
				if(numHoursIfLessThanOneDay!=null)
					errors.rejectValue("integerMap[numHoursIfLessThanOneDay]", "error.publicEngagement.numHoursIfLessThanOneDayMustBeEmpty");
				
				if (endDate==null)
					errors.rejectValue("dateMap[endDate]", "error.notNull.fieldLabelKey", [messageUtil.findMessage("label.publicEngagement.endDate")], null);
					
				if(numTotalDay!=null && startDate!=null && endDate !=null && (startDate.getTime().before(endDate.getTime()) || startDate.getTime().equals(endDate.getTime()))){
					var durationInDays=WfUtil.getDurationInDays(startDate.getTime(), endDate.getTime());
					if (durationInDays.compareTo(numTotalDay)<0)
						errors.rejectValue("integerMap[numTotalDay]", "error.publicEngagement.periodicEvent.numTotalDayMustBeCoherentWithStartAndEndDate");
				}
			}
			
			//DE
			if(Boolean.TRUE.equals(periodicEvent) && Boolean.FALSE.equals(oneDayOnlyEvent) && Boolean.FALSE.equals(knownEndDate)){
				if(periodicity==null)
					errors.rejectValue("wfDictionaryMap[periodicity]", "error.notNull.fieldLabelKey", [messageUtil.findMessage("label.publicEngagement.periodicity")], null);
					
				if(numTotalDay!=null && numTotalDay.compareTo(new Integer(1))<=0)
					errors.rejectValue("integerMap[numTotalDay]", "error.publicEngagement.numTotalDayMustBeGreaterThanOne");
				
				if(numHoursIfLessThanOneDay!=null)
					errors.rejectValue("integerMap[numHoursIfLessThanOneDay]", "error.publicEngagement.numHoursIfLessThanOneDayMustBeEmpty");
				
				if (endDate!=null)
					errors.rejectValue("dateMap[endDate]", "error.publicEngagement.endDateMustBeEmpty");
				
			}
			
			//EH, I
			if(Boolean.FALSE.equals(periodicEvent) && Boolean.TRUE.equals(oneDayOnlyEvent)){
				if(periodicity!=null)
					errors.rejectValue("wfDictionaryMap[periodicity]", "error.publicEngagement.periodicityMustBeEmpty");
					
				if(!new Integer(1).equals(numTotalDay))
					errors.rejectValue("integerMap[numTotalDay]", "error.publicEngagement.numTotalDayMustBeOne");
					
				if (startDate!=null && endDate!=null){
					if (!startDate.equals(endDate)){
						errors.rejectValue("dateMap[startDate]", "error.publicEngagement.startDateMustBeEqualToEndDate");
						errors.rejectValue("dateMap[endDate]", "error.publicEngagement.startDateMustBeEqualToEndDate");
					}
				}
				
				if (!Boolean.TRUE.equals(knownEndDate)){
					errors.rejectValue("booleanMap[knownEndDate]", "error.publicEngagement.knownEndDateMustBeTrue");
				}
				
				if (endDate==null)
					errors.rejectValue("dateMap[endDate]", "error.publicEngagement.endDateMustNotBeEmpty");
				
				if(numHoursIfLessThanOneDay!=null && (numHoursIfLessThanOneDay.compareTo(new Integer(0))<=0 || numHoursIfLessThanOneDay.compareTo(new Integer(8))>=0))
					errors.rejectValue("integerMap[numHoursIfLessThanOneDay]", "error.publicEngagement.numHoursIfLessThanOneDayMustBeBetween1And7");
				
			}
			
			//FM
			if(Boolean.FALSE.equals(periodicEvent) && Boolean.FALSE.equals(oneDayOnlyEvent) && Boolean.TRUE.equals(knownEndDate)){
				if(periodicity!=null)
					errors.rejectValue("wfDictionaryMap[periodicity]", "error.publicEngagement.periodicityMustBeEmpty");
					
				if (endDate==null)
					errors.rejectValue("dateMap[endDate]", "error.notNull.fieldLabelKey", [messageUtil.findMessage("label.publicEngagement.endDate")], null);
				
				if(numTotalDay==null)
					errors.rejectValue("integerMap[numTotalDay]", "error.publicEngagement.numTotalDayMustNotBeEmpty");
					
				if(numTotalDay!=null && startDate!=null && endDate !=null && ){
					if (startDate.getTime().before(endDate.getTime()) || ){
						var durationInDays=WfUtil.getDurationInDays(startDate.getTime(), endDate.getTime());
						if (durationInDays.compareTo(numTotalDay)!=0)
							errors.rejectValue("integerMap[numTotalDay]", "error.publicEngagement.nonPeriodicEvent.numTotalDayMustBeCoherentWithStartAndEndDate");
					}
					if (startDate.getTime().equals(endDate.getTime())){
						errors.rejectValue()))){"dateMap[endDate]", "error.publicEngagement.nonPeriodicEvent.oneDayOnlyEvent_false.startAndEndDateCoherence");
					}
					var durationInDays=WfUtil.getDurationInDays(startDate.getTime(), endDate.getTime());
					if (durationInDaysnumTotalDay.compareTo(numTotalDay)!(new Integer(1))<=0)
						errors.rejectValue("integerMap[numTotalDay]", "error.publicEngagement.nonPeriodicEvent.numTotalDayMustBeCoherentWithStartAndEndDatenumTotalDayMustBeGreaterThanOne");
				}
				
				if(numHoursIfLessThanOneDay!=null)
					errors.rejectValue("integerMap[numHoursIfLessThanOneDay]", "error.publicEngagement.numHoursIfLessThanOneDayMustBeEmpty");
			}
			
			//GN
			if(Boolean.FALSE.equals(periodicEvent) && Boolean.FALSE.equals(oneDayOnlyEvent) && Boolean.FALSE.equals(knownEndDate)){
				if(periodicity!=null)
					errors.rejectValue("wfDictionaryMap[periodicity]", "error.publicEngagement.periodicityMustBeEmpty");
				
				if(numTotalDay!=null){
					errors.rejectValue("integerMap[numTotalDay]", "error.publicEngagement.numTotalDayMustBeEmpty");
				}
				
				if (endDate!=null)
					errors.rejectValue("dateMap[endDate]", "error.publicEngagement.endDateMustBeEmpty");
				
				if(numHoursIfLessThanOneDay!=null)
					errors.rejectValue("integerMap[numHoursIfLessThanOneDay]", "error.publicEngagement.numHoursIfLessThanOneDayMustBeEmpty");
					
				if(numHoursIfLessThanOneDay!=null)
					errors.rejectValue("integerMap[numHoursIfLessThanOneDay]", "error.publicEngagement.numHoursIfLessThanOneDayMustBeEmpty");
			}			
			
		

Anchor
secondaryCategoryDifferFromType-anchor
secondaryCategoryDifferFromType-anchor
secondaryCategoryDifferFromType
Questa validazione va a controllare che tra le Categorie Secondarie inserite non sia presente anche la tipologia del PublicEngagement.
Code Block
languagejs
linenumberstrue
collapsetrue
			
			var secondaryCategoryWfElementSet = FragmentUtil.getCurrentFragmentSetByParentAndDiscriminator(object, "it.cilea.wf.model.WfItemElement","secondaryCategory", wfService);
			
			if(!secondaryCategoryWfElementSet.isEmpty()){
			
				var wfItemTypeIdentifier = object.getWfItemType().getIdentifier();
				
				var secondaryCategorySetIterator = secondaryCategoryWfElementSet.iterator();
				
				while (secondaryCategorySetIterator.hasNext()){
				
					var secondaryCategoryWfItemElement = secondaryCategorySetIterator.next();
					
					var secondaryCategoryWfDictionary = secondaryCategoryWfItemElement.getWfDictionaryMap().get("dictionary");
					
					var sourceId = secondaryCategoryWfDictionary.getStringMap().get("sourceId");
					
					if(Packages.org.apache.commons.lang.StringUtils.equals(sourceId, wfItemTypeIdentifier))
						errors.rejectAndLocate("error.publicEngagement.secondaryCategory.mustDifferFromType", "secondaryCategory");
				}				
			}
			
		

...

Anchor
isPeriodicEvent-anchor
isPeriodicEvent-anchor
isPeriodicEvent
Questa è un'applicability rule che viene valutata prima di eseguire altre validazioni.
Se ritorna true allora vengono eseguite le altre validazioni altrimenti no.
Torna true se l'attributo booleanMap[periodicEvent] è valorizzato con SI (true)
Code Block
languagejs
linenumberstrue
collapsetrue
			(
				object.getBooleanMap().get('periodicEvent')!=null 
				&& 
				Packages.java.lang.Boolean.TRUE.equals(object.getBooleanMap().get('periodicEvent'))
			)
		
AnchorknownEndDateApplyLogic-anchorknownEndDateApplyLogic-anchor knownEndDateApplyLogic
Questa è un'applicability rule che viene valutata prima di eseguire altre validazioni.
Se ritorna true allora vengono eseguite le altre validazioni altrimenti no.
Torna true se l'attributo booleanMap[oneDayOnlyEvent] è valorizzato con NO (false) oppure se l'attributo booleanMap[oneDayOnlyEvent] è valorizzato con SI (true) e l'attributo booleanMap[periodicEvent] è valorizzato con SI (true)
Code Block
languagejs
linenumberstrue
collapsetrue

			(
				object.getBooleanMap().get('oneDayOnlyEvent')!=null 
				&& 
				Packages.java.lang.Boolean.FALSE.equals(object.getBooleanMap().get('oneDayOnlyEvent'))
				||
				
				object.getBooleanMap().get('oneDayOnlyEvent')!=null 
				&& 
				Packages.java.lang.Boolean.TRUE.equals(object.getBooleanMap().get('oneDayOnlyEvent'))
				
				&&
				
				object.getBooleanMap().get('periodicEvent')!=null 
				&& 
				Packages.java.lang.Boolean.TRUE.equals(object.getBooleanMap().get('periodicEvent'))
			)
		

...