I have some transaction groups that run according to shift times which are hard coded into the group. I would like to implement the group trigger time according to a schedule. That way if a schedule changes, the transaction group will change accordingly. I also like to monitor when a shift is active or not via tags. Here is a couple of scripts that I currently use, but I was wondering if there is a better/easier way to do this. It would be nice if things like this could be implemented with the expression language. Any ideas is appreciated.
schedules = system.user.getSchedules()
for schedule in schedules:
if schedule.getName() == 'routerShiftOne':
print schedule.getAllDayTime()
user = system.user.getUser('default','routerShiftOne')
shiftBool = system.user.isUserScheduled(user)
system.tag.write('CNC_Global/1stShift', shiftBool)