You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Jake Kugel <ja...@yahoo.com.INVALID> on 2016/08/30 13:24:56 UTC
Posting a bulletin from a script in ExecuteScript
Hello,
I've created a Python script to process flowfiles within an
ExecuteScript processor following the good example from here:
http://funnifi.blogspot.com/2016/03/executescript-json-to-json-revisited.html
I'm curious if it is possible for my script to post a bulletin to the
ExecuteScript processor in the event of an error. Is it possible for a
script within ExecuteScript to post a bulletin, or are bulletin only
intended for the nifi framework itself to display errors?
Thank you,
Jake
Re: Posting a bulletin from a script in ExecuteScript
Posted by Mark Payne <ma...@hotmail.com>.
Jake,
Anything that is logged to a processor's logger will create a bulletin. So from your script, you should be able
to do something like:
log.warn("Something interesting happened")
And that would generate a WARNING level bulletin. The 'Settings' tab of the processor allows you to configure
the minimum bulletin level that will actually show on the UI.
Does this make sense?
Thanks
-Mark
> On Aug 30, 2016, at 9:24 AM, Jake Kugel <ja...@yahoo.com.INVALID> wrote:
>
> Hello,
>
> I've created a Python script to process flowfiles within an ExecuteScript processor following the good example from here:
>
> http://funnifi.blogspot.com/2016/03/executescript-json-to-json-revisited.html
>
> I'm curious if it is possible for my script to post a bulletin to the ExecuteScript processor in the event of an error. Is it possible for a script within ExecuteScript to post a bulletin, or are bulletin only intended for the nifi framework itself to display errors?
>
> Thank you,
> Jake
>
Re: Posting a bulletin from a script in ExecuteScript
Posted by Jake Kugel <ja...@yahoo.com.INVALID>.
Thanks for both replies, tried it and it was exactly what I was looking
for. Thanks,
Jake
On 8/30/16 8:30 AM, Matt Burgess wrote:
> Jake,
>
> log.error("My error message") should cause a bulletin to be posted. If
> you have an exception you can pass that in as a second parameter, the
> stack trace will be logged (not in the bulletin but in the
> logs/nifi-app.log file).
>
>
> Regards,
> Matt
>
> On Tue, Aug 30, 2016 at 9:24 AM, Jake Kugel
> <ja...@yahoo.com.invalid> wrote:
>> Hello,
>>
>> I've created a Python script to process flowfiles within an ExecuteScript
>> processor following the good example from here:
>>
>> http://funnifi.blogspot.com/2016/03/executescript-json-to-json-revisited.html
>>
>> I'm curious if it is possible for my script to post a bulletin to the
>> ExecuteScript processor in the event of an error. Is it possible for a
>> script within ExecuteScript to post a bulletin, or are bulletin only
>> intended for the nifi framework itself to display errors?
>>
>> Thank you,
>> Jake
>>
Re: Posting a bulletin from a script in ExecuteScript
Posted by Matt Burgess <ma...@gmail.com>.
Jake,
log.error("My error message") should cause a bulletin to be posted. If
you have an exception you can pass that in as a second parameter, the
stack trace will be logged (not in the bulletin but in the
logs/nifi-app.log file).
Regards,
Matt
On Tue, Aug 30, 2016 at 9:24 AM, Jake Kugel
<ja...@yahoo.com.invalid> wrote:
> Hello,
>
> I've created a Python script to process flowfiles within an ExecuteScript
> processor following the good example from here:
>
> http://funnifi.blogspot.com/2016/03/executescript-json-to-json-revisited.html
>
> I'm curious if it is possible for my script to post a bulletin to the
> ExecuteScript processor in the event of an error. Is it possible for a
> script within ExecuteScript to post a bulletin, or are bulletin only
> intended for the nifi framework itself to display errors?
>
> Thank you,
> Jake
>