You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Russell Bateman <ru...@perfectsearchcorp.com> on 2016/04/16 01:45:52 UTC

@DynamicProperty annotation of more than one property?

What's the syntax for defining more than one dynamic property for a 
processor? I need to specify up to three distinctly different ones and 
attempting to do it all in

@DynamicProperty(
     name = "{blah,blah2,blah3}",
     value = "{\"blah-value\",\"blah2-value\",\"blah3-value\"}",
supportsExpressionLanguage = false,
     description = "Big blah, blah, blah..."
)

is under-powered.

Many thanks.

Re: @DynamicProperty annotation of more than one property?

Posted by Joe Witt <jo...@gmail.com>.
Russ

NiFi 1.0 which is being worked on in 'master' will depend on Java 8.
You could go with the route Dan suggests there.  We'd definitely like
your help to push that forward and are very glad to hear you're
finding the API for writing processors to work out well.

Thanks
Joe

On Tue, Apr 19, 2016 at 12:14 PM, Russell Bateman
<ru...@perfectsearchcorp.com> wrote:
> I'm volunteering to write if the help is wanted, however, I don't have the
> bandwidth to become much more deeply involved though perhaps, as time went
> on, I would.
>
> However, I can help. Meanwhile, I'm digging writing NiFi processors very
> much.
>
> Russ
>
>
> On 04/19/2016 09:24 AM, dan bress wrote:
>>
>> Russell,
>>     I agree the syntax for multiple DynamicProperties is a little awkward,
>> and that our documentation could be improved in this situation(I didn't
>> see
>> reference to @DynamicProperty in the developer doc).
>>
>>     Also Java8 supports the concept of repeatable annotations[1], which
>> would erase the need for the @DynamicProperties by allowing you to specify
>> multiple @DynamicProperty annotations on a single class.  Since NiFi
>> appears to be running on Java8, I think we should create a ticket to
>> update
>> the documentation generation code to handle repeated annotations, and
>> update our processors/controller services/reporting tasks to use them.  We
>> should also create a ticket to update the developer documentation to
>> describe the annotations usage.
>>
>> [1] http://docs.oracle.com/javase/tutorial/java/annotations/repeating.html
>>
>> Dan
>>
>> On Tue, Apr 19, 2016 at 7:23 AM Russell Bateman <
>> russell.bateman@perfectsearchcorp.com> wrote:
>>
>>> Thanks, Joe. This worked.
>>>
>>> You know, I'm just the sort of guy that would add stuff like that to the
>>> documentation if the way were smoothed to it. The problem as I see it
>>> with NiFi doc is that it's really good the way it is and if we add
>>> more--and we should--it's going to get longer and harder to read.
>>> Someone should slightly redesign it with links to subordinate documents
>>> to avoid making it too complicated yet give folk a place to go for
>>> deeper help. I would be happy to help out once such a thing as that is
>>> decided.
>>>
>>> Russ
>>>
>>> On 04/15/2016 06:39 PM, Joe Percivall wrote:
>>>>
>>>> Hello Russell,
>>>>
>>>> The annotation you are looking for is @DynamicProperties[1] an example
>>>
>>> of it in use is in the PutFTP processor[2].
>>>>
>>>> [1]
>>>
>>>
>>> https://github.com/apache/nifi/blob/e4b7e47836edf47042973e604005058c28eed23b/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/DynamicProperties.java
>>>>
>>>> [2]
>>>
>>>
>>> https://github.com/apache/nifi/blob/e4b7e47836edf47042973e604005058c28eed23b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFTP.java#L50
>>>>
>>>>
>>>> Hope that helps,
>>>> Joe
>>>>
>>>> - - - - - -
>>>> Joseph Percivall
>>>> linkedin.com/in/Percivall
>>>> e: joepercivall@yahoo.com
>>>>
>>>>
>>>>
>>>> On Friday, April 15, 2016 7:46 PM, Russell Bateman <
>>>
>>> russell.bateman@perfectsearchcorp.com> wrote:
>>>>
>>>>
>>>>
>>>> What's the syntax for defining more than one dynamic property for a
>>>> processor? I need to specify up to three distinctly different ones and
>>>> attempting to do it all in
>>>>
>>>> @DynamicProperty(
>>>>        name = "{blah,blah2,blah3}",
>>>>        value = "{\"blah-value\",\"blah2-value\",\"blah3-value\"}",
>>>> supportsExpressionLanguage = false,
>>>>        description = "Big blah, blah, blah..."
>>>> )
>>>>
>>>> is under-powered.
>>>>
>>>> Many thanks.
>>>
>>>
>

