Skip to content

Commit

Permalink
Updated assignment examples
Browse files Browse the repository at this point in the history
  • Loading branch information
muqarrab-aspose committed Mar 1, 2024
1 parent 8ff624d commit 7161af2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,7 @@ In your Java file, import the required classes:
```java
import com.aspose.tasks.*;
```
## Assignment Budget Management
Let's break down the provided example into multiple steps and explore each one in detail:
```java
// The path to the documents directory.
String dataDir = "Your Data Directory";
Project prj = new Project(dataDir + "project.mpp");
for (ResourceAssignment ra : prj.getResourceAssignments()) {
System.out.println(ra.get(Asn.BUDGET_COST));
System.out.println(ra.get(Asn.BUDGET_WORK).toString());
}
```

## Step 1: Define Data Directory
Set the path to the directory containing your project file.
```java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ First, import the necessary packages to work with Aspose.Tasks:
import com.aspose.tasks.Asn;
import com.aspose.tasks.Project;
import com.aspose.tasks.ResourceAssignment;
// The path to the documents directory.
String dataDir = "Your Data Directory";
Project project = new Project(dataDir + "ResourceAssignmentVariance.mpp");

```
## Step 1: Iterate through Resource Assignments
To deal with variances, we need to iterate through resource assignments in the project. This is achieved using a simple loop:
```java
// The path to the documents directory.
String dataDir = "Your Data Directory";
Project project = new Project(dataDir + "ResourceAssignmentVariance.mpp");
for (ResourceAssignment ra : project.getResourceAssignments()) {
// Perform operations on each resource assignment
}
Expand Down

0 comments on commit 7161af2

Please sign in to comment.