## Overview

The Cleanup Config Table widget displays cleanup job configurations for the Enterprise Connectivity Foundation (ECF). It shows all cleanup configurations associated with a specific connector, enabling administrators to manage automated cleanup schedules for synchronized data.

The widget automatically filters cleanup configurations to show only those belonging to the connector page it's embedded in, providing a focused view of cleanup policies for that specific integration.

## Use Cases

### Managing Automated Cleanup Schedules

Configure when and how often cleanup jobs run for synchronized data. The widget displays all cleanup configurations in one place, allowing users to create, view, and modify schedules using cron expressions. Default schedule runs every 10 minutes, but can be adjusted based on data volume and cleanup requirements.

### Configuring Orphaned Entity Deletion

When source entities are deleted in an external system, corresponding target entities in cplace become "orphaned". The widget enables configuration of automatic deletion for these orphaned entities with a configurable delay (in days) that prevents premature deletion and allows time for recovery or investigation.

### Associating Cleanup with Synchronization Configurations

Each cleanup job can target specific synchronization configurations, allowing granular control over which entity types or sync flows are cleaned up. The widget ensures validation so that sync configurations aren't duplicated across multiple cleanup jobs, preventing conflicting cleanup policies.

## Design Considerations

### When to Use This Widget

- Setting up a new ECF connector and defining initial cleanup policies
- Managing existing cleanup schedules for synchronized data
- Troubleshooting orphaned entities in a synchronization setup
- Adjusting cleanup timing or enabling/disabling cleanup jobs

### Embedding Context

This widget can only be embedded on Connector pages or Connector type definitions. It is typically part of a three-tab layout structure:

- **Servers tab**: Server connection configurations
- **Synchronization tab**: Synchronization configurations
- **Cleanup tab**: Cleanup job configurations (this widget)

The widget is usually displayed in a master-detail pattern with a connected attributes group showing detailed configuration of the selected cleanup job.

### Configuration Elements

Cleanup jobs are controlled by several key attributes:

- **Enabled**: Boolean toggle to activate/deactivate cleanup execution
- **Cron Expression**: Schedule definition (default: every 10 minutes)
- **Synchronization Configurations**: Target sync configs for cleanup
- **Delete Orphaned Target Entities**: Enable automatic orphan deletion
- **Delete After Days**: Grace period before orphaned entities are removed

## Common Pitfalls

- Setting a cleanup schedule that's too frequent can impact system performance, especially for large datasets
- Enabling orphaned entity deletion without an adequate grace period may result in unintended data loss
- Forgetting to enable cleanup jobs after configuration leaves them inactive
- Attempting to reference the same sync configuration in multiple cleanup jobs triggers validation errors

## Related Patterns

- **Server Connection Table Widget** - Manages server connections for the same connector
- **Connector Sync Configs Table Widget** - Displays synchronization configurations that cleanup jobs reference
- **Connected Attributes Group** - Typically used alongside this widget to show detailed configuration
