scheduler not working as expected

General
ggsoft
2011-07-05
2013-05-28
  • ggsoft

    ggsoft - 2011-07-05

    From the examples/references/job.scheduler.xml and with simple echo:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <oddjob id="work">
        <job>
            <folder name=" ">
                <jobs>
            <scheduling:timer id="timer-ts" name="timer-ts" xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling">
                        <schedule>
                            <schedules:dayofweek from="2" to="6" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules">
                                <refinement>
                                    <schedules:time at="10:30"/>
                                </refinement>
                            </schedules:dayofweek>
                        </schedule>
                        <job>
                            <echo id="work2" text="Doing some work at ${timer-ts.current.fromDate}"/>
                        </job>
                    </scheduling:timer>
               </jobs>
            </folder>
        </job>
    </oddjob>
    

    if run with
    java -jar run-oddjob.jar -f server.xml
    (and server.xml referencing above xml) this timer does not fire.

    Does anyone know why?

     
  • ggsoft

    ggsoft - 2011-07-05

    Ok this works, maybe the examples are broken?

    <oddjob xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"
            xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling"
            id="this">
        <job>
                    <parallel name="Schedule Example">
                        <jobs>
                <scheduling:timer id="timer-1" name="timer-1" xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling">
                        <schedule>
                            <schedules:dayofweek from="2" to="6" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules">
                                <refinement>
                                    <schedules:time at="11:32"/>
                                </refinement>
                            </schedules:dayofweek>
                        </schedule>
                        <job>
                            <echo id="work1" text="Doing some work at 1 ${timer-1.current.fromDate}"/>
                        </job>
                    </scheduling:timer>
                <scheduling:timer id="timer-2" name="timer-2" xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling">
                        <schedule>
                            <schedules:dayofweek from="2" to="6" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules">
                                <refinement>
                                    <schedules:time at="11:33"/>
                                </refinement>
                            </schedules:dayofweek>
                        </schedule>
                        <job>
                            <echo id="work2" text="Doing some work at 2 ${timer-2.current.fromDate}"/>
                        </job>
                    </scheduling:timer>
                </jobs>
                    </parallel>
          
        </job>
    </oddjob>
    
     
  • Rob Gordon

    Rob Gordon - 2011-07-06

    Hi - The reason the timer in the example does not fire is because it is in a folder. The examples are in folders so that when viewed from Oddjob Explorer they can be manually started one at a time. To start the timer on the server you would need to use the client.xml in Oddjob Explorer to connect to the server, navigate to the timer job, and run it - or as you have done in the second example, change the folder to parallel or sequential.

    Rob.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks