Repository navigation
platform sdk threat levels
A ThreatLevel defines a configured response to an incident, such as a fire, building lockdown, emergency drill, or hostile event. An operator or SDK application can activate it on the system or on a specific area. Its activation and deactivation actions can affect access control, video, alarms, messaging, macros, and other supported action targets.
A threat level can be activated on the entire system or scoped to a single area:
ThreatLevel level = engine.GetEntity<ThreatLevel>(threatLevelGuid);
// System-wide.
level.ActivateOnSystem();
// ...
level.DeactivateFromSystem();
// Area-scoped.
level.Activate(areaGuid);
// ...
level.Deactivate(areaGuid);Security Center stores at most one active threat level per target. Activate(areaGuid) replaces the active threat level on the specified area without changing its child areas. Different areas can therefore have different active threat levels.
ActivateOnSystem() applies the threat level to SystemConfiguration and recursively to all areas, replacing the active threat level on every affected target. Deactivate(areaGuid) clears the active threat level on the specified area. DeactivateFromSystem() clears the active threat level on SystemConfiguration and all areas.
The deactivation methods reset the target. They do not verify that the ThreatLevel instance used to call the method is the threat level currently active on that target.
All four methods require a connected SDK engine. A disconnected call throws SdkException with SdkError.NotConnected. For an area-scoped call, a Guid that does not resolve to an Area causes SdkException with SdkError.UnableToRetrieveEntity. The logged-on user must have SdkPrivilege.SetThreatLevel for area-scoped activation and deactivation. System-wide activation and deactivation require SdkPrivilege.SetSystemwideThreatLevel.
These methods return void and do not report whether the configured actions completed successfully.
ThreatLevel.ActivationActions contains the actions that Security Center runs when the threat level is activated. DeactivationActions contains the actions that Security Center runs when the threat level is deactivated. Examples include:
- Lock perimeter doors in the affected area.
- Boost the recording quality of selected cameras.
- Trigger an alarm.
- Send an email or message.
- Run a macro.
ActivationActions and DeactivationActions are separate action lists. Security Center does not automatically reverse activation actions or restore the state that existed before activation. Configure DeactivationActions for the state that Security Center must establish after deactivation.
When another threat level replaces the current threat level on a target, Security Center issues the previous level's deactivation actions before the new level's activation actions.
Reading ThreatLevel.ActivationActions, ThreatLevel.DeactivationActions, or Area.ThreatLevelMappings returns a list copy. To save changes, modify the returned list and assign the complete list back to the property.
A connected SDK application receives threat level changes through Engine.EventReceived when its event filter allows EventType.ThreatLevelActivated and EventType.ThreatLevelDeactivated. In the handler, pattern match EventReceivedEventArgs against ThreatLevelActivatedEventArgs or ThreatLevelDeactivatedEventArgs.
Both event types expose ThreatLevel, which identifies the threat level, and Target, which identifies the root target of the operation. Target is SystemConfiguration.SystemConfigurationGuid for a system operation or the area Guid for an area operation.
A system operation changes area states recursively but does not raise a separate threat-level event for every affected area. These events identify the state transition; they do not indicate that the configured actions have finished.
private void OnEventReceived(object sender, EventReceivedEventArgs e)
{
if (e is ThreatLevelActivatedEventArgs activated)
{
Console.WriteLine($"Threat level {activated.ThreatLevel} activated on {activated.Target}.");
}
else if (e is ThreatLevelDeactivatedEventArgs deactivated)
{
Console.WriteLine($"Threat level {deactivated.ThreatLevel} deactivated on {deactivated.Target}.");
}
}For how to subscribe to and filter Security Center events, see Working with Security Center events.
ThreatLevel.Color is a read-write SolidColorBrush that defines the color Security Desk displays for the active threat level. Set this property when configuring the threat level.
Use these properties to read the active threat level:
-
SystemConfiguration.ActiveThreatLevel: The threat level active on the system target, orGuid.Emptywhen no threat level is active. -
Area.ActiveThreatLevel: The threat level active on the area, orGuid.Emptywhen no threat level is active.
Area.ThreatLevelMappings is a read-write List<AccessPointGroupThreatLevelMapping>. Each mapping identifies a threat level through ThreatLevelId and contains ActivationActions and DeactivationActions.
Actions from an applicable area mapping are added to the actions configured on the ThreatLevel; they do not replace them. Different areas can therefore associate different actions with the same threat level.
For a nested area, an action from a matching parent-area mapping is inherited only when the action supports area-wide targeting and does not identify a specific recipient.
- About access control: Door locking and access policy, possible action targets.
- About alarms: Alarm triggering, acknowledgement, investigation, and forwarding.
-
About doors, areas, elevators, and access points: The
Areaentity readsActiveThreatLevelandThreatLevelMappings. - About video: Recording boost and video protection, possible action targets.
- Overview
- Connecting to Security Center
- SDK certificates
- Referencing SDK assemblies
- ASP.NET hosting
- SDK compatibility
- Migrating to modern .NET
- Entities
- Entity cache
- Entity loading, cache, and query options
- Detecting entity changes
- Entity change event reference
- Transactions
- Security Center events
- Actions
- Security Desk
- Custom events
- Event-to-actions
- Managing macros
- ReportManager
- ReportManager query reference
- Access control raw events
- DownloadAllRelatedData and StrictResults
- Privileges
- Partitions
- Entity write restrictions
- About custom fields
- About video
- About cameras
- Enrolling a video unit
- Ingesting third-party video
- Archiver and auxiliary archiver roles
- Archive transfer
- About access control
- About cardholders and credentials
- About doors, areas, elevators, and access points
- About access rules and schedules
- About access control units and interface modules
- Enrolling an access control unit
- Door templates
- Visitors
- Mobile credentials
- About threat levels
- About alarms
- About incidents
- Maps
- Logging
- Overview
- Localization
- Certificates
- Lifecycle
- Threading
- State management
- Configuration
- Restricted configuration
- Events
- Queries
- Request manager
- Database
- Entity ownership
- Engine extensions
- Entity mappings
- Server management
- Custom privileges
- Custom entity types
- Resolving non-SDK assemblies
- Deploying plugins
- Modern .NET support
- Overview
- Localization
- Certificates
- Creating modules
- Tasks
- Pages
- Components
- Tile extensions
- Services
- Contextual actions
- Custom actions
- Options extensions
- Configuration pages
- Monitors
- Shared components
- Commands
- Extending events
- Map extensions
- Timeline providers
- Image extractors
- Credential encoders
- Credential readers
- Cardholder fields extractors
- Badge printers
- Content builders
- Dashboard widgets
- Incidents
- Logon providers
- Pinnable content builders
- Custom report pages
- Overview
- Getting started
- Media file formats
- MediaPlayer
- VideoSourceFilter
- MediaExporter
- MediaFile
- G64 converters
- FileCryptingManager
- PlaybackSequenceQuerier
- PlaybackStreamReader
- OverlayFactory
- PtzCoordinatesManager
- AudioTransmitter
- AudioRecorder
- AnalogMonitorController
- Camera blocking
- Overview
- Getting started
- Referencing entities
- Entity operations
- About access control in the Web SDK
- About video in the Web SDK
- Users and user groups
- Partitions
- Custom fields
- Custom card formats
- Actions
- Events and alarms
- Incidents
- Reports
- Tasks
- Macros
- Custom entity types
- System endpoints
- Performance guide
- Reference
- Endpoints
- Constants
- Enumerations
- Under the hood
- Troubleshooting