File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/extension/example Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 11import dev.vml.es.acm.core.code.ExecutionContext
22import dev.vml.es.acm.core.code.Execution
3- import java.util.Calendar
43
54void prepareRun (ExecutionContext context ) {
6- def minute = Calendar . getInstance(). get(Calendar . MINUTE )
7- if (minute % 2 == 0 ) {
8- context. skipped = true
9- }
5+ context. variable(" acme" , new AcmeFacade ())
106}
117
128void completeRun (Execution execution ) {
13- log. info " I am not skipped on even minutes!"
9+ if (execution. status. name() == ' FAILED' ) {
10+ log. error " Something nasty happened with '${ execution.executable.id} '!"
11+ // TODO send notification using built-in 'notifier' for Slack and MS Teams or use custom HTTP client / WebAPI
12+ }
13+ }
14+
15+ class AcmeFacade {
16+ def now () {
17+ return new Date ()
18+ }
1419}
You can’t perform that action at this time.
0 commit comments