Skip to content

@eightkk/vue-weave / core / buildPlacementInput

Function: buildPlacementInput() ​

buildPlacementInput<I>(input, placedTaskIds): PlacementResult<I>

Defined in: src/core/placement.ts:110

Build a computable schedule input for the placed tasks only. Unplaced tasks keep no invented dates: they, their links and their assignments are left out of the input. A link from an unplaced task to a placed one is reported as an unplaced-predecessor diagnostic and makes the result not ok, instead of the scheduler throwing or the link being dropped silently. A link from a placed task to an unplaced one is only excluded. So is a link that the scheduler ignores anyway: one that touches an inactive task, or one into a placed task with manual dates.

Summary tasks (parentId): leaving out an unplaced summary keeps what binds its placed subtasks. A placed task whose parentId names an unplaced task gets the ID of its nearest placed ancestor instead, or none at the top; the startNoEarlierThan and finishNoLaterThan of the unplaced ancestors it skips become its own when they are tighter, and a placed task that one of them makes inactive gets inactive: true. An FS or SS link into an unplaced summary binds its placed active leaf subtasks: from a placed task it is replaced by one link per leaf (see retargetedDependencies), from an unplaced task it is an unplaced-predecessor diagnostic per leaf. A link from an unplaced summary is a link from an unplaced task. Inactive means inactive as the scheduler sees it, including tasks below an inactive summary and summaries without an active leaf.

A placed summary task that is active in the full plan but has no placed active leaf subtask has nothing placed to span. It is reported as an unplaced-subtasks diagnostic, which makes the result not ok, and is then treated as an unplaced summary: it, its links and its assignments are left out (it is not listed in unplacedTaskIds), its placed subtasks move up and take over its bounds, and a link from it is an unplaced-predecessor diagnostic.

Malformed input still throws an Error: duplicate or empty task, link or placed IDs, a placed ID or a link or assignment endpoint that is not an input task, and duplicate assignments. An input with parentId must also meet the scheduler's summary task rules whether or not the tasks concerned are placed, with the scheduler's errors: valid and known parent IDs without cycles, no fixedStart, startNoLaterThan, finishNoEarlierThan, manual or mode: 'alap' on a summary, no link between a summary and its own subtask, and no FF or SF link into a summary. The input is not modified.

Type Parameters ​

I ​

I extends PlacementInput

Parameters ​

input ​

I

placedTaskIds ​

Iterable<string>

Returns ​

PlacementResult<I>

Released under the MIT License.