Stop and Resume a Task in Ruby
Contents
[
Hide
Show
]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')
2
3collector = Rjb::import('com.aspose.tasks.ChildTasksCollector').new
4
5Rjb::import('com.aspose.tasks.TaskUtils').apply(project.getRootTask(), collector, 0)
6
7tasks = collector.getTasks()
8
9tsk = Rjb::import('com.aspose.tasks.Tsk')
10
11i = 0
12
13while i < tasks.size()
14
15 task = tasks.get(i)
16
17 if task.get(tsk.STOP).toString() == "1/1/2015"
18
19 puts "NA"
20
21 else
22
23 puts "Task Stop: " + task.get(tsk.STOP).toString()
24
25 end
26
27
28
29 if task.get(tsk.RESUME).toString() == "1/1/2015"
30
31 puts "NA"
32
33 else
34
35 puts "Task Resume: " + task.get(tsk.RESUME).toString()
36
37 end
38
39 puts "---------------------------------------------"
40
41 i += 1
42
43end
Download Running Code
Download Stop and Resume a Task (Aspose.Tasks) from any of the below mentioned social coding sites: