Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Conversion corrections

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

If you want to use date values in order paramters you can add an init job at the begin of your job chain. This job calculates some date variables like hour, month or year and sets the order parameters to provide them.

...

Code Block
languagehtml/xml

 <job  order="yes" stop_on_error="no" name="init">
     <script  language="javax.script:rhino">
         <![CDATA[
 function spooler_process()\{
    var today = new Date ();
 
    var month = today.getMonth()+1; 
    var fullYear = today.getFullYear(); 
    var day = today.getDate();
    var dayOfWeek = today.getDay();   
    var hour = today.getHours();
    var minutes = today.getMinutes();
    var seconds = today.getSeconds();
 
    var lastMonthDate = new Date();
    lastMonthDate.setMonth(lastMonthDate.getMonth()-1);
    var lastMonth = lastMonthDate.getMonth()+1; 
    var lastFullYear = lastMonthDate.getFullYear(); 
    var lastDay = lastMonthDate.getDate();
    var lastDayOfWeek = lastMonthDate.getDay();   
 
    var order = spooler_task.order();
 
    order.params().set_var("month",month);
    order.params().set_var("fullYear",fullYear);
    order.params().set_var("day",day);
    order.params().set_var("dayOfWeek",dayOfWeek);
    order.params().set_var("hour",hour);
    order.params().set_var("minutes",minutes);
    order.params().set_var("seconds",seconds);
 
    order.params().set_var("lastMonth",lastMonth);
    order.params().set_var("lastFullYear",lastFullYear);
    order.params().set_var("day",day);
    order.params().set_var("dayOfWeek",dayOfWeek);
    order.params().set_var("lastDay",lastDay);
    order.params().set_var("lastDayOfWeek",lastDayOfWeek);
  
 	return true;
 \}
         ]]>
     </script>

     <run_time />
 </job>

...