@Tags(value={"rules","rules engine","action","action handler","script","invoke","groovy","python","jython","jruby","ruby","javascript","js","lua","luaj"}) @CapabilityDescription(value="Allows the user to provide a scripted ActionHandler for custom firing of rules depending on the supplied facts. The script must set a variable \'actionHandler\' to an implementation of ActionHandler.") @Restricted(restrictions=@Restriction(requiredPermission=EXECUTE_CODE,explanation="Provides operator the ability to execute arbitrary code assuming all permissions that NiFi has.")) public class ScriptedActionHandler extends AbstractScriptedControllerService implements PropertyContextActionHandler
| Modifier and Type | Field and Description |
|---|---|
protected AtomicReference<ActionHandler> |
actionHandler |
configurationContext, scriptEngine, scriptingComponentHelper, scriptNeedsReload, validationResults| Constructor and Description |
|---|
ScriptedActionHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Action action,
Map<String,Object> facts) |
void |
execute(PropertyContext context,
Action action,
Map<String,Object> facts) |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors()
Returns a list of property descriptors supported by this processor.
|
void |
onEnabled(ConfigurationContext context) |
protected boolean |
reloadScript(String scriptBody)
Reloads the script ActionHandler.
|
void |
setup() |
customValidate, getSupportedDynamicPropertyDescriptor, onPropertyModified, reloadScriptBody, reloadScriptFileabstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getConfigurationContext, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, init, initialize, isEnabledequals, getPropertyDescriptor, getPropertyDescriptors, hashCode, toString, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitinitializegetIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateprotected final AtomicReference<ActionHandler> actionHandler
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractScriptedControllerServicepublic void setup()
setup in class AbstractScriptedControllerServiceprotected boolean reloadScript(String scriptBody)
reloadScript in class AbstractScriptedControllerServicescriptBody - An input stream associated with the script content@OnEnabled public void onEnabled(ConfigurationContext context)
onEnabled in class AbstractScriptedControllerServicepublic void execute(PropertyContext context, Action action, Map<String,Object> facts)
execute in interface PropertyContextActionHandlerCopyright © 2021 Apache NiFi Project. All rights reserved.