Camunda Modeler groovy script for tasks and Execution Listener

Hi everyone! I’m here 'cause I’m searching for inline groovy script for task and execution listener. Could you point me out some documentations about it? specifically I’m triyng to send an-email when a task is created and I’m looking for ways to make the parent task assign to some field of a generated task (I’m trying to keep the reference of the parent task on the child task). Thank u in advance. Elena

Sounds like you could use a Task Listener which can listen specifically to the task being assigned and then run your groove script.

The Camunda 7 distro does ship with a groovy engine so you should be able to just enter that as the script type like this:

1 Like

Hello! \o/

In addition to master @Niall , if you later want to run groovy scripts external to camunda, you will need to add the dependency below in your project:

MAVEN:

<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.4.17</version>
</dependency>

GRADLE

dependencies {
    implementation 'org.codehaus.groovy:groovy-all:2.4.17'
}

Hope this helps :smiley:
See ya!

William Robert Alves

2 Likes

Thank u so much. I attach a photo to show better what I have to do. I have “Respirazione Consapevole” that is a Task, and I have a Reminder that is the reminder for the User to do that task. My question was if it’s possible to add in the groovy code of the Reminder the “key” of the Task (Respirazione Consapevole), so I can create like a parent-child relation…so when the task is done I can close also together the Reminder.

Task_Listener

Thank u! It will be my next step!
Elena