# Processing Rules

### Processing Rules and Widget Display

Purposes displayed in your widgets may be pre-selected based on **processing rules** configured in the Configuration Tree. Processing rules allow you to set default consent states for purposes before users make their first explicit choice.

#### Opt-out rule

When a purpose has the `opt-out` processing rule enabled:

* The purpose appears **pre-selected** (enabled) when a user first visits the widget
* Users can still change the selection before submitting
* The pre-selection applies to all widget types
* Once a user submits their preferences, their explicit choices always take precedence over processing rules

**Input Type Behavior**

The visual appearance of pre-selected purposes depends on the input type:

* **Checkbox**: Appears checked by default but remains clickable
* **Radio buttons**: The "Yes" option is pre-selected
* **Click-to-change sentence:** Displays the sentence corresponding to the enabled state

**Implementation Notes**

When implementing widgets with processing rules:

* Widget SDK methods like `getCurrentUserStatus()` and `isConsentPurposeEnabled()` will reflect the pre-selected state from processing rules
* `setCurrentUserStatus()` can be used to override processing rules programmatically
* Processing rules only affect users who have not previously submitted preferences for a specific purpose

For comprehensive information about processing rules configuration and setting them up via our console or API, see [Processing Rules in Configuration Tree.](https://developers.didomi.io/data-manager/configuration-tree#processing-rules)
