Use Parent Schedule #45
-
I have a python script that creates Folders then SubFolders within the Folders. Is there a way to set a job's schedule in one of the SubFolders to "Use Parent Schedule"? I have been able to set a job's schedule to use a specific Rule-based Calendar from the Parent SubFolder so I can get this to work; however, I am curious how to set it to "Use Parent Schedule" using the Python classes. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The parent's schedule is the implied default. The job itself defaults to Everyday, but it can't be added to the schedule if the parent is not. So in effect it will only run when the parent does. The downside is if you use the View Schedule option in the guis, then you will see every day listed, because the context at that moment is just the job. So if you want to be explicit about it, then you can do it this way. workflow.add( |
Beta Was this translation helpful? Give feedback.
The parent's schedule is the implied default. The job itself defaults to Everyday, but it can't be added to the schedule if the parent is not. So in effect it will only run when the parent does. The downside is if you use the View Schedule option in the guis, then you will see every day listed, because the context at that moment is just the job.
So if you want to be explicit about it, then you can do it this way.
workflow.add(
JobCommand("jf1", command="echo hello",
when=Job.When(rule_based_calendars=Folder.When.RuleBasedCalendars(included=["USE PARENT"]))),
inpath="jfi-calendars/subfolder1"
)