Alarm shelving

Alarm shelving

Hello,

How can create alarm shelving  with activation and deactivation in runtime without depending on the time setting (Shelving duration).

Kindly help me to find the solution.