@Tags(value={"script","execute","groovy","python","jython","jruby","ruby","javascript","js","lua","luaj"}) @CapabilityDescription(value="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.") @DynamicProperty(name="A script engine property to update", value="The value to set it to", supportsExpressionLanguage=true, description="Updates a script engine property specified by the Dynamic Property\'s key with the value specified by the Dynamic Property\'s value") public class ExecuteScript extends AbstractScriptProcessor
| Modifier and Type | Field and Description |
|---|---|
private String |
scriptToRun |
descriptors, engineQ, isInitialized, modules, MODULES, REL_FAILURE, REL_SUCCESS, SCRIPT_BODY, SCRIPT_ENGINE, SCRIPT_FILE, scriptBody, scriptEngineConfiguratorMap, scriptEngineFactoryMap, scriptEngineName, scriptPath| Constructor and Description |
|---|
ExecuteScript() |
| Modifier and Type | Method and Description |
|---|---|
Set<Relationship> |
getRelationships()
Returns the valid relationships for this processor.
|
protected PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
Returns a PropertyDescriptor for the given name.
|
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors()
Returns a list of property descriptors supported by this processor.
|
void |
onTrigger(ProcessContext context,
ProcessSessionFactory sessionFactory)
Evaluates the given script body (or file) using the current session, context, and flowfile.
|
void |
setup(ProcessContext context)
Performs setup operations when the processor is scheduled to run.
|
createResources, createScriptEngine, createScriptEngineModuleClassLoader, customValidate, isFile, setup, setupEngines, stopgetControllerServiceLookup, getIdentifier, getLogger, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateprivate String scriptToRun
public Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentprotected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
getSupportedDynamicPropertyDescriptor in class AbstractConfigurableComponentpropertyDescriptorName - used to lookup if any property descriptors exist for that name@OnScheduled public void setup(ProcessContext context)
context - the context in which to perform the setup operationspublic void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException
context - the current process contextsessionFactory - provides access to a ProcessSessionFactory, which
can be used for accessing FlowFiles, etc.ProcessException - if the scripted processor's onTrigger() method throws an exceptionCopyright © 2017 Apache NiFi Project. All rights reserved.