Re: @DynamicProperty annotation of more than one property?

Posted by Russell Bateman <ru...@perfectsearchcorp.com>.
I'm volunteering to write if the help is wanted, however, I don't have 
the bandwidth to become much more deeply involved though perhaps, as 
time went on, I would.

However, I can help. Meanwhile, I'm digging writing NiFi processors very 
much.

Russ

On 04/19/2016 09:24 AM, dan bress wrote:
> Russell,
>     I agree the syntax for multiple DynamicProperties is a little awkward,
> and that our documentation could be improved in this situation(I didn't see
> reference to @DynamicProperty in the developer doc).
>
>     Also Java8 supports the concept of repeatable annotations[1], which
> would erase the need for the @DynamicProperties by allowing you to specify
> multiple @DynamicProperty annotations on a single class.  Since NiFi
> appears to be running on Java8, I think we should create a ticket to update
> the documentation generation code to handle repeated annotations, and
> update our processors/controller services/reporting tasks to use them.  We
> should also create a ticket to update the developer documentation to
> describe the annotations usage.
>
> [1] http://docs.oracle.com/javase/tutorial/java/annotations/repeating.html
>
> Dan
>
> On Tue, Apr 19, 2016 at 7:23 AM Russell Bateman <
> russell.bateman@perfectsearchcorp.com> wrote:
>
>> Thanks, Joe. This worked.
>>
>> You know, I'm just the sort of guy that would add stuff like that to the
>> documentation if the way were smoothed to it. The problem as I see it
>> with NiFi doc is that it's really good the way it is and if we add
>> more--and we should--it's going to get longer and harder to read.
>> Someone should slightly redesign it with links to subordinate documents
>> to avoid making it too complicated yet give folk a place to go for
>> deeper help. I would be happy to help out once such a thing as that is
>> decided.
>>
>> Russ
>>
>> On 04/15/2016 06:39 PM, Joe Percivall wrote:
>>> Hello Russell,
>>>
>>> The annotation you are looking for is @DynamicProperties[1] an example
>> of it in use is in the PutFTP processor[2].
>>> [1]
>> https://github.com/apache/nifi/blob/e4b7e47836edf47042973e604005058c28eed23b/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/DynamicProperties.java
>>> [2]
>> https://github.com/apache/nifi/blob/e4b7e47836edf47042973e604005058c28eed23b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFTP.java#L50
>>>
>>> Hope that helps,
>>> Joe
>>>
>>> - - - - - -
>>> Joseph Percivall
>>> linkedin.com/in/Percivall
>>> e: joepercivall@yahoo.com
>>>
>>>
>>>
>>> On Friday, April 15, 2016 7:46 PM, Russell Bateman <
>> russell.bateman@perfectsearchcorp.com> wrote:
>>>
>>>
>>> What's the syntax for defining more than one dynamic property for a
>>> processor? I need to specify up to three distinctly different ones and
>>> attempting to do it all in
>>>
>>> @DynamicProperty(
>>>        name = "{blah,blah2,blah3}",
>>>        value = "{\"blah-value\",\"blah2-value\",\"blah3-value\"}",
>>> supportsExpressionLanguage = false,
>>>        description = "Big blah, blah, blah..."
>>> )
>>>
>>> is under-powered.
>>>
>>> Many thanks.
>>


Re: @DynamicProperty annotation of more than one property?

Posted by dan bress <da...@gmail.com>.
Russell,
   I agree the syntax for multiple DynamicProperties is a little awkward,
and that our documentation could be improved in this situation(I didn't see
reference to @DynamicProperty in the developer doc).

   Also Java8 supports the concept of repeatable annotations[1], which
would erase the need for the @DynamicProperties by allowing you to specify
multiple @DynamicProperty annotations on a single class.  Since NiFi
appears to be running on Java8, I think we should create a ticket to update
the documentation generation code to handle repeated annotations, and
update our processors/controller services/reporting tasks to use them.  We
should also create a ticket to update the developer documentation to
describe the annotations usage.

[1] http://docs.oracle.com/javase/tutorial/java/annotations/repeating.html

Dan

On Tue, Apr 19, 2016 at 7:23 AM Russell Bateman <
russell.bateman@perfectsearchcorp.com> wrote:

