Change Progress of a Task

Changing progress of a Task Aspose.Tasks for Java supports changing a task’s progress in terms of its percentage completion through the Task class’ SetPercentComplete() method. This method takes an integer argument as input for the percentage work completed.

The following piece of code shows how to change the progress of a task.

 1// For complete examples and data files, please go to
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(ChangeProgressOfTask.class);
 5Project project = new Project();
 8Task task = project.getRootTask().getChildren().add("Task");
 9task.set(Tsk.DURATION, project.getDuration(2));
10task.set(Tsk.PERCENT_COMPLETE, 50);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.