IBM Support

WorkComplete setting does not work for Parent activities

Technote (FAQ)


How to force the parent activity's WorkComplete property automatically updated when changes occur in its child activities?


Calculating the WorkComplete value of a parent activity is highly dependent on the application requirements.
For instance, you can decide that it should be the minimum of all the child's WorkComplete value. But in an other situation, you can decide that it should be the average value of the child WorkComplete, or even if some child tasks are more important than others, some ponderated values.
With that in mind, the WorkComplete behavior has not been implemented for the parent activities, which by default will remain at 0 regardless of children activities WorkComplete.


To change this default behavior and automatically calculate the parent activity's WorkComplete each time one child WorkComplete is updated, you can listen to ActivitiesChanged events.

The code below demonstrates how to set the parent activity's WorkComplete value to the minimum value of all its child's WorkComplete :

this.simpleGanttModel1.ActivitiesChanged += new

private void simpleGanttModel1_ActivitiesChanged(object sender,
ILOG.Views.Gantt.Data.ActivitiesChangeEventArgs e)
float minWorkComplete=100;
IActivity parent = e.Activity.Parent;
IEnumerator enu = parent.ChildActivities.GetEnumerator();
if(((IActivity)enu.Current).WorkComplete <= minWorkComplete)
minWorkComplete = ((IActivity)enu.Current).WorkComplete;
parent.WorkComplete=minWorkComplete ;


The above code will work fine with activities such as SimpleActivity.

If you are using SchedulingActivity and ProjectSchedulingModel, the WorkComplete value for the parent activity is set to 0, and cannot be modified.

Document information

More support for: IBM ILOG Gantt for .NET

Software version: 3.5, 4.0

Operating system(s): Windows

Reference #: 1587076

Modified date: 17 July 2012