The TaskJuggler Manual | ||
---|---|---|
Prev | Chapter 4. Tutorial: Your First Project | Next |
A TaskJuggler feature that you will probably make heavy use of is flags. Once declared you can attach them to many properties. When you generate reports of the TaskJuggler results, you can use the flags to filter out information and limit the report to exactly those details that you want to have included.
flags team resource dev "Developers" { resource dev1 "Paul Smith" { rate 330.0 } resource dev2 "Sébastien Bono" resource dev3 "Klaus Müller" { vacation 2002-02-01 - 2002-02-05 } flags team } resource misc "The Others" { resource test "Peter Murphy" { limits { dailymax 6.4h } rate 240.0 } resource doc "Dim Sung" { rate 280.0 } flags team }
This snippet of the example shows the resource property. Resources always have an ID and a Name. IDs may only consist of the characters a to z, A to Z and the underscore. All but the first characters may be digits 0 to 9 as well. All global TaskJuggler properties have IDs. They need to be unique within their property class. The ID is necessary so that we can reference the property again later without having to write the potentially much longer name. Names are strings and as such enclosed in double quotes. Strings may contain any character, even non-ASCII characters. As you can see, resource properties can be nested: dev is a virtual resource, a team that consists of three other resources.
dev1, alias Paul Smith, costs more than the normal employee. So the declaration of dev1 overwrites the inherited default rate with a new value of 330.0. The default value has been inherited from the enclosing scope, resource dev, which in turn has inherited it from the global scope.
The declaration of the resource Klaus Müller uses another optional attribute. With vacation you can specify a certain time interval where the resource is not available.
Here you need to understand how TaskJuggler handles time intervals. Internally, TaskJuggler uses the number of seconds after January 1st, 1970 to store any date. So all dates are actually stored with an accuracy of 1 second. 2002-02-01 specifies midnight February 1st, 2002. Again following the TaskJuggler concept of requiring as little information as necessary and extending the rest with sensible defaults, TaskJuggler adds the time 0:00:00 if nothing else has been specified. So the vacation ends on midnight February 5th, 2002. Well, almost. Every time you specify a time interval, the end date is not included in the interval. But the second before the date that you have specified is. So Klaus Müllers vacation ends 23:59:59 on February 4th, 2002.
Peter Murphy only works 6.4 hours a day. So we use the limits attribute to limit his daily working hours. We could also define exact working hours using the shift property, but we ignore this for now.
Note that we have attached the flag team after the declaration of the sub-resources to the team resources. This way, these flags don't get handed down to the sub-resources. If we would have declared the flags before the sub-resources, then they would have the flags attached as well.