This is an automated email from the ASF dual-hosted git repository.
pvillard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 4224f03f99 NIFI-14218: Added Stateful annotation to ExecuteGroovyScript
4224f03f99 is described below
commit 4224f03f995783ed0222feb96d39c90b31849535
Author: Matt Burgess <[email protected]>
AuthorDate: Fri Jan 31 15:46:54 2025 -0500
NIFI-14218: Added Stateful annotation to ExecuteGroovyScript
Signed-off-by: Pierre Villard <[email protected]>
This closes #9679.
---
.../java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git
a/nifi-extension-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
b/nifi-extension-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
index 3aeeaa4d51..a4d5698251 100644
---
a/nifi-extension-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
+++
b/nifi-extension-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
@@ -33,6 +33,7 @@ import org.apache.nifi.annotation.behavior.DynamicProperty;
import org.apache.nifi.annotation.behavior.InputRequirement;
import org.apache.nifi.annotation.behavior.Restricted;
import org.apache.nifi.annotation.behavior.Restriction;
+import org.apache.nifi.annotation.behavior.Stateful;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.SeeAlso;
import org.apache.nifi.annotation.documentation.Tags;
@@ -45,6 +46,7 @@ import org.apache.nifi.components.ValidationContext;
import org.apache.nifi.components.ValidationResult;
import org.apache.nifi.components.resource.ResourceCardinality;
import org.apache.nifi.components.resource.ResourceType;
+import org.apache.nifi.components.state.Scope;
import org.apache.nifi.controller.ControllerService;
import org.apache.nifi.dbcp.DBCPService;
import org.apache.nifi.expression.ExpressionLanguageScope;
@@ -76,6 +78,8 @@ import org.codehaus.groovy.runtime.StackTraceUtils;
explanation = "Provides operator the ability to
execute arbitrary code assuming all permissions that NiFi has.")
}
)
+@Stateful(scopes = {Scope.LOCAL, Scope.CLUSTER},
+ description = "Scripts can store and retrieve state using the State
Management APIs. Consult the State Manager section of the Developer's Guide for
more details.")
@SeeAlso(classNames = {"org.apache.nifi.processors.script.ExecuteScript"})
@DynamicProperty(name = "A script engine property to update",
value = "The value to set it to",