Execute a Jython script.
yaml
type: "io.kestra.plugin.scripts.jython.Eval"
yaml
id: jython_eval
namespace: company.team
tasks:
- id: eval
type: io.kestra.plugin.scripts.jython.Eval
outputs:
- out
- map
script: |
from io.kestra.core.models.executions.metrics import Counter
import tempfile
from java.io import File
logger.info('executionId: {}', runContext.render('{{ execution.id }}'))
runContext.metric(Counter.of('total', 666, 'name', 'bla'))
map = {'test': 'here'}
tempFile = tempfile.NamedTemporaryFile()
tempFile.write('555\n666\n')
out = runContext.storage().putFile(File(tempFile.name)
SubType string
Dynamic YES
A list of output variables that will be usable in outputs.
Dynamic NO
A full script.
The captured outputs as declared on task property.
The resulting object.
Mostly the last return of eval (if the language allows it).