> Thanks, Joe. This worked.
>
> You know, I'm just the sort of guy that would add stuff like that to the
> documentation if the way were smoothed to it. The problem as I see it
> with NiFi doc is that it's really good the way it is and if we add
> more--and we should--it's going to get longer and harder to read.
> Someone should slightly redesign it with links to subordinate documents
> to avoid making it too complicated yet give folk a place to go for
> deeper help. I would be happy to help out once such a thing as that is
> decided.
>
> Russ
>
> On 04/15/2016 06:39 PM, Joe Percivall wrote:
> > Hello Russell,
> >
> > The annotation you are looking for is @DynamicProperties[1] an example
> of it in use is in the PutFTP processor[2].
> >
> > [1]
> https://github.com/apache/nifi/blob/e4b7e47836edf47042973e604005058c28eed23b/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/DynamicProperties.java
> > [2]
> https://github.com/apache/nifi/blob/e4b7e47836edf47042973e604005058c28eed23b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFTP.java#L50
> >
> >
> > Hope that helps,
> > Joe
> >
> > - - - - - -
> > Joseph Percivall
> > linkedin.com/in/Percivall
> > e: joepercivall@yahoo.com
> >
> >
> >
> > On Friday, April 15, 2016 7:46 PM, Russell Bateman <
> russell.bateman@perfectsearchcorp.com> wrote:
> >
> >
> >
> > What's the syntax for defining more than one dynamic property for a
> > processor? I need to specify up to three distinctly different ones and
> > attempting to do it all in
> >
> > @DynamicProperty(
> >       name = "{blah,blah2,blah3}",
> >       value = "{\"blah-value\",\"blah2-value\",\"blah3-value\"}",
> > supportsExpressionLanguage = false,
> >       description = "Big blah, blah, blah..."
> > )
> >
> > is under-powered.
> >
> > Many thanks.
>
>

Re: @DynamicProperty annotation of more than one property?

Posted by Russell Bateman <ru...@perfectsearchcorp.com>.
Thanks, Joe. This worked.

You know, I'm just the sort of guy that would add stuff like that to the 
documentation if the way were smoothed to it. The problem as I see it 
with NiFi doc is that it's really good the way it is and if we add 
more--and we should--it's going to get longer and harder to read. 
Someone should slightly redesign it with links to subordinate documents 
to avoid making it too complicated yet give folk a place to go for 
deeper help. I would be happy to help out once such a thing as that is 
decided.

Russ

On 04/15/2016 06:39 PM, Joe Percivall wrote:
> Hello Russell,
>
> The annotation you are looking for is @DynamicProperties[1] an example of it in use is in the PutFTP processor[2].
>
> [1] https://github.com/apache/nifi/blob/e4b7e47836edf47042973e604005058c28eed23b/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/DynamicProperties.java
> [2] https://github.com/apache/nifi/blob/e4b7e47836edf47042973e604005058c28eed23b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFTP.java#L50
>
>
> Hope that helps,
> Joe
>
> - - - - - -
> Joseph Percivall
> linkedin.com/in/Percivall
> e: joepercivall@yahoo.com
>
>
>
> On Friday, April 15, 2016 7:46 PM, Russell Bateman <ru...@perfectsearchcorp.com> wrote:
>
>
>
> What's the syntax for defining more than one dynamic property for a
> processor? I need to specify up to three distinctly different ones and
> attempting to do it all in
>
> @DynamicProperty(
>       name = "{blah,blah2,blah3}",
>       value = "{\"blah-value\",\"blah2-value\",\"blah3-value\"}",
> supportsExpressionLanguage = false,
>       description = "Big blah, blah, blah..."
> )
>
> is under-powered.
>
> Many thanks.


Re: @DynamicProperty annotation of more than one property?

Posted by Joe Percivall <jo...@yahoo.com.INVALID>.
Hello Russell,

The annotation you are looking for is @DynamicProperties[1] an example of it in use is in the PutFTP processor[2].

[1] https://github.com/apache/nifi/blob/e4b7e47836edf47042973e604005058c28eed23b/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/DynamicProperties.java
[2] https://github.com/apache/nifi/blob/e4b7e47836edf47042973e604005058c28eed23b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFTP.java#L50


Hope that helps,
Joe

- - - - - - 
Joseph Percivall
linkedin.com/in/Percivall
e: joepercivall@yahoo.com



On Friday, April 15, 2016 7:46 PM, Russell Bateman <ru...@perfectsearchcorp.com> wrote:



What's the syntax for defining more than one dynamic property for a 
processor? I need to specify up to three distinctly different ones and 
attempting to do it all in

@DynamicProperty(
     name = "{blah,blah2,blah3}",
     value = "{\"blah-value\",\"blah2-value\",\"blah3-value\"}",
supportsExpressionLanguage = false,
     description = "Big blah, blah, blah..."
)

is under-powered.

Many thanks.