xerparser.model.predecessors
Classes
Collection of TASKPRED relationship records. |
Module Contents
- class xerparser.model.predecessors.Predecessors[source]
Collection of TASKPRED relationship records.
Editing API:
add_relationship(),remove_relationship()andreplace_relationship()modify the collection in place; a subsequentwriteXERwrites the edited relationships back.- find_by_id(code_id) xerparser.model.classes.taskpred.TaskPred[source]
- add_relationship(task_id, pred_task_id, pred_type='PR_FS', lag_hr_cnt=None, comments=None, proj_id=None, pred_proj_id=None, tasks=None)[source]
Add a relationship and return the new TaskPred.
- Parameters:
task_id – id of the successor activity.
pred_task_id – id of the predecessor activity.
pred_type – one of PR_FS, PR_SS, PR_FF, PR_SF (default PR_FS).
lag_hr_cnt – lag in hours; negative for leads. Optional.
comments – optional comment text.
proj_id – project of the successor; derived from the task when a Tasks collection is available (the Reader wires one).
pred_proj_id – project of the predecessor. Defaults to
proj_id; set it explicitly for cross-project links.tasks – Tasks collection used for validation/project lookup. Optional when the Reader wired one automatically.
- Returns:
The appended TaskPred relationship.
- Raises:
ValueError – on an unknown pred_type, non-numeric lag, unknown task, duplicate relationship, or missing project context.
- remove_relationship(rel)[source]
Remove a relationship (TaskPred instance or task_pred_id).
- Raises:
ValueError – if the relationship is not in this collection.
- replace_relationship(rel, task_id=None, pred_task_id=None, pred_type=None, lag_hr_cnt=None, comments=None, tasks=None)[source]
Atomically re-route a relationship.
Builds the replacement first (so validation failures leave the collection untouched), then swaps it for
rel(TaskPred instance or task_pred_id). Unspecified fields are inherited from the old relationship.
- property relations: List[xerparser.model.classes.taskpred.TaskPred][source]
- property finish_to_start: List[xerparser.model.classes.taskpred.TaskPred][source]
- get_successors(act_id) List[xerparser.model.classes.taskpred.TaskPred][source]
- get_predecessors(act_id) List[xerparser.model.classes.taskpred.TaskPred][source]