Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Remove the @CompileStatic annotation from all Groovy implementations, e.g. change from:

Code Block
languagegroovy
import groovy.transform.CompileStatic
...


@CompileStatic
class MySchedTaskJobDelegate implements SchedTaskJobDelegate {
 ...
}

...

Code Block
languagegroovy
...


class MySchedTaskJobDelegate implements SchedTaskJobDelegate {
 ...
}

Fix any Groovy script used for scripted REST or SQL connector following these best practices:

  • Change any multiple assignment like:

    Code Block
    languagegroovy
    def (one, two) = compositeId.tokenize('_')

     into:

    Code Block
    languagegroovy
    def tokenizedId = compositeId.tokenize('_')
    def one = tokenizedId[0]
    def two = tokenizedId[1]


  • Move SQL queries like:

    Code Block
    languagegroovy
    sql.eachRow("""SELECT * FROM mytable """
                    + (where == null || where.isEmpty() ? '' : " WHERE " + where) + " ORDER BY codfis ASC LIMIT " + pageSize + " OFFSET " + offset,
                    {
                        result.add([
                                __UID__ : it.myid,
                                uid     : it.myid
    ...

    into:

    Code Block
    languagegroovy
    sql.eachRow("""SELECT * FROM mytable """
                    + (where == null || where.isEmpty() ? '' : " WHERE " + where) + " ORDER BY codfis ASC LIMIT " + pageSize + " OFFSET " + offset,
                    {row ->
                        result.add([
                                __UID__ : row['myid'],
                                uid     : row['myid'],


  • Date formatting should ever be done using a date formatter like:

    Code Block
    languagegroovy
    STD_SDF = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
    STD_SDF.format(mydate)