# `MpxjEx.Task`
[🔗](https://github.com/rocket4ce/mpxj_ex/blob/v0.1.0/lib/mpxj_ex/task.ex#L1)

A task (activity) in a schedule.

The most commonly used attributes are struct fields. Every attribute MPXJ
read from the file, including those, is also in `:fields`, keyed by MPXJ's
field name in lower case (`:baseline_cost`, `:text1`, `:early_start`, ...).
User defined fields keep their name as a string key. Attributes the file
doesn't set are absent from `:fields`; MPXJ also omits zero numbers.

Dates are `NaiveDateTime`s, and durations and work are numbers in the
`:time_units` passed to `MpxjEx.read/2` (seconds by default).

Tasks reference each other by unique id; use `MpxjEx.Project` to navigate
the hierarchy and dependencies.

# `t`

```elixir
@type t() :: %MpxjEx.Task{
  active: boolean(),
  actual_duration: number() | nil,
  actual_finish: NaiveDateTime.t() | nil,
  actual_start: NaiveDateTime.t() | nil,
  baseline_duration: number() | nil,
  baseline_finish: NaiveDateTime.t() | nil,
  baseline_start: NaiveDateTime.t() | nil,
  calendar_unique_id: integer() | nil,
  constraint_date: NaiveDateTime.t() | nil,
  constraint_type: atom() | nil,
  cost: float() | nil,
  critical: boolean(),
  duration: number() | nil,
  fields: map(),
  finish: NaiveDateTime.t() | nil,
  guid: String.t() | nil,
  id: integer() | nil,
  milestone: boolean(),
  name: String.t() | nil,
  notes: String.t() | nil,
  outline_level: integer() | nil,
  outline_number: String.t() | nil,
  parent_task_unique_id: integer() | nil,
  percent_complete: float() | nil,
  predecessors: [MpxjEx.Relation.t()],
  priority: integer() | nil,
  remaining_duration: number() | nil,
  start: NaiveDateTime.t() | nil,
  successors: [MpxjEx.Relation.t()],
  summary: boolean(),
  unique_id: integer(),
  wbs: String.t() | nil,
  work: number() | nil
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
