ChangeEffects#
The side effects of an applied change set: records removed by a cascade, ids the engine generated, and links or assignments that became inactive. Read it from ApplyReport::effects, returned by Project::apply, to keep your own copy of the data in sync with the project.
Declaration#
With the serde feature, ChangeEffects implements Serialize and Deserialize, with camelCase field names (removedTasks, generatedLinks, ...).
Every list holds ids from applied operations only. A rejected operation adds nothing. Ids appear in the order the operations ran. All lists are empty when the change set had no such effect.
Fields#
| Field | Type | Description |
|---|---|---|
removed_tasks |
Vec<Id> |
Tasks deleted from the project. |
removed_links |
Vec<Id> |
Links deleted from the project. |
generated_links |
Vec<Id> |
Ids the engine assigned to added links that had no id. |
dropped_links |
Vec<Id> |
Links that became inactive. |
removed_assignments |
Vec<Id> |
Assignments deleted from the project. |
generated_assignments |
Vec<Id> |
Ids the engine assigned to added assignments that had no id. |
dropped_assignments |
Vec<Id> |
Assignments that became inactive. |
removed_tasks#
pub removed_tasks:
Each task named in tasks.remove, followed by all of its descendants, which are removed with it.
removed_links#
pub removed_links:
Links named in links.remove, and links removed because their source or target task was removed.
generated_links#
pub generated_links:
Ids of added links whose LinkAdd::id was None. A generated id has the form $generated_link_1, $generated_link_2, and so on. Use it to update or remove the link later.
dropped_links#
pub dropped_links:
Links that are still in the project but became inactive because of this change set. Links that were already inactive aren't listed. For the cases that drop a link, see LinkData.
removed_assignments#
pub removed_assignments:
Assignments named in assignments.remove, and assignments removed because their task or resource was removed. A cascaded assignment that has no id isn't listed.
generated_assignments#
pub generated_assignments:
Ids of added assignments that had no id. A generated id has the form $generated_assignment_1, $generated_assignment_2, and so on.
dropped_assignments#
pub dropped_assignments:
Assignments that are still in the project but became inactive because of this change set. Assignments that were already inactive aren't listed. For the cases that drop an assignment, see AssignmentData::task.
Example#
Remove task 1, which takes link 10 with it, and add a link without an id:
use ;
Related#
ApplyReport- carries the effects ineffectsSchedulingChanges- the change set whose operations cause these effectsLinkAdd- an added link without an id gets a generated one here- Data Updates - shows how to keep a local copy in sync after
apply