From 7161af247259c62779fe3c038259732ff3967524 Mon Sep 17 00:00:00 2001 From: Muhammad Muqarrab Date: Fri, 1 Mar 2024 13:06:46 +0500 Subject: [PATCH] Updated assignment examples --- .../resource-assignments/assignment-budget/_index.md | 12 +----------- .../deal-with-variances/_index.md | 7 ++++--- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/content/english/java/resource-assignments/assignment-budget/_index.md b/content/english/java/resource-assignments/assignment-budget/_index.md index 90704efe..3d98be2c 100644 --- a/content/english/java/resource-assignments/assignment-budget/_index.md +++ b/content/english/java/resource-assignments/assignment-budget/_index.md @@ -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 diff --git a/content/english/java/resource-assignments/deal-with-variances/_index.md b/content/english/java/resource-assignments/deal-with-variances/_index.md index fa077638..6d846429 100644 --- a/content/english/java/resource-assignments/deal-with-variances/_index.md +++ b/content/english/java/resource-assignments/deal-with-variances/_index.md @@ -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 }