This short guide explains how to set predecessor in MS Project using Java. It provides details on setting the IDE, a list of steps, and sample code for adding predecessors in MS Project using Java. You will learn different options to customize the output project at the end of this article.
Steps for Setting Predecessors in MS Project using Java
- Set the environment to use Aspose.Tasks for Java to work with predecessors
- Apply a license in the application and create a new project
- Set the project start date and name, and add a few sample tasks to it
- Set tasks’ durations in days, and link all tasks using the Finish-to-Start link type
- Add one day lag between task 3 and task 4 for demonstration
- Save the final project after adding predecessors and successors
- Print all the task links with all the predecessors and successors details
These steps describe the process of setting predecessor task using Java. Apply the product license to save the output as an MPP, create a new project file, set the project start date, time and name of the project, and add sample tasks in the project. Set each task duration, link all the tasks with finish to start dependencies, add test lag between two tasks, and save the project on the disk.
Code for Predecessor and Successor in MS Project using Java
This code demonstrates the process of adding predecessor in Microsoft project using Java. You can utilize the critical path feature to identify and highlight the tasks that can affect the project end date if the task’s duration varies. Set task constraints to control the project schedule; for example, such a task must start on a particular date, or the task should start as soon as possible.
This tutorial has taught us working with predecessor and successor tasks. To add a milestone in a project, refer to the article Add Milestone in MS Project using Java.