> For the complete documentation index, see [llms.txt](https://triton.pharos.ai/pharos-triton/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/pharos-triton/triton-best-practices/taxonomy-and-standards.md).

# Taxonomy & Standards

## Establishing Consistent Classification

Effective logging requires a consistent taxonomy that enables powerful filtering, grouping, and analysis. Triton uses a three-tier classification system: **Category**, **Type**, and **Area**.

## Core Taxonomy

### Category

Represents the technological origin of the log:

* **Apex**: Server-side code execution
* **Flow**: Declarative automation
* **LWC**: Lightning Web Components
* **Integration**: External system interactions
* **Process Builder**: Legacy automation

### Type

Refines categorization within the parent category:

* **Backend**: Server-side processing
* **Frontend**: Client-side operations
* **DMLResult**: Database operation results
* **Autolaunched Flow**: Automated flow execution
* **Screen Flow**: User-interactive flows
* **AccountTrigger**: Specific trigger types

### Area

Bridges technical and business contexts:

* **Accounts**: Account-related operations
* **Opportunities**: Opportunity management
* **Leads**: Lead processing and conversion
* **Cases**: Case management
* **Orders**: Order processing
* **Integration**: External system interactions
* **Community**: Experience Cloud operations

## Real-World Taxonomy Example

```apex
// Extending the taxonomy for your org's specific needs
public class CustomTritonTypes extends TritonTypes {
    // Custom Areas for your business domains
    public enum CustomArea {
        // Financial Services
        LoanProcessing,
        PaymentProcessing,
        RiskAssessment,
        
        // Healthcare
        PatientManagement,
        AppointmentScheduling,
        MedicalRecords,
        
        // Manufacturing
        InventoryManagement,
        QualityControl,
        SupplyChain,
        
        // Retail
        Ecommerce,
        InventoryTracking,
        CustomerService
    }
    
    // Custom Types for specific operations
    public enum CustomType {
        // Integration Types
        REST_API,
        SOAP_API,
        Webhook,
        BatchSync,
        
        // Process Types
        ApprovalWorkflow,
        DataValidation,
        ReportGeneration,
        NotificationService
    }
}
```

## Taxonomy Best Practices

### Consistency

* **Use established enums**: Leverage Triton's built-in taxonomy before creating custom values
* **Org-wide standards**: Establish and document taxonomy standards across all teams
* **Regular reviews**: Periodically review and update taxonomy to reflect business changes
* **Training**: Ensure all developers understand and follow taxonomy standards

### Extensibility

* **Plan for growth**: Design taxonomy to accommodate future business needs
* **Hierarchical structure**: Use consistent naming patterns for easy understanding
* **Documentation**: Maintain clear documentation of taxonomy meanings and usage
* **Version control**: Track taxonomy changes and their impact

### Implementation

* **Template usage**: Use templates to ensure consistent taxonomy application
* **Validation**: Consider implementing validation to ensure proper taxonomy usage
* **Monitoring**: Track taxonomy usage to identify patterns and opportunities for improvement

## Standards Enforcement

### Code Review Checklist

* [ ] All logs use appropriate Category/Type/Area combinations
* [ ] Custom taxonomy values are documented and justified
* [ ] Templates are used consistently for taxonomy application
* [ ] No ad-hoc string values are used for classification

### Automated Validation

```apex
// Example validation utility
public class TaxonomyValidator {
    public static void validateLogTaxonomy(TritonBuilder builder) {
        // Validate category
        if (builder.getCategory() == null) {
            throw new IllegalArgumentException('Category must be specified');
        }
        
        // Validate type
        if (builder.getType() == null) {
            throw new IllegalArgumentException('Type must be specified');
        }
        
        // Validate area
        if (builder.getArea() == null) {
            throw new IllegalArgumentException('Area must be specified');
        }
        
        // Validate custom combinations
        validateCustomCombinations(builder);
    }
    
    private static void validateCustomCombinations(TritonBuilder builder) {
        // Add org-specific validation rules
        if (builder.getCategory() == TritonTypes.Category.Integration && 
            builder.getType() == TritonTypes.Type.Backend) {
            // Integration backend operations should have specific area
            if (builder.getArea() == null) {
                throw new IllegalArgumentException('Integration operations must specify area');
            }
        }
    }
}
```

## Taxonomy Mapping

### Business Process Mapping

Map your business processes to taxonomy:

| Business Process   | Category    | Type             | Area              |
| ------------------ | ----------- | ---------------- | ----------------- |
| Lead Conversion    | Apex        | Backend          | LeadConversion    |
| Payment Processing | Integration | Backend          | PaymentProcessing |
| Customer Portal    | LWC         | Frontend         | Community         |
| Order Fulfillment  | Flow        | AutolaunchedFlow | OrderProcessing   |
| Data Sync          | Apex        | Backend          | Integration       |

### Technology Mapping

Map technologies to taxonomy:

| Technology           | Category        | Type     | Common Areas                   |
| -------------------- | --------------- | -------- | ------------------------------ |
| Apex Triggers        | Apex            | Backend  | Accounts, Opportunities, Leads |
| Lightning Components | LWC             | Frontend | Community, UserInterface       |
| Process Builder      | Process Builder | Backend  | Workflow, Notifications        |
| REST APIs            | Integration     | Backend  | ExternalAPI, DataSync          |
| Scheduled Jobs       | Apex            | Backend  | Maintenance, DataProcessing    |

## Custom Taxonomy Development

### When to Extend

* **New business domains**: When entering new markets or business areas
* **Technology changes**: When adopting new Salesforce technologies
* **Process evolution**: When business processes change significantly
* **Compliance requirements**: When new regulatory requirements emerge

### Extension Process

1. **Identify need**: Document why new taxonomy is required
2. **Design structure**: Plan the new taxonomy values and relationships
3. **Review and approve**: Get stakeholder approval for taxonomy changes
4. **Implement**: Add new taxonomy values to code
5. **Document**: Update documentation and training materials
6. **Monitor**: Track usage and effectiveness of new taxonomy

### Example Extension

```apex
// Adding healthcare-specific taxonomy
public class HealthcareTritonTypes extends TritonTypes {
    public enum HealthcareArea {
        PatientManagement,
        AppointmentScheduling,
        MedicalRecords,
        Billing,
        Insurance,
        Compliance
    }
    
    public enum HealthcareType {
        ClinicalWorkflow,
        RegulatoryReporting,
        PatientPortal,
        InsuranceIntegration,
        ComplianceAudit
    }
}
```

## Taxonomy Governance

### Ownership

* **Central team**: Establish a central team responsible for taxonomy governance
* **Stakeholder input**: Include representatives from all major business areas
* **Regular reviews**: Schedule periodic reviews of taxonomy effectiveness
* **Change management**: Establish process for taxonomy changes

### Documentation

* **Taxonomy guide**: Maintain comprehensive documentation of all taxonomy values
* **Usage examples**: Provide examples of proper taxonomy usage
* **Best practices**: Document taxonomy best practices and anti-patterns
* **Training materials**: Create training materials for new team members

### Monitoring

* **Usage tracking**: Monitor how taxonomy is being used across the org
* **Effectiveness metrics**: Measure the effectiveness of taxonomy for filtering and analysis
* **Feedback collection**: Gather feedback from users about taxonomy effectiveness
* **Continuous improvement**: Use metrics and feedback to improve taxonomy

By establishing and maintaining a consistent taxonomy, you'll enable powerful log analysis, filtering, and correlation capabilities that provide lasting value for your organization.
