Out of the Box USER

TaskJuggler The Best Laid Plans Enterprises and service providers are not the only ones to rely on computer supported task and project planning. Clubs and non-profit organizations can save a lot of time, money, and headaches with the right approach. TaskJuggler helps you organize your resources and provides a clear overview.

BY FREDERIK BIJLSMA

AND PATRICIA JUNG

asks and projects that need or- gram accepts input in the form of text Advanced Functionality ganizing have accompanied files with the extension .tjp that describe Let’s take a look at the developer version Tmankind down through the cen- objects. The following syntax tells the 1.9.2, which provides quite a few new turies. Unfortunately, people and more program to parse a file features such as the CSV Reports men- recently programs, that can assign tioned previously. In addition to a C++ resources and tasks in a meaningful and taskjuggler filename.tjp compiler, such as g++ from the “GNU above all efficient manner have always Compiler Collection”, GCC, you will also been in short supply. TaskJuggler [1] by TaskJuggler produces reports in HTML or require the X Window system developer Chris Schläger and Klaas Freitag not only CSV file format that are perfectly suited package. Despite what the documenta- provides this kind of functionality, but for Internet publications, or for addi- tion on the Taskjuggler website, http:// turns out to be a genuine all-round talent tional manipulation within spreadsheets www.taskjuggler.org/, maintains, you that can optimize any given scenario that like OpenOffice. As an alternative, the will also need at least version 3.1 of the can be defined in terms of projects and program can also produce XML data, library. resources. that can then be converted into any To unpack the TaskJuggler package, The program allows you to define cost other required target format, allowing enter the following centers and simple controlling facilities, easy migration to your content manage- along with shifts and priorities. The pro- ment system. tar xjf taskjuggler-1.9.2_U GLOSSARY

CSV: Files in the “Comma Separated Value” Docbook: A “Document Type Definition”,that Gantt diagrams: Show the timeline for tasks format simplify the exchange of data is,a description of the tags that can be used in that need to be finalized to allow a project to between spreadsheets.The cell contents are an XML file. Docbook defines the elements be completed. As you can see from Figure 1, separated by commas and newlines,although that a book comprises.This allows text mark- each task occupies a single line in the dia- any formatting will be lost on conversion. ups that can be converted to professional gram. Gantt charts are particularly useful for C++: The C++ programming language was printed or online formats. Open Source pro- projects where the number of tasks that is to developed more than 20 years ago to bring jects use the Docbook format for at least part be planned is not too large.They owe their data abstractions,object-oriented program- of their documentation. name to the American, Henry Laurence Gantt ming,and other modern concepts to the C CPAN: The “Comprehensive Perl Archive Net- (1861-1919), an engineer and management programming language. Since then,C++ has work”at http://cpan.perl.org/ provides consultant. Gantt charts were used success- achieved ISO certification and is available on software, modules and documentation for fully in Arizona in the 1930s for the Hoover almost any architecture or . Perl. Dam building project.

www.linux-magazine.com January 2004 75 LINUX USER Out of the Box

