@Override protected Collection<ValidationResult> customValidate(ValidationContext validationContext) { List<ValidationResult> results = new ArrayList<>(super.customValidate(validationContext)); final PropertyValue columnForPartitioning = validationContext.getProperty(COLUMN_FOR_VALUE_PARTITIONING); // If no EL is present, ensure it's a single column (i.e. no commas in the property value) if (columnForPartitioning.isSet() && !columnForPartitioning.isExpressionLanguagePresent() && columnForPartitioning.getValue().contains(",")) { results.add(new ValidationResult.Builder().valid(false).explanation( COLUMN_FOR_VALUE_PARTITIONING.getDisplayName() + " requires a single column name, but a comma was detected").build()); } return results; }
@Override protected Collection<ValidationResult> customValidate(ValidationContext validationContext) { List<ValidationResult> results = new ArrayList<>(super.customValidate(validationContext)); PropertyValue cacheEntryIdentifier = validationContext.getProperty(PROP_CACHE_ENTRY_IDENTIFIER); boolean elPresent = false; try { elPresent = cacheEntryIdentifier.isExpressionLanguagePresent(); } catch (NullPointerException npe) { // Unfortunate workaround to a mock framework bug (NIFI-4590) } if (elPresent) { // This doesn't do a full job of validating against the requirement that Put Cache Value In Attribute must be set if multiple // Cache Entry Identifiers are supplied (if Expression Language is used). The user could conceivably have a comma-separated list of EL statements, // or a single EL statement with commas inside it but that evaluates to a single item. results.add(new ValidationResult.Builder().valid(true).explanation("Contains Expression Language").build()); } else { if (!validationContext.getProperty(FetchDistributedMapCache.PROP_PUT_CACHE_VALUE_IN_ATTRIBUTE).isSet()) { String identifierString = cacheEntryIdentifier.getValue(); if (identifierString.contains(",")) { results.add(new ValidationResult.Builder().valid(false) .explanation("Multiple Cache Entry Identifiers specified without Put Cache Value In Attribute set").build()); } } } return results; }
final PropertyValue replacementValue = context.getProperty(recordPathText); if (replacementValue.isExpressionLanguagePresent()) { final Map<String, String> fieldVariables = new HashMap<>();
@Override protected Collection<ValidationResult> customValidate(ValidationContext validationContext) { List<ValidationResult> results = new ArrayList<>(super.customValidate(validationContext)); final PropertyValue columnForPartitioning = validationContext.getProperty(COLUMN_FOR_VALUE_PARTITIONING); // If no EL is present, ensure it's a single column (i.e. no commas in the property value) if (columnForPartitioning.isSet() && !columnForPartitioning.isExpressionLanguagePresent() && columnForPartitioning.getValue().contains(",")) { results.add(new ValidationResult.Builder().valid(false).explanation( COLUMN_FOR_VALUE_PARTITIONING.getDisplayName() + " requires a single column name, but a comma was detected").build()); } return results; }
@Override protected Collection<ValidationResult> customValidate(ValidationContext validationContext) { List<ValidationResult> results = new ArrayList<>(super.customValidate(validationContext)); PropertyValue cacheEntryIdentifier = validationContext.getProperty(PROP_CACHE_ENTRY_IDENTIFIER); boolean elPresent = false; try { elPresent = cacheEntryIdentifier.isExpressionLanguagePresent(); } catch (NullPointerException npe) { // Unfortunate workaround to a mock framework bug (NIFI-4590) } if (elPresent) { // This doesn't do a full job of validating against the requirement that Put Cache Value In Attribute must be set if multiple // Cache Entry Identifiers are supplied (if Expression Language is used). The user could conceivably have a comma-separated list of EL statements, // or a single EL statement with commas inside it but that evaluates to a single item. results.add(new ValidationResult.Builder().valid(true).explanation("Contains Expression Language").build()); } else { if (!validationContext.getProperty(FetchDistributedMapCache.PROP_PUT_CACHE_VALUE_IN_ATTRIBUTE).isSet()) { String identifierString = cacheEntryIdentifier.getValue(); if (identifierString.contains(",")) { results.add(new ValidationResult.Builder().valid(false) .explanation("Multiple Cache Entry Identifiers specified without Put Cache Value In Attribute set").build()); } } } return results; }
final PropertyValue replacementValue = context.getProperty(recordPathText); if (replacementValue.isExpressionLanguagePresent()) { final Map<String, String> fieldVariables = new HashMap<>();