A schedule read by MpxjEx.read/2.
:properties- project level attributes (:project_title,:start_date,:author,:minutes_per_day, ...), keyed by MPXJ field name:tasks- every task, in outline order (parents before their children):resources,:assignments,:calendars:relations- every task dependency:custom_fields- aliases given to custom fields, such astext1named "Role":user_defined_fields- fields defined by the file (Primavera UDFs, ...):extra- anything else MPXJ wrote (activity codes, currencies, work contours, ...) as decoded JSON
Entities reference each other by unique id. Since Elixir data can't hold cyclic references, use the functions in this module to navigate:
project = MpxjEx.read!("plan.mpp")
for task <- MpxjEx.Project.root_tasks(project),
child <- MpxjEx.Project.children(project, task) do
{task.name, child.name}
endFunctions taking a task, resource or calendar also accept its unique id.
Summary
Functions
The direct children of a task, in outline order.
The project's default calendar.
The alias given to a custom field, such as "Role" for field_alias(project, :resource, :text1).
Finds a calendar by unique id.
Finds a resource by unique id.
Finds a resource by id.
Finds a task by unique id.
Finds a task by id (the row number shown in MS Project).
The parent of a task, or nil for a top level task.
Tasks that a task depends on. See MpxjEx.Task :predecessors for the
dependency type and lag.
The task assignments of a resource.
Top level tasks: those without a parent.
Tasks that depend on a task.
The resource assignments of a task.
The resources assigned to a task.
The task hierarchy as nested maps
Types
@type t() :: %MpxjEx.Project{ assignments: [MpxjEx.Assignment.t()], calendars: [MpxjEx.Calendar.t()], custom_fields: [map()], extra: map(), index: term(), properties: map(), relations: [MpxjEx.Relation.t()], resources: [MpxjEx.Resource.t()], tasks: [MpxjEx.Task.t()], user_defined_fields: [map()] }
@type tree() :: [%{task: MpxjEx.Task.t(), children: tree()}]
Functions
@spec children(t(), MpxjEx.Task.t() | integer()) :: [MpxjEx.Task.t()]
The direct children of a task, in outline order.
@spec default_calendar(t()) :: MpxjEx.Calendar.t() | nil
The project's default calendar.
The alias given to a custom field, such as "Role" for field_alias(project, :resource, :text1).
@spec get_calendar(t(), integer()) :: MpxjEx.Calendar.t() | nil
Finds a calendar by unique id.
@spec get_resource(t(), integer()) :: MpxjEx.Resource.t() | nil
Finds a resource by unique id.
@spec get_resource_by_id(t(), integer()) :: MpxjEx.Resource.t() | nil
Finds a resource by id.
@spec get_task(t(), integer()) :: MpxjEx.Task.t() | nil
Finds a task by unique id.
@spec get_task_by_id(t(), integer()) :: MpxjEx.Task.t() | nil
Finds a task by id (the row number shown in MS Project).
@spec parent(t(), MpxjEx.Task.t() | integer()) :: MpxjEx.Task.t() | nil
The parent of a task, or nil for a top level task.
@spec predecessors(t(), MpxjEx.Task.t() | integer()) :: [MpxjEx.Task.t()]
Tasks that a task depends on. See MpxjEx.Task :predecessors for the
dependency type and lag.
@spec resource_assignments(t(), MpxjEx.Resource.t() | integer()) :: [ MpxjEx.Assignment.t() ]
The task assignments of a resource.
@spec root_tasks(t()) :: [MpxjEx.Task.t()]
Top level tasks: those without a parent.
Microsoft Project files have a single root, the project summary task (unique id 0), whose children are the tasks at outline level 1.
@spec successors(t(), MpxjEx.Task.t() | integer()) :: [MpxjEx.Task.t()]
Tasks that depend on a task.
@spec task_assignments(t(), MpxjEx.Task.t() | integer()) :: [MpxjEx.Assignment.t()]
The resource assignments of a task.
@spec task_resources(t(), MpxjEx.Task.t() | integer()) :: [MpxjEx.Resource.t()]
The resources assigned to a task.
The task hierarchy as nested maps:
[%{task: %MpxjEx.Task{}, children: [%{task: %MpxjEx.Task{}, children: []}]}]