Class Design for the Notification system from a system like Batch. I am building a workflow automation system in Python (Batch Job execution). It has features like sending notification on success/failure of batch command execution. Check examples below.

Static notification:

<job>
   name job1
   <notify>
      type mail
      failure agrawall@amazon.com
   </notify>
   <command>
      echo hello loki
   </command>
</job>

Dynamic notification

def time_in_range(start, end, x):
   """Return true if x is in the range [start, end]"""
    if start <= end:
       return start <= x <= end
   else:
       return start <= x or x <= end  

<job> 
   name job2
   <notify>
      type mail
      <rule>
          condition time_in_range(datetime.time(13, 0, 0), datetime.time(1,0,0), datetime.currenttime())
          true agrawall@amazon.com
          false mishrap@amazon.com 
      </rule>
   </notify>
   <command>
      echo hello loki
   </command>
</job>

Can you suggest some designs for the same? How do classes look like in its design, what holds what?

Related posts

Recent Viewed