Module: Asposetasksjava::StopAndResumeTask

Defined in:
lib/asposetasksjava/Tasks/stopandresumetask.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/asposetasksjava/Tasks/stopandresumetask.rb', line 3

def initialize()
    data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
            
    # Instantiate project object
    project = Rjb::import('com.aspose.tasks.Project').new(data_dir + 'test_tasks.mpp')

    # Create a ChildTasksCollector instance
		collector = Rjb::import('com.aspose.tasks.ChildTasksCollector').new

		# Collect all the tasks from RootTask using TaskUtils
		Rjb::import('com.aspose.tasks.TaskUtils').apply(project.getRootTask(), collector, 0)

		tasks = collector.getTasks()

		tsk = Rjb::import('com.aspose.tasks.Tsk')

		# Parse through all the collected tasks
		i = 0
		while i < tasks.size()
			task = tasks.get(i)
  if task.get(tsk.STOP).toString() == "1/1/2015"
puts "NA"
			else
puts "Task Stop: " + task.get(tsk.STOP).toString()
			end

			if task.get(tsk.RESUME).toString() == "1/1/2015"
puts "NA"
			else
puts "Task Resume: " + task.get(tsk.RESUME).toString()
			end	  
  puts "---------------------------------------------"
  i +=1
		end
end