Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Prompt for cron Schedule #3721

rnadeau ·

Hi,

I'm trying to create a variable prompt to update a specific configuration's schedule.

I have a configuration to change another configuration

groovy:
schedule = configuration.getSchedule()
logger.info("schedule: " + schedule)
cron = schedule.getExpression()
logger.info("cron: " + cron)
schedule.setExpression(vars.getValue("cronSchedule"))
configuration.setSchedule(schedule)
system.configurationManager.save(configuration)

the error I get:

Step Log (master>TriggerSchedule>TriggerWithSchedule)Show Steps
09:36:34,166 INFO - Checking step execute condition...
09:36:34,166 INFO - Step execute condition satisfied, executing...
09:36:34,181 INFO - Executing pre-execute action...
09:36:34,195 INFO - schedule: No Schedule
09:36:34,196 ERROR - Step 'master>TriggerSchedule>TriggerWithSchedule' is failed: groovy.lang.MissingMethodException: No signature of method: com.pmease.quickbuild.taskschedule.schedule.NoSchedule.getExpression() is applicable for argument types: () values: []
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at script14896713941811854308129.run(script14896713941811854308129.groovy:4)
at com.pmease.quickbuild.plugin.basis.BasisPlugin$29.evaluate(BasisPlugin.java:357)
at com.pmease.quickbuild.DefaultScriptEngine.evaluate(DefaultScriptEngine.java:305)
at com.pmease.quickbuild.DefaultScriptEngine.evaluate(DefaultScriptEng...

please help

  • replies 1
  • views 1624
  • stars 0
robinshen ADMIN ·

Please try this:

groovy:
import com.pmease.quickbuild.taskschedule.schedule.*;

def schedule = new CronSchedule();
schedule.setExpression(vars.getValue("cronSchedule"));
configuration.setSchedule(schedule);
system.configurationManager.save(configuration);