unstable.tar.bz2 when defining the end date, as tasks out- cd taskjuggler-1.9.2_unstable side of the project timeline are simply ignored. Then launch the compilation process by The third parameter you need is a ver- entering sion number. This can be a simple “1.0”; if you use a version control system to ./configure --with--support manage your TaskJuggler files, you can make specify a wildcard (”$Id” for CVS). These mandatory parameters can be You can omit the --with-kde-support followed by optional details in brackets, option, if you do not have KDE. The con- such as the daily working hours (eight figuration routine is designed to provide hours in our example) and the number as much functionality as the host of workdays per annum (256 in the machine’s environment can support. As Figure 1: A Gantt chart for a project example). an example, it re-generates the documen- The shifts object can now be used to tation files if it can locate the Docbook Projects, Shifts, & Resources define periods of shift-work. Shifts are libraries. It makes sense to create a directory for used to accumulate the time accounts of If Perl and the XML::Parser, Post- your own projects, to give TaskJuggler the people working at the same time. The script::Simple, Date::Calc, Class::Method somewhere to store your definitions and workinghours object defines the specific Maker, and Data::Dumper CPAN mod- reports. The TaskJuggler website pro- daily work periods. Days are abbreviated ules are installed, the build process will vides a few examples [2] to help explain to tue for Tuesday, wed for Wednesday also create a program called tjx2gantt, how to use the application. etc.). The keyword off indicates a day which creates Gantt diagrams as shown We can take a look at the Examples without working hours within a project in Figure 1. directory in the TaskJuggler source period. If you miss a day, TaskJuggler will After completing the make process, go download. This contains a ShiftSchedule- assume the default working hours of the on to assume system privileges before .tjp and details the four components of project for this shift. installing TaskJuggler by typing make the project: the definition, the levels, the Each shift is assigned an ID (for exam- install . available resources, and the tasks. ple phonesupport for the time that the Let’s take a look at the actual project members of the sysadmin teams will Listing 1: Shift definitions section of this example first (see Listing spend on the receiving end of the hot- 1). shifts provides an identifier, which is line) and a title. 01 project shifts "Duty Schedule followed by the project name – this pro- SysAdmin Team" "$Id" 2002-06- ject deals with shift work for the system 01 2002-08-01 { Listing 3: Task definitions administration team. 02 dailyworkinghours 8 01 task sysadmin "System The last few parameters indicate the 03 yearlyworkingdays 256 Administration" { timeline for the project in YYYY-MM-dd 04 } 02 format. You should allow some leeway 05 flags hidden 03 # The following is not really 06 shift phonesupport "Phone a task but simply support" { Listing 2: Resource 04 # defines the project starting 07 workinghours mon 9:00 - definitions date. 12:00 01 resource joe "Joe Bughunter" { 05 task start "Start of plan" { 08 workinghours tue 9:00 - 02 vacation 2002-06-10 - 06 start 2002-06-01 12:00 2002-06-13 07 milestone 09 workinghours wed off 03 } 08 flags hidden 10 workinghours thu 14:00 - 04 resource khaled "Khaled Safri" 09 } 17:00 { 10 11 workinghours fri 9:00 - 05 shift studenthours 11 task usersup "User Support" { 12:00 06 } 12 depends !start 12 } 07 [...] 13 duration 2m 13 shift studenthours "Student 08 resource anders "Anders 14 shift phonesupport Hours" { Gundstrom" { 15 priority 900 14 workinghours mon 9:00 - 09 maxeffort 0.8 16 allocate joe { alternative 14:00 10 } anders, khaled, sally select 15 [...] 11 resource paul "Paul Gutier" { minloaded } 16 workinghours fri 9:00 - 12 vacation 2002-07-02 - 17 } 14:00 2002-07-08 18 [...] 17 } 13 } 19 }#End of Sysadmin Tasks

76 January 2004 www.linux-magazine.com Out of the Box LINUX USER

The staff members affected true value is revealed when you by this project are indicated by need to import or export data. the use of the resource keyword, The appropriate DTD is avail- as shown in Listing 2. In addi- able from http://www.taskjug tion to a unique descriptor gler.org/show_dtd.php. You can (such as joe), the full name is then feed the XML file to the useful as a description. The Perl script mentioned previ- vacation attribute can option- ously, tjx2gantt [3], to create a ally be used to define a vacation Gantt diagram. period; maxeffort defines a fac- In addition, TaskJuggler is tor that allows you to calculate perfectly capable of generating part-time work. Instead of a useful HTML reports without forty-hour working week, any additional tools. Adding the Anders Gundstrom only works code from Listing 4 htmlweekly- 8*0.8=6.4 hours. The shift key- calendar to the .tjp file for word binds Khaled Safri to Sally’s calendar in Figure 2 will special working hours; in this Figure 2: HTML Calendar for Sally create a week-by-week plan of case, the times defined for stu- the project period in Calendar- dents in Listing 1. sally.html. Finally, the most important The isresource(sally) function thing: the tasks to be completed filters the assignments for the (see Listing 3). Our example first resource sally, and hideresource defines a task, sysadmin, which hides any resources that do not is then split up into individual (~) match this criterion. jobs in curly brackets. The start columns schedule outputs a de- point defines a milestone, at tailed schedule using this data. which other tasks commence. Leaving out the hidetask 1 line, User support depends on com- Figure 3: OpenOffice with the workload data from TaskJuggler inserts a line for notes between pletion of the start job, and the date and task in the HTML cannot occur prior to June 1 2002. The and selects the member of staff with the calendar. milestone will not appear in reports due heaviest workload. Order selects the first CSV reports are also defined in the .tjp to the flags hidden tag. member of staff without an assignment, file, as Listing 5 shows. csvtaskreport out- We can now assign the support task, and random simply picks anyone. puts the individual names and effort in which we will be planning for the next hours (loadunit hours) for all non-hidden two months (duration 2m) to the phone- Simple Planning tasks for the period between 06.01.2002 support shift with a priority of 900. 1 As soon as the scope of the project has and 07.01.2002 (see Figure 3). indicates something extremely unimpor- been specified, TaskJuggler can provide tant, while 1000 has utmost priority. The planning support: Adding the following Good planning takes you allocate attribute assigns staff to the task. line to the .tjp file half-way home In this case this means selecting those No matter if you need who-will-be-work- members of staff from a group compris- xmlreport "ShiftSchedule.tjx" ing-for-how-long-on-what? reports, or ing joe, anders, khaled, and sally who simple assignment plans for your staff – have the lightest workload from other tells TaskJuggler to create an XML report TaskJuggler offers a range of functions tasks (select minloaded). The maxloaded and store it in a file called ShiftSchedule. that could easily fill a reference manual. selection criterion is the opposite of this, tjx. Of course you can view this file with The Examples directory in the taskjug- an XML editor, or similar tool, but its gler source archive provides more Listing 4: Sallys examples. This directory and the sample Assignment Schedule Listing 5: Overview of the files also offer a number of tips, for example, on the use of macro scripts, htmlweeklycalendar "Calendar- number of working hours and multipart projects. ■ sally.html" { per task and day headline "Assignment Schedule csvtaskreport "effort.csv" { INFO for Sally" columns name, daily, effort columns schedule start 2002-06-01 [1] TaskJuggler:http://www.taskjuggler.org/ hidetask 1 end 2002-07-01 [2] TaskJuggler projects:http://www. hideresource hidetask hidden taskjuggler.org/example.php ~isresource(sally) loadunit hours [3] tjx2gantt Perl script:Installed by default } } with TaskJuggler

www.linux-magazine.com January 2004 77