This is an automated email from the ASF dual-hosted git repository.
fgerthoffert pushed a commit to branch UNOMI-847
in repository https://gitbox.apache.org/repos/asf/unomi.git
The following commit(s) were added to refs/heads/UNOMI-847 by this push:
new 143f90075 UNOMI-847: Updated the Groovy Action documentation
143f90075 is described below
commit 143f9007549277157a72e64c28cd3c4cd2a004a3
Author: Francois G. <[email protected]>
AuthorDate: Tue Aug 27 13:59:53 2024 +0200
UNOMI-847: Updated the Groovy Action documentation
---
manual/src/main/asciidoc/configuration.adoc | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/manual/src/main/asciidoc/configuration.adoc
b/manual/src/main/asciidoc/configuration.adoc
index 7795d56d4..52efcfc09 100644
--- a/manual/src/main/asciidoc/configuration.adoc
+++ b/manual/src/main/asciidoc/configuration.adoc
@@ -459,7 +459,7 @@ Note that when a groovy action is deleted by the API, the
action type associated
In this short example, we’re going to create a Groovy Action that will be
adding “Hello world!” to the logs whenever a new view event is triggered.
-The first step consists in creating the groovy script on your filesystem,
start by creating the file `hello-world.groovy`:
+The first step consists in creating the groovy script on your filesystem,
start by creating the file `helloWorldGroovyAction.groovy`:
[source,groovy]
----
@@ -474,14 +474,16 @@ def execute() {
As the last instruction of the script is `EventService.NO_CHANGE`, data will
not be persisted.
-Once the action has been created you need to submit it to Unomi (from the same
folder as `hello-world.groovy`).
+Once the action has been created you need to submit it to Unomi (from the same
folder as `helloWorldGroovyAction.groovy`).
[source,bash]
----
curl -X POST 'http://localhost:8181/cxs/groovyActions' \
--user karaf:karaf \
---form '[email protected]'
+--form '[email protected]'
----
+Important: A bug ( https://issues.apache.org/jira/browse/UNOMI-847[UNOMI-847]
) in Apache Unomi 2.5 and lower requires the filename of a Groovy file being
submitted to be the same than the id of the Groovy action (as per the example
above).
+
Finally, register a rule to trigger execution of the groovy action:
[source,bash]
----