Groovy Script Examples
These pages are ready-made Groovy scripts for entity flows and task schedules, each one checked on a demo database before it was published. Every page explains what the script does, when it helps, how to set it up and what its messages mean, and gives the full source to copy.
None of these scripts is built into the system. They are samples: you paste the source into the customer's flow or task, and you can adapt it.
Using a script from these pages
Each page has a Script link to a .groovy file and shows the same source at the bottom of the page. Copy the whole file, from the package line to the last brace.
- On an entity flow: open Administration → Display Customization → Entity Flow, add a line to the Details grid with the target action the page gives, and paste the script into the line's Groovy Script column. Leave Class Name empty: it is filled in when you save.
- On a task schedule: open Basic → Settings → Task Schedule, create a task of type Action, enter
com.namasoft.infor.domainbase.util.actions.EAGroovyActionin Class Name, and paste the script into Parameter 1.
Every script takes its first input from Parameter 2. On an entity flow, Parameter 1 stays empty. On a task schedule, Parameter 1 holds the script. Either way the parameter table on each page starts at Parameter 2. When you save, the line's description and the titles above the parameters fill in from the script itself.
EAGroovyAction explains how the system compiles and runs these scripts.
Each page is marked one of two ways:
- Recommended pattern: generic. It works as it is, controlled through its parameters.
- Customer-specific example: written for one installation, with fields or codes fixed in the source. The page lists what to change before using it elsewhere.