Skip to content

Commit 15c7bfc

Browse files
Updated resources assignments examples
1 parent 355cd91 commit 15c7bfc

File tree

16 files changed

+887
-713
lines changed

16 files changed

+887
-713
lines changed

content/english/java/resource-assignments/_index.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,31 @@ url: /java/resource-assignments/
99
---
1010

1111
## Resource Assignments Tutorials
12-
### [Add Extended Attributes to Resource Assignments in Aspose.Tasks](./add-extended-attributes/)
12+
### [Mastering MS Project Manipulation with Aspose.Tasks for Java](./add-extended-attributes/)
13+
Learn how to efficiently write MS Project information using Aspose.Tasks for Java. Step-by-step guide for Java developers.
1314
### [Assignment Budget Management in Aspose.Tasks](./assignment-budget/)
14-
### [Handle Assignment Cost in Aspose.Tasks](./assignment-cost/)
15-
### [Calculate Percentages for Resource Assignments in Aspose.Tasks](./calculate-percentages/)
15+
Learn how to efficiently manage assignment budgets in Java using Aspose.Tasks, a powerful library for Microsoft Project file manipulation.
16+
### [Efficient Assignment Cost Management with Aspose.Tasks](./assignment-cost/)
17+
Learn how to handle assignment costs effectively in Aspose.Tasks for Java. Step-by-step guide for managing project resources efficiently.
18+
### [Calculate Resource Assignment Percentages with Aspose.Tasks](./calculate-percentages/)
19+
Learn how to efficiently calculate percentages for resource assignments in Java projects using Aspose.Tasks, simplifying project management tasks.
1620
### [Create Resource Assignments in Aspose.Tasks](./create-resource-assignments/)
17-
### [Deal with Variances in Aspose.Tasks](./deal-with-variances/)
18-
### [Manage Hyperlink Properties for Resource Assignments in Aspose.Tasks](./hyperlink-properties/)
19-
### [Handle Leveling Delay Properties for Resource Assignments in Aspose.Tasks](./leveling-delay-properties/)
21+
Learn how to create resource assignments in Aspose.Tasks for Java effortlessly with this step-by-step tutorial. Efficient project resource management made easy.
22+
### [Efficient Project Variance Handling with Aspose.Tasks](./deal-with-variances/)
23+
Learn how to handle project variances efficiently with Aspose.Tasks for Java. Manage work, cost, start, and finish variances effortlessly.
24+
### [Manage Hyperlink Properties for Assignments in Aspose.Tasks](./hyperlink-properties/)
25+
Learn how to manage hyperlink properties for resource assignments in Aspose.Tasks for Java. Enhance collaboration and accessibility in project management.
26+
### [Handle Leveling Delay Properties in Aspose.Tasks](./leveling-delay-properties/)
27+
Learn how to handle leveling delay properties for resource assignments in Aspose.Tasks for Java with this comprehensive tutorial.
2028
### [Monitor Overtime, Remaining Costs, and Work in Aspose.Tasks](./overtime-remaining-costs-work/)
29+
Learn how to monitor overtime, remaining costs, and work in Java projects using Aspose.Tasks. Easy steps for effective project management.
2130
### [Read Shared Resource Assignments in Aspose.Tasks](./read-shared-resource-assignments/)
31+
Learn how to read shared resource assignments in Aspose.Tasks for Java. Enhance project management efficiency with step-by-step tutorials.
2232
### [Read and Write Rate Scale for Resource Assignments in Aspose.Tasks](./read-write-rate-scale/)
33+
Learn how to manage resource assignments rate scale effectively in Aspose.Tasks for Java with this comprehensive tutorial.
2334
### [Manage Notes for Resource Assignments in Aspose.Tasks](./resource-assignment-notes/)
24-
### [Explore Resource Assignment Properties in Aspose.Tasks](./resource-assignment-properties/)
35+
Learn how to manage notes for resource assignments in Aspose.Tasks for Java. Step-by-step tutorial for seamless integration.
2536
### [Stop and Resume Resource Assignments in Aspose.Tasks](./stop-resume-assignment/)
26-
### [Generate Timephased Data for Resource Assignments in Aspose.Tasks](./timephased-data-generation/)
37+
Learn how to manage resource assignments effectively in Aspose.Tasks for Java with this step-by-step tutorial.
38+
### [Generate Timephased Data in Aspose.Tasks](./timephased-data-generation/)
39+
Learn how to generate timephased data for resource assignments using Aspose.Tasks for Java. Improve project management efficiency with this comprehensive guide.
Lines changed: 52 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
---
2-
title: Add Extended Attributes to Resource Assignments in Aspose.Tasks
2+
title: Mastering MS Project Manipulation with Aspose.Tasks for Java
33
linktitle: Add Extended Attributes to Resource Assignments in Aspose.Tasks
44
second_title: Aspose.Tasks Java API
5-
description:
5+
description: Learn how to efficiently write MS Project information using Aspose.Tasks for Java. Step-by-step guide for Java developers.
66
type: docs
77
weight: 10
88
url: /java/resource-assignments/add-extended-attributes/
99
---
10-
11-
## Complete Source Code
10+
## Introduction
11+
In this tutorial, we'll delve into utilizing Aspose.Tasks for Java, a powerful library for manipulating Microsoft Project files programmatically. We'll focus on a fundamental task: writing MS Project information using Aspose.Tasks. Whether you're a seasoned developer or just starting your journey in Java programming, this guide will walk you through the process step by step.
12+
## Prerequisites
13+
Before diving into the tutorial, ensure you have the following prerequisites in place:
14+
1. Java Development Kit (JDK): Make sure you have JDK installed on your system.
15+
2. Aspose.Tasks for Java Library: Download and install the Aspose.Tasks for Java library. You can obtain it from [here](https://releases.aspose.com/tasks/java/).
16+
3. Integrated Development Environment (IDE): Choose an IDE of your preference. We recommend IntelliJ IDEA or Eclipse.
17+
18+
## Import Packages
19+
First, import the necessary packages in your Java project:
1220
```java
13-
/*
14-
* Copyright 2001-2022 Aspose Pty Ltd. All Rights Reserved.
15-
*
16-
* This file is part of Aspose.Tasks. The source code in this file
17-
* is only intended as a supplement to the documentation, and is provided
18-
* "as is", without warranty of any kind, either expressed or implied.
19-
*/
20-
21-
22-
2321
import com.aspose.tasks.CustomFieldType;
2422
import com.aspose.tasks.ExtendedAttribute;
2523
import com.aspose.tasks.ExtendedAttributeDefinition;
@@ -31,86 +29,46 @@ import com.aspose.tasks.ResourceAssignment;
3129
import com.aspose.tasks.SaveFileFormat;
3230
import com.aspose.tasks.Task;
3331
import com.aspose.tasks.Value;
34-
35-
3632
import java.io.IOException;
3733
import java.math.BigDecimal;
38-
39-
public class AddExtendedAttributesToResourceAssignments {
40-
public static void main(String[] args) {
41-
AddPlainExtendedAttributeToResourceAssignment();
42-
AddLookUpExtendedAttributeToResourceAssignment();
43-
}
44-
45-
public static void AddPlainExtendedAttributeToResourceAssignment() {
46-
String dataDir = "Your Data Directory";
47-
48-
// ExStart: AddPlainExtendedAttributeToResourceAssignment
49-
Project project = new Project(dataDir + "Blank2010.mpp");
50-
51-
// Add new task and resource
52-
Task task1 = project.getRootTask().getChildren().add("Task");
53-
Resource rsc1 = project.getResources().add("Rsc");
54-
55-
// Assign the resource desired task
56-
ResourceAssignment assn = project.getResourceAssignments().add(task1, rsc1);
57-
58-
ResourceAssignment assignment = project.getResourceAssignments().toList().get(0);
59-
60-
// Custom attributes which is visible in "Resource Usage" view can be created
61-
// with ExtendedAttributeDefinition.CreateResourceDefinition method.
62-
ExtendedAttributeDefinition resCostAttr = ExtendedAttributeDefinition.createResourceDefinition(CustomFieldType.Cost, ExtendedAttributeResource.Cost5, "My cost");
63-
64-
project.getExtendedAttributes().add(resCostAttr);
65-
66-
ExtendedAttribute value = resCostAttr.createExtendedAttribute();
67-
value.setNumericValue(BigDecimal.valueOf(1500));
68-
assignment.getExtendedAttributes().add(value);
69-
70-
// Custom attributes which is visible in "Task Usage" view can be created with
71-
// ExtendedAttributeDefinition.CreateTaskDefinition method
72-
ExtendedAttributeDefinition resCostAttr2 = ExtendedAttributeDefinition.createTaskDefinition(CustomFieldType.Cost, ExtendedAttributeTask.Cost5, "My cost for task");
73-
74-
project.getExtendedAttributes().add(resCostAttr2);
75-
76-
value = resCostAttr2.createExtendedAttribute();
77-
value.setNumericValue(BigDecimal.valueOf(2300));
78-
79-
assignment.getExtendedAttributes().add(value);
80-
81-
project.save(dataDir + "AddExtendedAttributesToResourceAssignment_out.mpp", SaveFileFormat.Mpp);
82-
// ExEnd: AddPlainExtendedAttributeToResourceAssignment
83-
}
84-
85-
public static void AddLookUpExtendedAttributeToResourceAssignment() {
86-
String dataDir = "Your Data Directory";
87-
// ExStart: AddLookUpExtendedAttributeToResourceAssignment
88-
Project project = new Project(dataDir + "Blank2010.mpp");
89-
90-
ExtendedAttributeDefinition resCostAttr = ExtendedAttributeDefinition.createLookupResourceDefinition(CustomFieldType.Cost, ExtendedAttributeResource.Cost5, "My lookup cost");
91-
92-
Value value1 = new Value();
93-
value1.setNumericValue(BigDecimal.valueOf(1500));
94-
value1.setDescription("Val 1");
95-
value1.setId(1);
96-
value1.setVal("1500");
97-
98-
resCostAttr.addLookupValue(value1);
99-
100-
Value value2 = new Value();
101-
value1.setNumericValue(BigDecimal.valueOf(2500));
102-
value1.setDescription("Val 2");
103-
value1.setId(2);
104-
105-
resCostAttr.addLookupValue(value2);
106-
107-
project.getExtendedAttributes().add(resCostAttr);
108-
109-
ExtendedAttribute value = resCostAttr.createExtendedAttribute(value1);
110-
value.setNumericValue(BigDecimal.valueOf(1500));
111-
project.save(dataDir + "AddExtendedAttributesToRAWithLookUp_out.mpp", SaveFileFormat.Mpp);
112-
// ExEnd: AddLookUpExtendedAttributeToResourceAssignment
113-
}
114-
}
115-
11634
```
35+
#Let's break down the example provided into multiple steps:
36+
## Step 1: Set Up Data Directory
37+
Define the directory where your project data will be stored.
38+
```java
39+
String dataDir = "Your Data Directory";
40+
```
41+
## Step 2: Create Project Instance
42+
Initialize a new project instance.
43+
```java
44+
Project project = new Project();
45+
```
46+
## Step 3: Set Project Information Properties
47+
Set properties for the project such as start date, schedule from start, and status date.
48+
```java
49+
project.set(Prj.SCHEDULE_FROM_START, new NullableBool(true));
50+
java.util.Calendar cal = java.util.Calendar.getInstance();
51+
cal.set(2014, Calendar.JULY, 10);
52+
project.set(Prj.START_DATE, cal.getTime());
53+
project.set(Prj.CURRENT_DATE, cal.getTime());
54+
project.set(Prj.STATUS_DATE, cal.getTime());
55+
```
56+
## Step 4: Save Project as XML
57+
Save the project with the updated information as an XML file.
58+
```java
59+
project.save(dataDir + "project3.xml", SaveFileFormat.Xml);
60+
```
61+
62+
## Conclusion
63+
Congratulations! You've successfully learned how to write MS Project information using Aspose.Tasks for Java. With this newfound knowledge, you can automate various tasks related to Microsoft Project files, enhancing your productivity as a Java developer.
64+
## FAQ's
65+
### Q: Can I use Aspose.Tasks for Java to read MS Project files?
66+
A: Yes, Aspose.Tasks for Java provides robust functionalities for both reading and writing MS Project files.
67+
### Q: Is Aspose.Tasks for Java compatible with different versions of MS Project?
68+
A: Absolutely, Aspose.Tasks for Java supports various versions of MS Project, ensuring compatibility across different file formats.
69+
### Q: Are there any limitations to the trial version of Aspose.Tasks for Java?
70+
A: While the trial version allows you to explore the library's capabilities, it has certain limitations such as watermarks on output files.
71+
### Q: How can I get support for Aspose.Tasks for Java?
72+
A: You can seek assistance from the Aspose.Tasks community forum [here](https://forum.aspose.com/c/tasks/15).
73+
### Q: Can I purchase a temporary license for Aspose.Tasks for Java?
74+
A: Yes, temporary licenses are available for short-term usage. You can obtain one from [here](https://purchase.aspose.com/temporary-license/).

content/english/java/resource-assignments/assignment-budget/_index.md

Lines changed: 77 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,87 @@
22
title: Assignment Budget Management in Aspose.Tasks
33
linktitle: Assignment Budget Management in Aspose.Tasks
44
second_title: Aspose.Tasks Java API
5-
description:
5+
description: Learn how to efficiently manage assignment budgets in Java using Aspose.Tasks, a powerful library for Microsoft Project file manipulation.
66
type: docs
77
weight: 11
88
url: /java/resource-assignments/assignment-budget/
99
---
10-
11-
## Complete Source Code
10+
## Introduction
11+
Aspose.Tasks for Java is a powerful library that provides developers with the tools they need to efficiently manage and manipulate Microsoft Project files in their Java applications. Whether you're building a project management tool, automating tasks, or simply need to interact with Project files programmatically, Aspose.Tasks simplifies the process with its comprehensive features and intuitive API.
12+
In this tutorial, we'll delve into the world of assignment budget management using Aspose.Tasks for Java. We'll cover everything from importing the necessary packages to breaking down each example into step-by-step guides. By the end, you'll have a solid understanding of how to handle assignment budgets in your Java projects.
13+
## Prerequisites
14+
Before diving into this tutorial, make sure you have the following prerequisites in place:
15+
### Java Development Environment
16+
Ensure you have Java Development Kit (JDK) installed on your system. You can download and install the latest version from the [official Oracle website](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html).
17+
### Aspose.Tasks for Java
18+
Download and set up Aspose.Tasks for Java by following the instructions provided in the [documentation](https://reference.aspose.com/tasks/java/). You can download the library from the [Aspose.Tasks website](https://releases.aspose.com/tasks/java/).
19+
### Integrated Development Environment (IDE)
20+
Choose your preferred IDE for Java development. Popular options include Eclipse, IntelliJ IDEA, and NetBeans.
21+
## Import Packages
22+
To get started with assignment budget management in Aspose.Tasks for Java, import the necessary packages into your project.
23+
## Step 1: Add Aspose.Tasks Dependency
24+
If you're using Maven, add the following dependency to your `pom.xml` file:
25+
```xml
26+
<dependency>
27+
<groupId>com.aspose</groupId>
28+
<artifactId>aspose-tasks</artifactId>
29+
<version>{latest_version}</version>
30+
</dependency>
31+
```
32+
Replace `{latest_version}` with the current version of Aspose.Tasks for Java.
33+
## Step 2: Import Classes
34+
In your Java file, import the required classes:
35+
```java
36+
import com.aspose.tasks.*;
37+
```
38+
## Assignment Budget Management
39+
Let's break down the provided example into multiple steps and explore each one in detail:
1240
```java
13-
/*
14-
* Copyright 2001-2022 Aspose Pty Ltd. All Rights Reserved.
15-
*
16-
* This file is part of Aspose.Tasks. The source code in this file
17-
* is only intended as a supplement to the documentation, and is provided
18-
* "as is", without warranty of any kind, either expressed or implied.
19-
*/
20-
21-
22-
23-
import com.aspose.tasks.Asn;
24-
import com.aspose.tasks.Project;
25-
import com.aspose.tasks.ResourceAssignment;
26-
27-
28-
public class AssignmentBudget {
29-
public static void main(String[] args) {
30-
// The path to the documents directory.
31-
String dataDir = "Your Data Directory";
32-
33-
Project prj = new Project(dataDir + "project.mpp");
34-
35-
for (ResourceAssignment ra : prj.getResourceAssignments()) {
36-
System.out.println(ra.get(Asn.BUDGET_COST));
37-
System.out.println(ra.get(Asn.BUDGET_WORK).toString());
38-
}
39-
}
41+
// The path to the documents directory.
42+
String dataDir = "Your Data Directory";
43+
Project prj = new Project(dataDir + "project.mpp");
44+
for (ResourceAssignment ra : prj.getResourceAssignments()) {
45+
System.out.println(ra.get(Asn.BUDGET_COST));
46+
System.out.println(ra.get(Asn.BUDGET_WORK).toString());
4047
}
41-
42-
43-
44-
45-
4648
```
49+
## Step 1: Define Data Directory
50+
Set the path to the directory containing your project file.
51+
```java
52+
String dataDir = "Your Data Directory";
53+
```
54+
Replace `"Your Data Directory"` with the actual path to your data directory.
55+
## Step 2: Load Project File
56+
Instantiate a `Project` object and load the project file.
57+
```java
58+
Project prj = new Project(dataDir + "project.mpp");
59+
```
60+
Replace `"project.mpp"` with the name of your project file.
61+
## Step 3: Iterate Through Resource Assignments
62+
Iterate through each resource assignment in the project.
63+
```java
64+
for (ResourceAssignment ra : prj.getResourceAssignments()) {
65+
```
66+
## Step 4: Retrieve Budget Cost
67+
Retrieve and print the budget cost for each resource assignment.
68+
```java
69+
System.out.println(ra.get(Asn.BUDGET_COST));
70+
```
71+
## Step 5: Retrieve Budget Work
72+
Retrieve and print the budget work for each resource assignment.
73+
```java
74+
System.out.println(ra.get(Asn.BUDGET_WORK).toString());
75+
```
76+
## Conclusion
77+
In this tutorial, we've explored how to manage assignment budgets in Aspose.Tasks for Java. By following the steps outlined above, you can efficiently handle budget-related tasks in your Java projects with ease.
78+
## FAQ's
79+
### Q: Is Aspose.Tasks for Java compatible with all versions of Microsoft Project files?
80+
A: Yes, Aspose.Tasks for Java supports various versions of Microsoft Project files, including MPP, MPT, and XML formats.
81+
### Q: Can I modify assignment budgets programmatically using Aspose.Tasks for Java?
82+
A: Absolutely! Aspose.Tasks provides a robust API that allows you to manipulate assignment budgets as needed within your Java applications.
83+
### Q: Does Aspose.Tasks for Java offer documentation and support?
84+
A: Yes, you can refer to the [documentation](https://reference.aspose.com/tasks/java/) for comprehensive guides and seek assistance from the Aspose.Tasks community forum [here](https://forum.aspose.com/c/tasks/15).
85+
### Q: Can I try Aspose.Tasks for Java before purchasing?
86+
A: Yes, you can explore the features of Aspose.Tasks for Java with a free trial available [here](https://releases.aspose.com/).
87+
### Q: Where can I purchase a license for Aspose.Tasks for Java?
88+
A: You can buy a license for Aspose.Tasks for Java from the purchase page [here](https://purchase.aspose.com/buy).

0 commit comments

Comments
 (0)