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

Joseph Witt commented on NIFI-210:
----------------------------------

[~mattyb149] OK we are SOOO close now.  On InvokeScripted (and possibly 
ExecuteScript) i strongly recommend moving away from using on property modified 
for validation and reloading of the script.  Because it is a compound property 
situation (both modulePath and the script itself) it is important to do that 
during the customValidate part of the lifecycle which occurs once all 
properties are set.  You CAN use onPropertyModified to clear out the processor 
instance (probably better than onStopped given the multi-threadedness).

In customValidate you know all the user intended settings have been applied and 
you can now provide feedback on any errors with the script or module path or 
whatnot.  Then you can remove the current error handling on reloadScript that 
is only logging the error when the modulePath is not null which was to avoid 
the timing issue of property establishment.

How I found this issue was in changing a valid and previously running script to 
do some content manipulation.  Apparently my script change was invalid but the 
property was set.  However, since the error was silently ignored it just kept 
using the older processor instance it had compiled and happily kept running the 
old code.  Now after the latest PR it will simply run without the processor 
instance compiling properly.

So in short I think we're a fairly minor refactor away.  Let me and can review 
again asap.

Thanks
Joe

> Provide an ExecuteScript processor
> ----------------------------------
>
>                 Key: NIFI-210
>                 URL: https://issues.apache.org/jira/browse/NIFI-210
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework
>    Affects Versions: 0.0.1
>            Reporter: A. Steven Anderson
>            Assignee: Matt Burgess
>              Labels: processor, scala
>             Fix For: 0.5.0
>
>         Attachments: 
> 0001-NIFI-210-few-tweaks-to-drop-static-reference-and-fix.patch, 
> Fun_with_Scripting_Languages.xml, flow.xml.gz
>
>
> Add latest Scala version support for ExcecuteScript processor.
> Should also support Clojure as per discussion and request on mailing list 
> http://mail-archives.apache.org/mod_mbox/nifi-dev/201506.mbox/%3CCAMpSqch4GK1gnw6M1u8tH6AN8e_miXZN5SNkAeMjBujXYGqJiw%40mail.gmail.com%3E
> UPDATE: The ScriptEngine for Clojure is not being maintained and is not 
> currently available via Maven Central or a public repository. Recommend 
> adding Clojure as a separate Improvement Jira case.



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

Reply via email to