7.1.2 Tasks Objects
Tasks attributes are entered as local variables inside
the function hierachy of the project tree. Beside
the standard attributes described below, you can define
as many custom attributes as you like.
Tasks usually inherit their attributes by their parent, i.e. if
you define an attribute for an parent task, all tasks below
this parent, have the same attribute value, until one child
redefines the attribute. This inheritance rule does not apply
to the attributes effort,duration, length.
For each attribute you can specify multiple values to distinguish
several scenarios. This is done by assigning a dictionary to
an attribute. The keys of that dictionary are the scenario names.
The default scenario is called "_default"
and acts as fallback
value, when you didn't assign a value for a special scenario.
This "_default"
scenario must always be specified. For convenience
use the function Multi which
is equivalent to dict(_default=arg1, ...)
.
Inside a task definition you can define the special function
__constraint__. Within this function you can specify
several conditions a task must satisfy, otherwise a warning will
be issued.
Instances of Task can be used as iterators
, to step
recursivly through the hierachy of all children.
The following example demonstrate how to enter tasks and their
attributes:
1 def Parent_Task():
2 start = "2005/1/1" # available for all children
3 description = """This is a custom attribute, describing the task.
4 it can be used, for a documentation generator"""
5
6 rate = 100
7
8 def Child_Task1():
9 effort = "2d"
10 #attribute start is inherited by parent
11 #attribute end is calaculated from start and effort
12
13 #rate of Child_Task1 is 100 (inherited by Parent_Task)
14
15 def __constraint__():
16 assert_(me.end <= "2005/1/4")
17 #issue a warning if the end of Child_Task1
18 #is later than 2005/1/4
19
20
21 def Child_Task2():
22 start = up.Child_Task1.end #overriding start
23 effort = Multi("1d", worst_case="2d")
24 #there is an other effort value for a worst_case scenario
25 #attribute end is calaculated from start and effort
26
27 #rate of Child_Task1 is 100 (inherited by Parent_Task)
28
29
30 def Child_Task3():
31 start = up.Child_Task2.end #overriding start
32 effort = "3d"
33 rate = 300
34
35
36 Simple_Project = Project(Parent_Task)
- start
-
The start date of the task. Valid values are expressions and strings
specifing a datatime
(see 2.1.2).
- end
-
The end date of the task. Valid values are expressions and strings
(see 2.1.2).
- effort
-
Specifies the effort needed to complete the task. Valid values are
expressions and strings (see 2.1.3).
- length
-
Specifies the time the task occupies the resources. This is working
time, not calendar time. 7d means 7 working days, not one
week. Whether a day is considered a working day or not depends on the
defined working hours and global vacations.
- duration
-
Specifies the time the task occupies the resources. This is calendar
time, not working time. 7d means one week.
- buffer
-
Specifies the time a task can be delayed, without moving dependend
milestones. A Task with a buffer
0d is part of the critical
chain. This attribute is readonly.
- complete
-
Specifies what percentage of the task is already completed.
- todo
-
Specifies the effort, which needs to be done to complete
a task. This is another (indirect) way to specify the complete
attribute.
- done
-
Specifies the work effort, which has been already done.
This attribute is readonly.
- performed
-
Specifies a list of actual working times performed on the task.
The format is:
[ (resource, from, to, time), ... ]
- performed_work_time
-
Specifies the sum of all working times. This attribute is readonly.
- performed_effort
-
Specifies the complete effort all working times. This attribute is readonly.
- performed_start
-
- performed_end
-
- balance
-
Specifies the resource allocation type. Possible values are
STRICT, SLOPPY, SMART.
For more infos see .
- resource
-
Specifies the possible resources, that may be allocated for the task.
- booked_resource
-
Specifies the allocated resources of a task. This attribute is readonly.
- load
-
Specifies the daily load of a resource for an allocation of
the specified task.
A load of 1.0 (default) means the resource is allocated for as many hours as
specified by working_hours_per_day. A load of 0.5 means half that many
hours.
- max_load
-
Specify the maximal allowed load sum of all simultaneously
allocated tasks of a resource. A max_load
of 1.0 (default) means the resource may be fully allocated. A max_load
of 1.3 means the resource may be allocated with 30% overtime.
- efficiency
-
The efficiency of a resource can be used for two purposes. First you
can use it as a crude way to model a team. A team of 5 people should
have an efficiency of 5.0. Keep in mind that you cannot track the
member of the team individually if you use this feature. The other use
is to model performance variations between your resources.
- milestone
-
Specifies if the task is a milstone. The only possible value is
True
.
A milestone has always an effort of 0d.
- priority
-
Specifies a priority between 1 and 1000. A task with higher priority
is more likely to get the requested resources. The default priority is 500.
- children
-
Specifies a list of all subtasks.
A task without children is called a leaf task
otherwise it is called a parent task.
This attribute is readonly.
- depth
-
Specifies the depth of the task within the hierachy.
This attribute is readonly.
- index
-
Specifies a structural index number. This attribute is readonly.
- path
-
Specifies the path. (See also 2.2.1)
- copy_src
-
Specifies the path to an other task.
When you set this attribute, all attributes (except of start and end)
of copy_src will be copied to the current task. This is usefull if you want
to define the same task, in diffent project definitions. It acts like a task link.
- dont_inherit
-
A list of attribute names, which will be not inherited by subtasks.
-
This method returns and indented name of the task and is
a synonym for
indent * task.depth + task.name
.
-
This method calculates recursivly the sum of a any numerical attribute of
all leaf sub tasks. attrib_name is a string and specifies the name
of the attribute. You have to make sure, that every leaf task specfies that
attribute. Be aware that sub tasks inherit attribute by their parents.
-
This method is like sum but calculates the maximum. The value
of the attribute specified by attrib_name my be any compareable type.
-
This method is like sum but calculates the minimum. The value
of the attribute specified by attrib_name my be any compareable type.
-
This method calculates recursivly the total resource costs of a
task. cost_name is a string and can be the name of any numerical attribute
of the allocated resources. You have to make sure, that every resource specfies that
attribute. Faces assumes that the value of cost_name is the daily cost rate.
(see also 2.5).
is_inherited( |
attrib_name) |
-
This method returns True if the task inherits the value of the attribute
specified by attrib_name.
add_attribute( |
name, attrib) |
-
This method adds dynamically an attrib or sub task.
name is the attribute name, attrib is the attribute
value or task definition. It is only available within
a task definition.
Release 0.11.4, documentation updated on April 25, 2007.