v7.3.0
SupportExamplesFree Trial

Inactive tasks

Introduction

A task has a special boolean field that makes it inactive. It allows user to keep certain tasks in the project plan while disabling their effect on the scheduling. Helpful for example when using a common project pattern for multiple cases so tasks not needed in some individual project can be deactivated while keeping the project's general structure.

Inactive tasks are excluded from the scheduling process so they cannot affect regular active tasks. They don't push their active successors (but still push inactive ones) and don't roll up their attributes (startDate, endDate, percentDone and effort) to their active parents (but still do that for inactive ones).

Activating or deactivating a summary task also toggles the state of all its children. Activating a child task in turn activates its summary tasks and deactivating all child tasks also deactivates their summary task.

Inactive tasks do not affect resource allocation and thus aren't taken into account by the resource histogram.

Visual representation of inactive tasks

The Gantt displays the tasks strike-out in the left part of the grid and gray colored in the time axis part.

const project = new ProjectModel({ startDate : '2020-01-02', events : [ { id : 1, name : 'Setup web-server', inactive : false, expanded : true, children : [ { id : 2, name : 'Install Apache', startDate : '2020-01-02', duration : 2, inactive : true }, { id : 3, name : 'Configure firewall', startDate : '2020-01-09', duration : 3, inactive : false }, { id : 4, name : 'Setup load balancer', startDate : '2020-01-02', duration : 3, inactive : true }, { id : 5, name : 'Configure ports', startDate : '2020-01-02', duration : 2, inactive : true }, { id : 6, name : 'Run tests', startDate : '2020-01-09', duration : 2, inactive : false } ] } ], dependencies : [ { id : 2, from : 2, to : 6 }, { id : 3, from : 3, to : 6 }, { id : 4, from : 4, to : 6 }, { id : 5, from : 5, to : 6 } ] }); const gantt = new Gantt({ appendTo : targetElement, project, startDate : new Date(2019, 11, 31), endDate : new Date(2020, 0, 11), height : 360, columns : [ { type : 'name' }, { type : 'startdate' }, { type : 'inactive' } ] });

Turning a task into inactive

To make a task inactive on the data level, set its inactive field:

// make the task inactive
task.inactive = true

Or use the setInactive method:

// make the task inactive and wait till rescheduling is done
await task.setInactive(true)

/* here rescheduling is done */

On the user interface level it can be done with the Inactive column:

or with the Inactive checkbox in the task editor Advanced tab:

Critical paths feature

Inactive tasks naturally cannot be a part of any critical path so they are never highlighted by that feature.

const project = new ProjectModel({ startDate : '2020-01-02', events : [ { id : 1, name : 'Website design', inactive : false, expanded : true, children : [ { id : 2, name : 'Contact designers', startDate : '2020-01-02', duration : 2, inactive : false }, { id : 3, name : 'Create shortlist of three designers', startDate : '2020-01-09', duration : 3, inactive : false }, { id : 4, name : 'Select & review final design', startDate : '2020-01-02', duration : 3, inactive : true }, { id : 5, name : 'Inform management', startDate : '2020-01-02', duration : 2, inactive : false }, { id : 6, name : 'Apply design to website', startDate : '2020-01-09', duration : 2, inactive : false } ] } ], dependencies : [ { id : 2, from : 2, to : 3 }, { id : 3, from : 3, to : 4 }, { id : 4, from : 4, to : 5 }, { id : 5, from : 5, to : 6 } ] }); const gantt = new Gantt({ appendTo : targetElement, project, startDate : new Date(2019, 11, 31), endDate : new Date(2020, 0, 11), height : 360, features : { // Enable critical paths feature criticalPaths : { disabled : false } }, columns : [ { type : 'name' }, { type : 'startdate' }, { type : 'inactive' } ] });

Rollups feature

Inactive task bars are not displayed on their active parent tasks when using the rollup feature. But inactive task bars are displayed on their inactive parent tasks.

const project = new ProjectModel({ startDate : '2020-01-02', events : [ { id : 1000, name : 'Launch SaaS Product', inactive : false, expanded : true, children : [ { id : 1, name : 'Setup web-server', constraintType : 'startnoearlierthan', constraintDate : '2020-01-05', inactive : true, expanded : true, children : [ { id : 2, name : 'Install Apache', startDate : '2020-01-02', duration : 1, inactive : true, rollup : true }, { id : 3, name : 'Configure firewall', startDate : '2020-01-09', duration : 2, inactive : true, rollup : true }, { id : 4, name : 'Setup load balancer', startDate : '2020-01-02', duration : 2, inactive : true, rollup : true }, { id : 5, name : 'Configure ports', startDate : '2020-01-02', duration : 1, inactive : true, rollup : true }, { id : 6, name : 'Run tests', startDate : '2020-01-08', duration : 1, inactive : true, rollup : true, manuallyScheduled : true } ] }, { id : 7, name : 'New Task', startDate : '2020-01-02', duration : 2, inactive : false, rollup : true } ] } ], dependencies : [ { id : 2, from : 2, to : 6 }, { id : 3, from : 3, to : 6 }, { id : 4, from : 4, to : 6 }, { id : 5, from : 5, to : 6 } ] }); const gantt = new Gantt({ appendTo : targetElement, project, startDate : new Date(2019, 11, 31), endDate : new Date(2020, 0, 11), height : 440, features : { // Enable rollups feature rollups : { disabled : false } }, columns : [ { type : 'name' }, { type : 'inactive' } ] });

Progress line feature

The feature treats inactive tasks as not started and draws the progress line respectively (line is rendered at statusDate for not started tasks).

const project = new ProjectModel({ startDate : '2020-01-02', events : [ { id : 1000, name : 'Launch SaaS Product', inactive : false, expanded : true, children : [ { id : 1, name : 'Setup web-server', constraintType : 'startnoearlierthan', constraintDate : '2020-01-05', inactive : false, expanded : true, children : [ { id : 2, name : 'Install Apache', startDate : '2020-01-02', percentDone : 50, duration : 1, inactive : true, rollup : true }, { id : 3, name : 'Configure firewall', startDate : '2020-01-09', percentDone : 50, duration : 2, inactive : false, rollup : true }, { id : 4, name : 'Setup load balancer', startDate : '2020-01-02', percentDone : 50, duration : 2, inactive : true, rollup : true }, { id : 5, name : 'Configure ports', startDate : '2020-01-02', percentDone : 50, duration : 1, inactive : true, rollup : true }, { id : 6, name : 'Run tests', startDate : '2020-01-08', percentDone : 50, duration : 1, inactive : true, rollup : true, manuallyScheduled : true } ] }, { id : 7, name : 'New Task', startDate : '2020-01-02', percentDone : 50, duration : 2, inactive : false, rollup : true } ] } ], dependencies : [ { id : 2, from : 2, to : 6 }, { id : 3, from : 3, to : 6 }, { id : 4, from : 4, to : 6 }, { id : 5, from : 5, to : 6 } ] }); const gantt = new Gantt({ appendTo : targetElement, project, startDate : new Date(2019, 11, 31), endDate : new Date(2020, 0, 11), height : 440, features : { // Enable Progress Line feature progressLine : { statusDate : new Date(2020, 0, 10), disabled : false } }, columns : [ { type : 'name' }, { type : 'inactive' } ] });

Contents