Repository navigation
workspace sdk incidents
Incident builders add custom incident types to Security Center's incident management system. They define the data fields for an incident type and provide the user interface for creating and viewing incidents. Creating a custom incident type requires two classes:
-
IncidentBuilder- registered as a component, defines the incident's data fields and creates the editing view -
IncidentView- provides the user interface for entering and displaying incident data
Use incident builders when you need to capture structured data specific to your organization's incident workflows. Examples include:
- Recording vehicle accident details (license plate, damage assessment, insurance information) for a parking management integration
- Capturing safety inspection results (equipment checked, compliance status, corrective actions) for a workplace safety system
- Logging visitor incidents (visitor identity, escort assigned, areas accessed) for a visitor management integration
- The module registers an
IncidentBuilderwith the workspace duringLoad - When an operator creates or edits an incident, the system calls
IsSupported()with anIncidentContextcontaining the edit mode, attachment type, and existing data - If supported, the system calls
CreateView()with theIncidentbeing edited - The system calls
Initialize()on the view with the workspace - If editing an existing incident, the system sets the view's
IncidentDataproperty with the stored data entries - The operator enters data through the view's interface; the view raises
IncidentDataChangedwhen values change - When the operator saves the incident, the system reads the view's
IncidentDataproperty to persist the data - If
CanExportistrue, the system callsExport()after saving to allow the view to export data (such as video clips) - If
ShouldProtectistrue, the system callsProtect()after saving to allow the view to protect associated video data - When generating incident reports, the system calls
GetFieldValue()on the builder to extract field values for report columns - When the incident dialog closes, the system calls
Dispose()on the view
Inherit from IncidentBuilder and implement the abstract members:
public class MyIncidentBuilder : IncidentBuilder
{
public override string Name => "My Incident Type";
public override Guid UniqueId => new Guid("A1B2C3D4-E5F6-7890-ABCD-EF1234567890");
public override string IncidentDataType => "MyIncident";
public override List<IncidentField> Fields =>
new List<IncidentField>
{
new IncidentField
{
Name = "Location",
DisplayName = "Location",
DisplayInReport = true
},
new IncidentField
{
Name = "Severity",
DisplayName = "Severity Level",
DisplayInReport = true
}
};
public override IncidentView CreateView(Incident incident)
{
return new MyIncidentView();
}
public override string GetFieldValue(List<IncidentDataEntry> incidentData, string fieldName)
{
var entry = incidentData
.FirstOrDefault(e => e.Identifier == fieldName);
return entry?.Data;
}
}| Member | Type | Description |
|---|---|---|
IncidentDataType |
Property (abstract) | Unique string identifier for this incident data type. |
Fields |
Property (abstract) | The list of data fields defined by this incident type. |
CustomFilter |
Property (virtual) | A custom ReportFilter to display in the incident report. Defaults to null. |
Priority |
Property (virtual) | Display order in the incident dialog tabs. Lower values appear first. |
CreateView(Incident) |
Method (virtual) | Create the editing view for the incident. Receives the incident being edited. |
GetFieldValue(List<IncidentDataEntry>, string) |
Method (abstract) | Extract the value of a specific field from incident data. Used by the reporting system to populate field columns. |
IsSupported(IncidentContext) |
Method (virtual) | Return true when the incident type is available in the given context. |
Each field in the Fields list defines a data column for the incident type:
| Member | Type | Description |
|---|---|---|
Name |
string | Unique identifier for the field. Used as the key in GetFieldValue. |
DisplayName |
string | Column header displayed in incident reports. |
DisplayInReport |
bool | Whether the field appears as a column in incident reports. |
The context passed to IsSupported provides:
| Member | Type | Description |
|---|---|---|
EditMode |
bool | Whether an existing incident is being edited. |
AttachmentType |
string | The type of data attached to the incident. |
Data |
IList<IncidentDataEntry> | The attached incident data entries. |
IncidentId |
Guid? | The incident identifier when editing an existing incident. |
Incident data is stored as a list of key-value pairs:
| Member | Type | Description |
|---|---|---|
Identifier |
string | The data entry key. Corresponds to an IncidentField.Name. |
Data |
string | The data entry value. |
Inherit from IncidentView to create the incident editing interface:
public class MyIncidentView : IncidentView
{
public override string IncidentDataType => "MyIncident";
public override List<IncidentDataEntry> IncidentData
{
get
{
return new List<IncidentDataEntry>
{
new IncidentDataEntry("Location", m_location),
new IncidentDataEntry("Severity", m_severity)
};
}
set
{
foreach (var entry in value)
{
switch (entry.Identifier)
{
case "Location":
m_location = entry.Data;
break;
case "Severity":
m_severity = entry.Data;
break;
}
}
}
}
}| Member | Type | Description |
|---|---|---|
IncidentDataType |
Property (abstract) | The incident data type. Must match the builder's IncidentDataType. |
IncidentData |
Property (abstract) | The current incident data as a list of IncidentDataEntry objects. |
| Member | Type | Description |
|---|---|---|
IncidentId |
Property (Guid?) | The incident identifier when editing an existing incident. Set by the system. |
IncidentName |
Property (virtual) | The incident name. |
IncidentTime |
Property (virtual) | The incident timestamp. |
IncidentDescription |
Property (virtual) | The incident description. |
References |
Property (virtual) | Entity references associated with the incident. |
Title |
Property (virtual) | The tab title displayed in the incident dialog. |
IsDataEmpty |
Property (virtual) | Whether the incident data is empty. |
CanExport |
Property (virtual) | Whether the incident data supports export. |
ShouldProtect |
Property (virtual) | Whether the incident data supports protection. |
Initialize(Workspace) |
Method (virtual) | Initialize the view with the workspace. |
Export() |
Method (virtual) | Export the incident data. Return false if the operation is canceled. |
Protect() |
Method (virtual) | Protect the incident's video data. |
Dispose() |
Method (virtual) | Release resources used by the view. |
| Event | Description |
|---|---|
ReferencesChange |
Raised when the References property changes. |
IncidentDataChanged |
Raised when the incident data changes. Call NotifyIncidentDataChanged() to raise this event. |
Important
This component requires a valid SDK certificate.
Register the builder in your module's Load method:
public class SampleModule : Module
{
private MyIncidentBuilder m_incidentBuilder;
public override void Load()
{
m_incidentBuilder = new MyIncidentBuilder();
m_incidentBuilder.Initialize(Workspace);
Workspace.Components.Register(m_incidentBuilder);
}
public override void Unload()
{
if (m_incidentBuilder != null)
{
Workspace.Components.Unregister(m_incidentBuilder);
}
}
}- About the Workspace SDK: Workspace SDK architecture and module lifecycle.
- About components: The component registry and registration lifecycle.
- About workspace modules: Workspace module class and Load/Unload lifecycle.
- About Workspace SDK certificates: Certificate requirements for workspace components.
- 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