Task and execution listeners with Javascript

Is it possible to define listeners with Javascript?

I want to save some of the task’s variables (form fields) into the execution scope in order to be able to read those in the next taks.

The idea is to allow the initiator to select which user is going to be the assignee for the next task.
Another requirement is to show the start task’s fields’ values as read only for the first user task.

Any help will be appreciated.

Thank you.

Hi @douglascrp,

Please have a look at the scripting documentation.

Cheers,
Thorben

Thank you.

I know that documentation page already, and I saw no Javascript samples there, only groovy.
Is that the only option I have?

Right now, I’m using java code in order to read and set such variables, but I would like to be able to use something less complicated, at least for this moment, where I’m simply trying to get used with Camunda.

Hi Douglascrp

Javascript is supported based on scripting documenation

"Javascript is part of the Java Runtime (JRE) and thus available out ot the box.
We include Groovy in the pre-packaged Camunda distributions."

For a Javascript sample see below link
Scripting Integration

To use javascript you need to set scriptFormat="javascript"

1 Like

Perfect. That’s what I was looking for.

Thank you for your time.