Finding the best way to enforce the logic implied by Gantt Chart constraints

Article ID: 2215
Last updated: 29 May, 2018
Article ID: 2215
Last updated: 29 May, 2018
Revision: 3
Views: 749
Posted: 23 Jun, 2010
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

What is the best way to enforce the logic implied by Gantt Chart constraints?

Answer

When a constraint is in place, many users want to "enforce" the logic they imply. For example, if there is an end-to-start constraint between two activities and the user moves the end of the from-activity past the beginning of the to-activity, the to-activity should move to the right.

The best way to do this is in the constraint itself. The attached code defines an enforced end-to-start constraint and factory. You use the new constraint by calling setConstraintFactory(new IlvEnd2StartFactory()) on the Gantt chart.

The constraint class implements ActivityListener, so that it can react to changes in activities in the Gantt data model. The attached code is designed to be reused quite easily. It defines a generic abstract class called IlvEnforcedConstraint. You can extend this to define types of constraint other than the one provided (end-to-start).

The complete source is provided in this file: enforcedconstraint.zip.

Download and extract the file. Then read the html file it contains, enforcedconstraint.html.

Note: A basic form of Critical Path Analysis has been introduced starting from JViews Gantt 7.5. This reschedules all activities in the Gantt data model to occur as soon as possible after the project start time, while taking into account constraints between activities. This feature can either be performed manually upon request (see IlvCriticalPathCalculator) or automatically as the activities in the schedule change (see IlvGanttModelScheduler).

For more information about this feature, refer to the following section: Developing with the SDK > Critical Path Analysis

The associated sample can be found from the Samples section of the documentation and is located here: JVIEWS_GANTT_HOME/samples/criticalPath.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2215
Last updated: 29 May, 2018
Revision: 3
Views: 749
Posted: 23 Jun, 2010 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category