Advertisement
ravinator

Set Non-Critical Flag

Dec 10th, 2020
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. // depends: baja; program; history
  2.  
  3. import javax.baja.collection.*;
  4. import javax.baja.naming.*;
  5. import javax.baja.sys.*;
  6. import javax.baja.history.*;
  7. import com.tridium.program.*;
  8.  
  9. public class RobotImpl
  10.   extends Robot
  11. {
  12.  
  13.   public void run()
  14.     throws Exception
  15.   {
  16.     BHistoryConfig history = null;
  17.     BOrd hqord = BOrd.make("history:/|bql:select *");
  18.     BITable<BHistoryConfig> hresult = (BITable<BHistoryConfig>)hqord.resolve().get();    
  19.     TableCursor<BHistoryConfig> h = hresult.cursor();
  20.     while(h.next()) {            
  21.       history = h.get();
  22.       String historyName = history.getId().getHistoryDisplayName();
  23.       log.println("setting non-critical flag on " + historyName);
  24.       Slot idSlot = history.getSlot("id");
  25.       history.setFlags(idSlot, history.getFlags(idSlot) | Flags.NON_CRITICAL);
  26.     }
  27.   }  
  28.  
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement