blob: ae270d4a95d5efa9a4356bed18852e9212af7776 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>InvokeScriptedProcessor</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">InvokeScriptedProcessor</h1><h2>Description: </h2><p>Experimental - Invokes a script engine for a Processor defined in the given script. The script must define a valid class that implements the Processor interface, and it must set a variable 'processor' to an instance of the class. Processor methods such as onTrigger() will be delegated to the scripted Processor instance. Also any Relationships or PropertyDescriptors defined by the scripted processor will be added to the configuration dialog. The scripted processor can implement public void setLogger(ComponentLog logger) to get access to the parent logger, as well as public void onScheduled(ProcessContext context) and public void onStopped(ProcessContext context) methods to be invoked when the parent InvokeScriptedProcessor is scheduled or stopped, respectively. NOTE: The script will be loaded when the processor is populated with property values, see the Restrictions section for more security implications. Experimental: Impact of sustained usage not yet verified.</p><h3>Tags: </h3><p>script, invoke, groovy, python, jython, jruby, ruby, javascript, js, lua, luaj</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the <a href="../../../../../html/expression-language-guide.html">NiFi Expression Language</a>.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name"><strong>Script Engine</strong></td><td>Script Engine</td><td id="default-value">ECMAScript</td><td id="allowable-values"><ul><li>ECMAScript <img src="../../../../../html/images/iconInfo.png" alt="ECMAScript ECMA - 262 Edition 5.1 [Oracle Nashorn 1.8.0_322-b06]" title="ECMAScript ECMA - 262 Edition 5.1 [Oracle Nashorn 1.8.0_322-b06]"></img></li></ul></td><td id="description">The engine to execute scripts</td></tr><tr><td id="name">Script File</td><td>Script File</td><td></td><td id="allowable-values"></td><td id="description">Path to script file to execute. Only one of Script File or Script Body may be used<br/><br/><strong>This property requires exactly one file to be provided..</strong><br/><br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Script Body</td><td>Script Body</td><td></td><td id="allowable-values"></td><td id="description">Body of script to execute. Only one of Script File or Script Body may be used</td></tr><tr><td id="name">Module Directory</td><td>Module Directory</td><td></td><td id="allowable-values"></td><td id="description">Comma-separated list of paths to files and/or directories which contain modules required by the script.<br/><br/><strong>This property expects a comma-separated list of resources. Each of the resources may be of any of the following types: directory, file.</strong><br/><br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr></table><h3>Dynamic Properties: </h3><p>Supports Sensitive Dynamic Properties: <strong>Yes</strong></p><p>Dynamic Properties allow the user to specify both the name and value of a property.<table id="dynamic-properties"><tr><th>Name</th><th>Value</th><th>Description</th></tr><tr><td id="name">Script Engine Binding property</td><td id="value">Binding property value passed to Script Runner</td><td>Updates a script engine property specified by the Dynamic Property's key with the value specified by the Dynamic Property's value<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr></table></p><h3>Relationships: </h3>This processor has no relationships.<h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3>None specified.<h3>State management: </h3><table id="stateful"><tr><th>Scope</th><th>Description</th></tr><tr><td>LOCAL, CLUSTER</td><td>Scripts can store and retrieve state using the State Management APIs. Consult the State Manager section of the Developer's Guide for more details.</td></tr></table><h3>Restricted: </h3><table id="restrictions"><tr><th>Required Permission</th><th>Explanation</th></tr><tr><td>execute code</td><td>Provides operator the ability to execute arbitrary code assuming all permissions that NiFi has.</td></tr></table><h3>System Resource Considerations:</h3>None specified.<h3>See Also:</h3><p><a href="../org.apache.nifi.processors.script.ExecuteScript/index.html">ExecuteScript</a></p></body></html>