# OpcConditionRetainPolicy Enum

> Reference: Defines the evaluation policy for the IsRetained flag within the condition lifecycle.

<span class="api-meta">since v2.55</span>

<dl class="api-definition">
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

Defines the evaluation policy for the [IsRetained](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcconditionnode/members#isretained) flag within the condition lifecycle. This policy determines under which conditions a notification remains of interest to a client and stays visible during a `ConditionRefresh` operation.

## Syntax

<div class="api-signature" data-lang="csharp">

```csharp
public enum OpcConditionRetainPolicy
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Enum OpcConditionRetainPolicy
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → [ValueType](https://learn.microsoft.com/dotnet/api/system.valuetype) → [Enum](https://learn.microsoft.com/dotnet/api/system.enum) → **OpcConditionRetainPolicy**

## Fields

| Name | Value | Description |
|---|---|---|
| <a id="activeonly"></a>`ActiveOnly` | `2` | The [IsRetained](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcconditionnode/members#isretained) flag tracks only the active physical presence of the alarm condition or its latched state. **Specification Detail:** This mode deviates from standard alarm behavior by ignoring acknowledgment. [IsRetained](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcconditionnode/members#isretained) is `true` if `ActiveState == True` OR if the optional `LatchedState == True`. Once the alarm clears (and unlatches), it immediately disappears from active client lists. |
| <a id="activeorunacknowledged"></a>`ActiveOrUnacknowledged` | `3` | The standard OPC UA Alarm lifecycle behavior. The [IsRetained](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcconditionnode/members#isretained) flag remains `true` as long as the alarm is physically active, unacknowledged, or latched. **Specification Detail:** Aligns with OPC UA Part 9 (Clause 4.3). [IsRetained](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcconditionnode/members#isretained) evaluates to `true` if `(ActiveState == True \|\| AckedState == False \|\| LatchedState == True)`. For types lacking [IsActive](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcalarmconditionnode/members#isactive), it evaluates to `(AckedState == False)`. |
| <a id="activeorunconfirmed"></a>`ActiveOrUnconfirmed` | `4` | Extended high-security lifecycle behavior. The [IsRetained](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcconditionnode/members#isretained) flag remains `true` until the alarm is inactive, acknowledged, unlatched, **AND** explicitly confirmed. **Specification Detail:** Complies with the optional extended lifecycle in OPC UA Part 9. [IsRetained](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcconditionnode/members#isretained) evaluates to `true` if `(ActiveState == True \|\| AckedState == False \|\| ConfirmedState == False \|\| LatchedState == True)`. |
| <a id="enabledonly"></a>`EnabledOnly` | `1` | The [IsRetained](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcconditionnode/members#isretained) flag is strictly synchronized with the [IsEnabled](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcconditionnode/members#isenabled) of the condition. **Specification Detail:**`Retain` remains `true` as long as `EnabledState == Enabled`. Changes to `AckedState`, `ConfirmedState`, or `ActiveState` are entirely ignored. |
| <a id="manual"></a>`Manual` | `0` | Manual control mode. The SDK does not manage the [IsRetained](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcconditionnode/members#isretained) flag automatically. **Specification Detail:** The application developer is fully responsible for manually setting `Retain = true/false` based on custom business logic via the SDK API. |

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.55–v2.59 |
