Expand description
Interchangeable parts (feature 6, see
docs/src/research/supersede-alternates.md):
- Alternates – item B may be built in instead of item A in every
assembly (
item_alternates, one row per direction; “two-way” stores both). Item-level, not revisioned. - Supersession – item A is superseded by B: do not use A for new
designs any more (
item_supersessions, at most one successor, no chain back to A). The lifecycle state of A does not change. - Replace in assemblies – a mass change on the where-used list of A:
every assembly whose latest revision is in work and not checked out by
somebody else gets B instead of A (quantity, find number and notes
kept); released assemblies and assemblies in review are listed as
needing a new revision.
plan_replaceis the preview,replaceapplies exactly the same plan under row locks.
Items in groups the actor may not read are left out (and counted where a list is about usages of the actor’s item).
Structs§
- Linked
Item - An item linked to another one as alternate, successor or predecessor, with the data of its latest revision.
- NewAlternate
- Replace
Plan - The preview (or, after
replace, the outcome) of a replacement. - Replace
Row - One BOM line of the latest revision of an assembly that uses the item.
Enums§
- Replace
Action - What
replacedoes with one BOM line.
Functions§
- add_
alternate - Declares
input.numberan alternate ofitem_id. - alternate_
for - Items for which
item_idis a one-way alternate (the two-way ones are already inalternates). - alternates
- Items that may be used instead of
item_id(only those the actor may read). - clear_
supersession - Withdraws the supersession of
item_id. - plan_
replace - Preview: what
replacewould do with every assembly usingold_item_id. - predecessors
- Items that
item_idsupersedes (only those the actor may read). - remove_
alternate - Removes the alternate
alternate_item_idofitem_id– both directions when the actor may also edit the alternate’s group, otherwise only this one. Returns the number of directions removed. - replace
- Replaces
old_item_idbynew_numberin every assembly the plan marksReplaceAction::Replace, in one transaction. A revision that is not checked out is changed directly (like check out, edit, check in); one checked out by the actor stays checked out. Fails when nothing can be replaced. - successor
- The item that supersedes
item_id; a successor in a group the actor may not read is a placeholder (the item is still superseded). - supersede
- Declares
item_idsuperseded bysuccessor_number(replacing an earlier successor). - superseded_
among - Which of the given items are superseded: item id → number of the
successor (
Nonewhen the successor is in a group the actor may not read). For marking BOM lines.