Forum

Please note that you can subscribe to the individual forums. A subscription for news only covers the news.

Notifications
Clear all

Disabling Abort in Jobs  

   RSS

0

Hola Hallo Hoopla

Is it possible to establish a Job with no abort option, or to deny the abort via a procedure?

The Job is a test with a MaxTime limit. I’m using Respite to establish an overriding deadline. Thing is, Sub can start and then abort the test to gain time to find the answers.

The workaround at the moment is a piece of script to establish that Sub can only start the test within five minutes more than the remaining time to deadline. In other words, if the Maxtime (Test duration) is 20mins, Sub can start the test no sooner than 25 minutes before the Respite (deadline). I’m not sure this solution covers all eventualities. I could save some script by setting the Respite time for the same as (or slightly longer than) the test duration, but then the test needs to be started very soon after issuance, which may be inconvenient. The advantage of the chosen system is that Sub can be given some notice of the coming test and has a chance to plan for it.

Anyhow, the question is in the first line. Any ideas welcomed.

Another question.  I cannot work out how to display the deadline correctly in the assignments tray. Setting !Respite to, say, 15:30:00, seems to behave in all ways as 3:30pm, except in the Assignment’s box, where ‘deadline’ is current time plus 15 hours and 30 mins. Setting an Endtime also does not seem to display as a deadline in the Assignments tray. Again, any advice appreciated.

7 Answers
0

No wait! It seems 'respite' is not being registered as a time of day in any respect - it just seemed that way as the calculations gave the same result whether it was a duration or a time of day.

So I'm not sure how to input an hour of day to set the deadline, but I can display the deadline correctly in the assignments tray by assuming that Respite is a duration not a clock hour. 

0

You're right that 'respite' is not a time of day. IT is how long before the deadline that the sub is to be notified. Maybe you can use 'EndTime', I don't remember exactly how it works. 

You cannot prevent an assignment from being aborted. But there are ways to prevent the sub from starting again, once it is aborted. Meaning that 'abort' is the same as 'give up'. You can use an 'AbortProcedure' to take some action.

I don't remember if you can delete the job from the abort procedure. If you can, that is one way of doing it. 

Another way is to set a flag in the abort procedure, and then use a 'BeforeProcedure' to deny the start if the flag is set. 

You can possible think of other combinations.

Sven

 

 

0

Thanks Sven.

I did notice that you and subbie53 had covered some of this ground.

I have been trying to restrict the window for starting a job. I thought I was onto something using Respite. I came up with some script which culminated in ...

     If=!EarliestStartTime > !zzTime 
     Setflag=zzDeny

!EarliestStartTime is !zzdeadline minus !maxtime+5mins. So if the deadline is 3pm and the Maxtime+5 is 30mins, then !EarliestStartTime is 2:30pm.

But it doesn’t work. When !EarliestStartTime arrives, the deadline is pushed 24 hours into the future so the current time is suddenly way too early to start the job. I’m not sure what’s going on, but it may have to do with the fact that !EarliestStartTime is drawn in part from ‘!zzDeadline’, which includes a date.

I am able to get the desired effect using ‘endtime’, as you suggest. Since Endtime is a clock time, I can use it to construct !EarliestTime without need of zzDeadline: 

!Earliesttime=!Endtime minus !MaxTime+5.

But unlike Respite, it doesn’t display the corresponding deadline in the Assignments tray – ‘deadline’ is displayed as two days hence regardless. In truth, I’m not sure what the effect of EndTime will be, but I can incorporate the time into the name of the task. just so Sub knows it.

So I feel progress has been made. I can now set an exam, stick it worryingly in the assignments tray but with no option to start it or see what’s in it until nearer the deadline. Well, I say 'deadline'; I wonder what effect it will actually have besides determining when the test can be started. Still working on it...

[Job-Test. Finish by {!EndTimeTEST} ]

               Endtime=!EndTimeTEST

               MaxTime=!MaxtimeTEST

               BeforeProcedure=TESTReadyCheck

               Muststart=1

 

[Procedure-TestReadyCheck]

Set!=!EarlyStart,!EndtimeTEST

Subtract!=!EarlyStart,!MaxtimeTEST

Subtract!=!EarlyStart,00:05

 

Case=First

               When=!EarlyStart>!zzTime

                    Setflag=zzDeny

                    Set!=!EarlyStartInfo,!EarlyStart

                    Subtract!=!EarlyStartInfo,!zzTime

                    Message=Come back in {!EarlyStartInfo} minutes.

                             

               When=!EarlyStart<=!zzTime

                              Procedure=StartTest

Case=End

0

Your first example should work if you replace !zzTime by !zzNow. !zzTime is the time of day, !zzNow is the date and time. 

     If=!EarliestStartTime > !zzNow  
     Setflag=zzDeny

Remember that if you use 'If' in the before procedure, it will prevent all of the procedure from being called. So !EarliestStartTime must be calculated in advance. You probably want to use Case as in your example. 

The deadline is always displayed in the assignments tray. If you have a wrong time there, then you probably have the wrong deadline. 2 days is the default respite, if you don't code it. So you need to add the Respite keyword. However, what happens when you have both Respite and EndTime, I honestly don't know. You need to experiment. 

In worst case, you need to calculate the time to the deadline and use that as respite, before you launch the job. 

In general, your code looks fine. You are on the right track.

Sven

 

 

0

!zzNow. Wow! It's the answer to the first issue. So now I can control the deadline (as displayed in the Assignments tray) using Respite duration and have a warning flare up if the Sub exceeds it. And that’s where I wanted to be. The inclusion of a date makes some of the messages a little awkward: the ‘deny’ message reads “Come back in 03-07-2020 00:05:03 minutes.” I’m thinking of combining Respite and Endtime, the former for functionality and the latter for messages; they can be synchronised as near as damn it. I mean, the Master isn’t a robot, is he?

Thanks for the help and encouragement. If I learn anything about EndTime, I'll share.

0

Try this:

                    Set!=!EarlyStartInfo,!EarlyStart

                    Subtract!=!EarlyStartInfo,!zzNow

                    Message=Come back in {!EarlyStartInfo} 

 

Sven

0

Hahaha.  Yes, of course. Thanks!