AnsweredAssumed Answered

Default missing parameters in context

Question asked by rjohnson on Jan 6, 2016
Latest reply on Jan 26, 2016 by rjohnson
I have a timed job that sets its quarrtz cron string using a parameter like this

        <property name="cronExpression">

I would like to be able to default the service cron should someone not set the parameter myservice.cron in and I cannot find out how to do this.

At first I thought this was Freemarker but

${(myservice.cron)!'0 0/1 * * * ?'}

did not work.

Then I found an article saying Freemaker directives must be escaped so I tried

\$\{(myservice.cron)!'0 0/1 * * * ?'\}

but that didn't work either.

More ferreting around on the internet suggests that Alfresco "works out" how to process a parameter based on regex & an array of processors but I cannot fathom out how that works.

Grepping the entire context xml files in Alfresco did not yield any suggestions as to how this can be done

Any kind soul want to explain to me how I set a parameter string that says Use this value if the property exists and if not us "0 0/1 * * * ?"?

Many thanks