blob: 3eab62a250b77a2a3cbeba7a20b78eaea575bdff [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>ExecuteScript</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;">ExecuteScript</h1><h2>Description: </h2><p>Experimental - Executes a script given the flow file and a process session. The script is responsible for handling the incoming flow file (transfer to SUCCESS or remove, e.g.) as well as any flow files created by the script. If the handling is incomplete or incorrect, the session will be rolled back. Experimental: Impact of sustained usage not yet verified.</p><p><a href="additionalDetails.html">Additional Details...</a></p><h3>Tags: </h3><p>script, execute, groovy, python, jython, jruby, ruby, javascript, js, lua, luaj, clojure</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 11.0.16]" title="ECMAScript ECMA - 262 Edition 5.1 [Oracle Nashorn 11.0.16]"></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><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>success</td><td>FlowFiles that were successfully processed</td></tr><tr><td>failure</td><td>FlowFiles that failed to be processed</td></tr></table><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>Input requirement: </h3>This component allows an incoming relationship.<h3>System Resource Considerations:</h3>None specified.<h3>See Also:</h3><p><a href="../org.apache.nifi.processors.script.InvokeScriptedProcessor/index.html">InvokeScriptedProcessor</a></p></body></html>