General Resource Assignment Properties

An assignment is a resource that has been assigned to a specific task. Each resource has general properties, typically a unique ID, a start and a finish time. This article explains how to set and get these properties with Aspose.Tasks.

Working with General Assignment Properties

The ResourceAssignment class exposes a number of properties used to set and get general assignment properties:

To see an assignment’s general properties in Microsoft Project:

  1. From the View menu, select Task Usage.
  2. From the Insert menu, select Column.
  3. Add the Start. Finish and Unique ID columns.

General assignment properties viewed in Microsoft Project

open resource assignment properties in Microsoft Project

Setting General Resource Assignment Properties using Aspose.Tasks

The following example shows how to set these properties from scratch.

 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(ResourceAssignmentProperties.class);
 4
 5Project project = new Project();
 6
 7Task task = project.getRootTask().getChildren().add("Task");
 8Resource rsc = project.getResources().add("Rsc");
 9rsc.set(Rsc.STANDARD_RATE, BigDecimal.valueOf(10));
10rsc.set(Rsc.OVERTIME_RATE, BigDecimal.valueOf(15));
11
12ResourceAssignment assn = project.getResourceAssignments().add(task, rsc);

Getting General Resource Assignment Properties using Aspose.Tasks

 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(ResourceAssignmentProperties.class);
 4
 5Project prj = new Project(dataDir + "input.mpp");
 6for (ResourceAssignment ra : prj.getResourceAssignments()) {
 7    System.out.println(ra.get(Asn.UID));
 8    System.out.println(ra.get(Asn.START).toString());
 9    System.out.println(ra.get(Asn.FINISH).toString());
10}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.