General Resource Assignment Properties in Ruby
Contents
[
Hide
Show
]Aspose.Tasks - Getting General Resource Assignment Properties
To get general resource assignment properties using Aspose.Tasks Java for Ruby, call get_resource_assignments method of ResourceAssignmentProperties module. Here you can see example code.
1project = Rjb::import('com.aspose.tasks.Project').new('test_tasks.mpp')
2resource_assignments = project.getResourceAssignments().toList()
3i = 0
4while i < resource_assignments.size()
5 assignment = resource_assignments.get(i)
6 puts assignment.get(Rjb::import('com.aspose.tasks.Asn').UID).to_string
7 puts assignment.get(Rjb::import('com.aspose.tasks.Asn').START).to_string
8 puts assignment.get(Rjb::import('com.aspose.tasks.Asn').FINISH).to_string
9 puts "--------------------------------------------------------"
10 i += 1
11end
Aspose.Tasks - Setting General Resource Assignment Properties
To set General Resource Assignment Properties using Aspose.Tasks Java for Ruby, call set_resource_assignments method of ResourceAssignmentProperties module. Here you can see example code.
1project = Rjb::import('com.aspose.tasks.Project').new
2task = project.getRootTask().getChildren().add("Task")
3rsc = project.getResources().add("Rsc")
4rsc.set(Rjb::import('com.aspose.tasks.Rsc').STANDARD_RATE, Rjb::import('java.math.BigDecimal').valueOf(10))
5rsc.set(Rjb::import('com.aspose.tasks.Rsc').OVERTIME_RATE, Rjb::import('java.math.BigDecimal').valueOf(15))
6assignment = project.getResourceAssignments().add(task, rsc)
7puts "Set resource assignment properties."
Download Running Code
Download General Resource Assignment Properties (Aspose.Tasks) from any of the below mentioned social coding sites: