# Timeline Process (cf.cplace.timelineProcess)

## Overview

The Timeline Process app enables easy configuration of processes and actions that are aligned relative to a certain target date. It provides a framework for defining process templates with date-relative actions, allowing users to create repeatable process workflows that automatically calculate action dates based on a central target date.

**Use Cases:**
- Product launch checklists with dates calculated from launch day
- Event preparation workflows with milestones relative to event date
- Compliance deadlines based on regulatory filing dates
- Project phase gates with relative timing
- Onboarding/offboarding processes based on start/end dates

## Dependencies

- `cf.cplace.platform` (cplace Basis) - Base platform, always installed

No additional app dependencies are auto-installed.

## Types Provided

### cf.cplace.timelineProcess.processDescription (Process)

The central type representing a process definition or instance. Acts as a container for actions and roles.

| Attribute | Internal Name | Type | Required | Multiple | Description |
|-----------|---------------|------|----------|----------|-------------|
| Target Date | `cf.cplace.timelineProcess.targetDate` | Date | No | No | The anchor date from which all action dates are calculated |
| Template | `cf.cplace.timelineProcess.isTemplate` | Boolean | Yes | No | Indicates if this is a template (for reuse) or an active process instance |

**Icon:** `fa-forward`

### cf.cplace.timelineProcess.action (Action)

Represents an individual action or task within a process. Actions are positioned relative to the process target date using an offset value.

| Attribute | Internal Name | Type | Required | Multiple | Description |
|-----------|---------------|------|----------|----------|-------------|
| Process | `cf.cplace.timelineProcess.process` | Reference (Process) | Yes | No | Parent process (hierarchy reference) |
| Role | `cf.cplace.timelineProcess.role` | Reference (Role) | Yes | Yes | Roles responsible for this action |
| Assignment | `cf.cplace.timelineProcess.assignment` | Reference (Person/Group) | No | Yes | Specific users or groups assigned |
| Offset | `cf.cplace.timelineProcess.offset` | Number (days) | Yes | No | Days before (-) or after (+) the target date |
| Date | `cf.cplace.timelineProcess.date` | Date | No | No | Calculated action date (Target Date + Offset) |
| Completed | `cf.cplace.timelineProcess.completed` | Boolean | Yes | No | Whether the action has been completed |

**Icon:** `fa-play-circle`

**Note:** The `Process` reference is a hierarchy reference, meaning Actions are displayed as children of their Process in the page tree.

### cf.cplace.timelineProcess.role (Role)

Defines roles that can be assigned to actions within a process. Roles abstract the responsibility from specific people, enabling template reuse.

| Attribute | Internal Name | Type | Required | Multiple | Description |
|-----------|---------------|------|----------|----------|-------------|
| Process | `cf.cplace.timelineProcess.process` | Reference (Process) | Yes | No | Parent process (hierarchy reference) |
| Assignment | `cf.cplace.timelineProcess.assignment` | Reference (Person/Group) | No | Yes | Default persons or groups for this role |

**Icon:** `fa-users`

**Note:** The `Process` reference is a hierarchy reference, meaning Roles are displayed as children of their Process in the page tree.

## Widgets Provided

This app does not provide any custom widgets.

## Data Model Relationships

```
Process (processDescription)
  |
  +-- Role (role) [via hierarchy reference]
  |     |
  |     +-- Assignment (Person/Group)
  |
  +-- Action (action) [via hierarchy reference]
        |
        +-- Role(s) [reference to role(s) within same process]
        +-- Assignment (Person/Group) [optional override]
```

## Usage Notes

### Template vs Instance Pattern

The app supports a template pattern:
1. Create a Process with `Template = true` containing standard Roles and Actions with offsets
2. When needed, copy the template Process and set `Template = false`
3. Set the `Target Date` on the new instance
4. Action dates are calculated as: `Action Date = Target Date + Offset`

### Offset Calculation

- **Positive offset**: Action is scheduled _after_ the target date (e.g., +7 = one week after)
- **Negative offset**: Action is scheduled _before_ the target date (e.g., -14 = two weeks before)
- **Zero offset**: Action is due on the target date itself

### Role-Based Assignment

Roles provide flexibility:
- Define roles once per process (e.g., "Project Manager", "Sponsor", "Team Lead")
- Assign default people to roles at the role level
- Actions reference roles, inheriting assignments
- Specific action assignments can override role defaults

### Common Patterns

1. **Launch Checklist**: Process with Target Date = Launch Date
   - Actions: "Final QA" (-7 days), "Marketing Review" (-3 days), "Go Live" (0 days), "Post-Launch Review" (+7 days)

2. **Event Planning**: Process with Target Date = Event Date
   - Actions: "Book Venue" (-60 days), "Send Invites" (-30 days), "Confirm Catering" (-7 days), "Event" (0 days)

3. **Compliance Workflow**: Process with Target Date = Filing Deadline
   - Actions: "Gather Documents" (-30 days), "Internal Review" (-14 days), "Legal Sign-off" (-7 days), "Submit Filing" (0 days)
