> For the complete documentation index, see [llms.txt](https://triton.pharos.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://triton.pharos.ai/core-concepts/custom-classifications.md).

# Custom Classifications

Add your own Type and Area values the upgrade-safe way — with your own String-constant classes instead of extending Triton's shipped enums.

Triton ships with a set of built-in `Category`, `Type`, and `Area` values (see [Enums](https://triton.pharos.ai/core-concepts/enums.md)), and they're perfectly fine to use as-is out of the box. But every org eventually wants its *own* classifications — an `InvoiceSync` area, a `Callout` type — and the obvious move is to crack open `TritonTypes.cls` and add them to the enum. Don't. This page shows the convention we recommend instead.

## The problem with extending the enums

Apex enums can't be extended from the outside. There's no `implements`, no subclassing, no "add a value in your own file." The only way to add `InvoiceSync` to `TritonTypes.Area` is to edit the shipped `TritonTypes.cls` enum directly.

That one edit quietly signs you up for a recurring tax:

* **Upgrades clobber your changes.** `TritonTypes.cls` is a Triton file. When you pull a newer version of Triton, your additions get overwritten — or, worse, you hit merge conflicts every single upgrade and have to re-reconcile the enum by hand.
* **You now own a fork of a vendor file.** Every future Triton release becomes a manual merge instead of a clean install.

{% hint style="warning" %}
**Don't edit `TritonTypes.cls` (or any shipped Triton class) to add your own values.** Anything you add there is fair game to be clobbered on the next upgrade. Keep your customizations in files that are *yours*.
{% endhint %}

## The convention: your own constant classes

The builder already accepts plain `String` values for the two classifications you'll actually want to customize — `type(String)` and `area(String)`. So instead of extending an enum, define your own class of `public static final String` constants and pass those. The file is yours; no Triton upgrade will ever touch it.

Create a class per classification. Here's an `Area` catalog for your org:

{% code lineNumbers="true" %}

```apex
public class TritonArea {
    public static final String INVOICE_SYNC = 'InvoiceSync';
    public static final String ACCOUNT_ENRICHMENT = 'AccountEnrichment';
    public static final String PARTNER_COMMUNITY = 'PartnerCommunity';
    public static final String DEAL_REGISTRATION = 'DealRegistration';
}
```

{% endcode %}

And a `Type` catalog:

{% code lineNumbers="true" %}

```apex
public class TritonType {
    public static final String CALLOUT = 'Callout';
    public static final String SCHEDULED_JOB = 'ScheduledJob';
    public static final String DATA_QUALITY = 'DataQuality';
}
```

{% endcode %}

Then log against your constants exactly the way you would against an enum:

{% code lineNumbers="true" %}

```apex
Triton.info(Triton.t
    .area(TritonArea.INVOICE_SYNC)
    .type(TritonType.CALLOUT)
    .summary('Invoice pushed to ERP'));
```

{% endcode %}

## Why this beats the alternatives

This convention sits deliberately between two worse options — raw string literals and enum extension — and takes the best of both:

* **vs. raw string literals** (`.area('InvoiceSync')`): literals invite typos (`'InvoceSync'` filters into oblivion), give you no IDE autocomplete, and offer no single place to see the full vocabulary. Constants fix all three — one typo-proof definition, discoverable in your editor, self-documenting.
* **vs. editing the enum**: you keep the consistency and discoverability of a fixed value set, but without the upgrade tax. Your constants live in *your* classes, so Triton upgrades stay clean.

In short: **the benefits of enums (consistency, no typos, autocomplete, self-documenting code) without the upgrade pain.**

{% hint style="info" %}
The values are just strings on the log record either way — `TritonArea.INVOICE_SYNC` and `TritonTypes.Area.OpportunityManagement` both end up as plain text in the Functional Area field. Mixing built-in enum values and your own constants in the same org is completely fine.
{% endhint %}

## The same values from LWC and Flow

Area is what groups a feature's logs across tiers, so use the same string everywhere. The LWC builder's `.area(...)` and the Flow **Log** action's **Area** input both accept any string and keep it as sent: `.area('InvoiceSync')` in a component lands next to `TritonArea.INVOICE_SYNC` from Apex. The LWC `AREA` constants carry the built-in Apex names (`AREA.ACCOUNTS` is `'Accounts'`), so they group with the `TritonTypes.Area` values too.

## A note on Category

`Category` is the exception, and it's worth calling out. Unlike `type(...)` and `area(...)`, the builder's **`category(...)` only accepts the `TritonTypes.Category` enum — there is no `category(String)` overload.** That's by design: Category drives how Pharos renders the log detail page and layout, so it isn't a free-form, business-specific field the way Type and Area are.

So this constants pattern is for **Type** and **Area** — the extensible, org-specific classifications. For **Category**, stick with the built-in enum values.

{% hint style="success" %}
**Do**

* Keep your custom `Type` and `Area` values in your own `public static final String` constant classes (e.g. `TritonArea`, `TritonType`).
* Pass them via `.area(TritonArea.INVOICE_SYNC)` and `.type(TritonType.CALLOUT)`.
* Use the built-in `TritonTypes` enum values as-is when they already fit.
* Use the `TritonTypes.Category` enum for Category — always.

**Don't**

* Edit `TritonTypes.cls` (or any shipped Triton class) to add your own values — upgrades will clobber them.
* Scatter raw string literals through your code — you lose typo-safety and discoverability.
* Invent custom Category strings — Category affects rendering, so keep it on the built-in enum.
  {% endhint %}

For guidance on designing a classification vocabulary that scales, see [Taxonomy & Standards](https://triton.pharos.ai/triton-best-practices/taxonomy-and-standards.md).
