Stop and Resume a Task in Ruby

Aspose.Tasks - Stop and Resume a Task

To Stop and Resume a Task using Aspose.Tasks Java for Ruby, simply invoke StopAndResumeTask module. Here you can see example code.

Ruby Code

 1project = Rjb::import('com.aspose.tasks.Project').new('test_tasks.mpp')
 2collector = Rjb::import('com.aspose.tasks.ChildTasksCollector').new
 3Rjb::import('com.aspose.tasks.TaskUtils').apply(project.getRootTask(), collector, 0)
 4tasks = collector.getTasks()
 5tsk = Rjb::import('com.aspose.tasks.Tsk')
 6i = 0
 7while i < tasks.size()
 8    task = tasks.get(i)
 9    if task.get(tsk.STOP).toString() == "1/1/2015"
10        puts "NA"
11    else
12        puts "Task Stop: " + task.get(tsk.STOP).toString()
13    end
14
15    if task.get(tsk.RESUME).toString() == "1/1/2015"
16        puts "NA"
17    else
18        puts "Task Resume: " + task.get(tsk.RESUME).toString()
19    end
20        puts "---------------------------------------------"
21    i += 1
22end

Download Running Code

Download Stop and Resume a Task (Aspose.Tasks) from any of the below mentioned social coding sites:

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.