Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Code Block
languagepy
from ecflow import Defs,Suite,Task,Day,Date,Cron

defs = Defs()
s1 task = ecflowdefs.Taskadd_suite("t2s1") #
t1 create a task
 task2= s1.add_task("date")
t1.add_date( 1,2 0,2010 0)       # day, first of every month, and every year
 task2t1.add_date( 1,0,0 (Date("2.*.*")) # firstsecond of eachevery month orand every year same as: 1..
 task2
t1.add_date(28,2,2026)     # 28 february 2026

t2 = s1.add_task("day")
t2.add_day("monday")
t2.add_day(Days.tuesday)
        
t3 "monday" )
 task2.add_today( 0,10 ) # hour, minute, same as today 0:10
 task2.add_today( ecflow.Today( 0,59, True )) # hour, minute, relative, same as today +0:59
 start = ecflow.TimeSlot(0,0) # adding a time series
 finish = ecflow.TimeSlot(23,0)
 incr = ecflow.TimeSlot(0,30)
 ts = ecflow.TimeSeries( = s1.add_task("time")
t3.add_time("+00:30")                     # 30 minutes after suite has begun
t3.add_time("+00:30 20:00 01:00")         # 00:30,01:30,02:30....07:30 after suite start
              
t3.add_time(0, 59, True)                  #  00:59 - 59 minutes past midnight
t3.add_time(Time(TimeSlot(20, 10)))       #  20:10 - 10 minutes pas eight
t3.add_time(Time(TimeSlot(20, 20), True)) # +20:20 - 20 minutes and 20 hours, after suite start
        
start = TimeSlot(0, 0)
finish = TimeSlot(23, 0)
incr = TimeSlot(0, 30)
time_series = TimeSeries(start, finish, incr, True); # same as today +00:00 23:00 00:30
 task2.add_today( ecflow.Today(ts) )
 cron = ecflow.Cron()
 
t3.add_time(Time(time_series))
t3.add_time(Time(0, 10))                  #  00:10 
t3.add_time(Time("+00:40"))               # +00:40
t3.add_time(Time("+00:40 20:00 01:00"))   # 00:40,01:40,02:30...17:40 after suite start
        
cron = Cron()
cron.set_week_days( [0,1,2,3,4,5,6] )
 cron.set_days_of_month( [1,2,3,4,5,6] )
 cron.set_months( [1,2,3,4,5,6] )
 cron.set_time_series( "+00:00 23:00 00:30" )
 task2s1.add_task("cron").add_cron( cron );