> For the complete documentation index, see [llms.txt](https://documentation.virtuedeep.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.virtuedeep.tech/guides/using-the-portal/creating-logic-blueprints.md).

# Creating logic blueprints

Learn how to customize your solution's behaviour by building logic blueprints in the Portal.

A logic decides *when*, *for whom* and *what* your solution delivers. You build one on a canvas, by dropping nodes and wiring them together.

## What a logic is made of

| Component     | Description                                                                                                                                                                                                |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Activator** | (Mandatory) Who or what the logic acts on.                                                                                                                                                                 |
| **Variable**  | (Mandatory) What the logic reads to decide. Variables come in three types: **Environmental**, **User Motion** and **User Geotargeting**. A **Values Setup** node declares the values they compare against. |
| **Output**    | (Mandatory) What the logic delivers. An output picks an **attribute** and an action **type**; only actions of that type are delivered, through an interaction channel output.                              |
| **Function**  | (Optional) Extra processing applied between a variable and an output.                                                                                                                                      |

{% hint style="warning" %}
**This replaced conditions and actions.** What used to be a *condition* is now a *variable*, and what used to be an *action* is now an *output*. The wire format still says condition and action while the API revamp is in progress, so you will see the old names in some API payloads. See [Migrating to the new model](https://documentation.virtuedeep.tech/whats-new/migrating-to-the-new-model.md).
{% endhint %}

{% hint style="info" %}

#### Anchoring

Anchoring is the equivalent of copyrighting the content in your solution.

Anchor a logic and it is used exactly as written, with no new logics generated from it — at the cost of some personalisation. Anchor an action and it is used as-is, which stops action generation inside its parent attribute.
{% endhint %}

For the concepts, see [Logics](https://documentation.virtuedeep.tech/affective-computing-by-virtue/designing-solutions-powered-by-affective-computing/understanding-project-components/logics.md).

## Building a logic

1. In the left sidebar, click **Logics**.

<figure><img src="https://2595582246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvj8sRVTP47RXCgM8y0Lm%2Fuploads%2Fgit-blob-68a39bd5af660555d0b70167dbe0c7ac80606804%2FPortal%20-%20logics%201.png?alt=media" alt=""><figcaption><p>The logic list</p></figcaption></figure>

2. Click **+ Create**.
3. Enter a **Logic Name** and click the save icon beside it.
4. Build the logic on the canvas. The toolbar along the top adds nodes: **Activator**, **Variable**, **Output**, **Function**. Drag from a node's port to another node's port to wire them.

<figure><img src="https://2595582246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvj8sRVTP47RXCgM8y0Lm%2Fuploads%2Fgit-blob-06620cd23d976d19d8abc3fd2ebe0962b9b9c8c1%2FPortal%20-%20logics%202.png?alt=media" alt=""><figcaption><p>The logic canvas</p></figcaption></figure>

5. Click **Save**.

## Setting the scope

Every logic starts with a **Parametrization Type** node. This is where you decide how widely the logic applies.

| Field                       | Description                                                         |
| --------------------------- | ------------------------------------------------------------------- |
| **Blueprint Category**      | The category the logic belongs to.                                  |
| **Generative Intelligence** | Select **Anchor** to stop new logics being generated from this one. |
| **Projects**                | The projects this logic applies to. You can select several.         |
| **Solution**                | The solution this logic applies to.                                 |

{% hint style="success" %}
**A logic is no longer tied to one project.** Logics and projects are many-to-many: one logic can serve several projects, and a project draws on many logics. Leave **Projects** and **Solution** empty and the canvas tells you so — *no scope: this logic will apply to every project and solution*.
{% endhint %}

## Diagnostics logics

Client and host accounts see a second tab, **Diagnostics**, alongside the logic list. Diagnostics logics run during profiling rather than during normal interaction. Tenant accounts do not see this tab.

***

### Related documentation

{% content-ref url="/pages/nHDJq3o3jRRisUuUTlsg" %}
[Logic blueprinting](https://documentation.virtuedeep.tech/affective-computing-by-virtue/about-our-framework/edaa-tm-features/logic-blueprinting.md)
{% endcontent-ref %}

{% content-ref url="/pages/LcpZvmDteoHCDr3EdTkm" %}
[Working with logics](https://documentation.virtuedeep.tech/guides/using-the-public-apis/working-with-logics.md)
{% endcontent-ref %}
