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

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

GitHub user pvillard31 opened a pull request:

    https://github.com/apache/nifi/pull/401

    NIFI-1832 Allowing expression language in properties with a set of 
allowable values

    At the moment, if a property is defined with a set of allowable values AND 
is supporting expression language, then validation will always fail when the 
expression language value is not matching an allowable value. There are two 
options:
    
    - In the processor, add in the allowable values the expression language 
value that is authorized and let the user knows that the expected value MUST BE 
in this specific attribute.
    
    Example: .allowableValues("A", "B", "C", "${myProcessor.type}")
    Then the incoming flow files must have this attribute (using 
UpdateAttribute before).
    
    - Authorize any input value when expression language is supported for this 
kind of properties.
    
    This PR is a proposition for the second option.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/pvillard31/nifi NIFI-1832

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/401.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #401
    
----
commit de320a6e9e1370964783016538fe07aa1ae6cb17
Author: Pierre Villard <[email protected]>
Date:   2016-05-02T09:57:28Z

    NIFI-1832 Allowing expression language in properties with a set of 
allowable values

----


> Testing EL properties with AllowableValues
> ------------------------------------------
>
>                 Key: NIFI-1832
>                 URL: https://issues.apache.org/jira/browse/NIFI-1832
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Tools and Build
>    Affects Versions: 0.6.1
>         Environment: Testing
>            Reporter: Simon Elliston Ball
>            Priority: Minor
>
> I’ve come across an interesting problem with MockFlowFile while testing a 
> custom processor. My property has an AllowableValue list, and supports 
> expression language. The test uses:
> runner.setProperty(PROPERTY_REF, "${attribute.name}”);
> However, the test fails on validation of in the MockFlowFile with the 
> unevaluated version of the EL invalid against the allowed values list. 
> 'Property' validated against '${attribute.name}' is invalid because Given 
> value is not found in allowed set ...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to