Adding groovy script (and compiling functionality) for trigger function