[ 
https://issues.apache.org/jira/browse/NIFI-4367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16337691#comment-16337691
 ] 

ASF GitHub Bot commented on NIFI-4367:
--------------------------------------

Github user mgaido91 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2201#discussion_r163569718
  
    --- Diff: 
nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/InvokeScriptedProcessor.java
 ---
    @@ -461,8 +463,13 @@ public File getKerberosConfigurationFile() {
             // if there was existing validation errors and the processor 
loaded successfully
             if (currentValidationResults.isEmpty() && instance != null) {
                 try {
    -                // defer to the underlying processor for validation
    -                final Collection<ValidationResult> instanceResults = 
instance.validate(context);
    +                // defer to the underlying processor for validation, 
without the
    +                // invokescriptedprocessor properties
    +                final Set<PropertyDescriptor> innerPropertyDescriptor = 
new HashSet<PropertyDescriptor>(scriptingComponentHelper.getDescriptors());
    +
    +                ValidationContext innerValidationContext = new 
FilteredPropertiesValidationContextAdapter(context, innerPropertyDescriptor);
    +                final Collection<ValidationResult> instanceResults = 
instance.validate(innerValidationContext);
    --- End diff --
    
    I think we should do the same in the `onTrigger` method too


> InvokedScriptedProcessor
> ------------------------
>
>                 Key: NIFI-4367
>                 URL: https://issues.apache.org/jira/browse/NIFI-4367
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Linux / Windows
>            Reporter: Patrice Freydiere
>            Priority: Major
>              Labels: InvokeScriptedProcessor, validation
>
> InvokeScriptedProcessor pass his ValidationContext to the inner script, 
> validate call
> InvokeScriptedProcessor Line 465 :                final 
> Collection<ValidationResult> instanceResults = instance.validate(context);
>  
> The problem is that the invokedscript pass the ScriptFile PropertyDescriptor 
> that is validated, if the script derived from the 
> AbstractConfigurableComponent, (because the AbstractConfigurableComponent 
> validate all the context properties).
> The context should be refined to remove the InvokeScriptedProcessor 
> Properties.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to