When a task must be completed before another can begin, a dependency exists between them. Charting dependencies in your project is a key part of understanding the critical path of tasks that leads through to its successful completion, on time and within budget.

Using the Gantt chart in Task View, you can represent the relationships between tasks with dependency lines. A dependency line is drawn from the beginning or end of one task (or group, or milestone) to the beginning or end of another.

When you create a dependency, the dependent task automatically reschedules itself to respect the dependency. With further changes to the schedule and leveling, the tasks continue trying to follow the dependencies. If a dependency becomes impossible or you manually cause a task to stop obeying its dependencies, a violation occurs, which can be resolved with the Violations window.

The Omni Automation support in OmniPlan is particularly useful for automating the creation and setup of tasks and their related dependencies.

Instance Properties

The properties of a dependency.

Instance Functions

The functions that may be applied to an instance of a dependency.


OmniPlan supports four types (*) of dependencies that describe the ways in which tasks relate to one another. The dependency connection between two tasks can be tethered at either the beginning or end of task.


Creating Dependencies

Here is a script example demonstrating the establishment of a dependency between two newly created tasks. In this example, the dependent task is set to begin after the prerequisite task has completed.

task1 = actual.rootTask.addSubtask() task1.title = "Prerequisite" task2 = actual.rootTask.addSubtask() task2.title = "Dependent" dependency = task1.addDependent(task2) dependency.kind = DependencyKind.FinishStart

 1  The first task is created by executing the addSubtask() method on the rootTask object of the base scenario. The resulting reference to the created task object is stored in the variable: task1

 2  The created task is assigned the title “Prerequisite”

 3  A second task is created by executing the addSubtask() method on the rootTask object of the base scenario. The resulting reference to the created task object is stored in the variable: task2

 4  The second created task is assigned the title “Dependent”

 5  A dependency is added to the first created task by executing the addDependent(…) method with the first task instance, passing in the stored reference to the second created task (task2) as the direct parameter of the function. The resulting reference to the new dependency object is stored in the variable: dependency

 6  The new dependency is assigned a dependency type by setting the value of its kind property to the one that indicates that the dependency begins at the finish or the first task and ends at the beginning of the second task. In terms of the dependency kind class, the type is: DependencyKind.FinishStart

Here is the result of the execution of the example script in the document:


The same result can be achieved with an abbreviated version of the previous script, where tha type of dependency is assigned in the statement in which the dependency is created. (see line 5)

task1 = actual.rootTask.addSubtask() task1.title = "Prerequisite" task2 = actual.rootTask.addSubtask() task2.title = "Dependent" task1.addDependent(task2).kind = DependencyKind.FinishStart

Also note that the same results can be achieved by creating a dependent relationship between the two created tasks using the addPrerequisite(…) function of the Task class called on the second task instance rather than the first task instance. (see line 5)

task1 = actual.rootTask.addSubtask() task1.title = "Prerequisite" task2 = actual.rootTask.addSubtask() task2.title = "Dependent" task2.addPrerequisite(task1).kind = DependencyKind.FinishStart

Clearing All Dependencies

Here’s a script that clears all dependencies from all tasks in the actual scenario.

actual.rootTask.descendents().forEach((task)=>{ task.dependents.forEach((dependency)=>{dependency.remove()}) })

 01-03  Use the descendents() function on the rootTask object to generate an array of references to all tasks in the task hierarchy, and then use the JavaScript forEach(…) function to iterate the returned list of task object references.

 X  For each of the found tasks, get an array of its dependent objects, and then clear any dependent relationships using the remove() function of the Dependency class.


Add “Lead-Time” to Dependency

Sometimes it is practical to add a delay to a dependency so that non-project related events can occur. For example, say you order new kitchen cabinets for a renovation project. There would be two tasks: “Order the Cabinets”, and “Install the Cabinets”. To allow for the cabinet fabrication and shipping, you would add a “lead-time” duration (perhaps 12 days) to the task dependency object.

task1 = actual.rootTask.addSubtask() task1.title = "Order Cabinets" task2 = actual.rootTask.addSubtask() task2.title = "Install Cabinets" dependency = task1.addDependent(task2) dependency.kind = DependencyKind.FinishStart dependency.leadTimeDuration = Duration.elapsedDays(12)

Group Task with Dependent Subtasks

Here are some script examples demonstrating how to create a group task whose subtasks have dependent relationships.

groupTitle = "Home Exterior Maintenance" jobTitles = ["rake leaves","mow lawn","clean gutters","trim hedges"] var groupTask = actual.rootTask.addSubtask() groupTask.title = groupTitle groupTask.type = var subTasks = new Array() jobTitles.forEach((jobTitle,index)=>{ task = groupTask.addSubtask() task.title = jobTitle subTasks.push(task) if(index > 0){ dependency = task.addPrerequisite(subTasks[index-1]) dependency.kind = DependencyKind.FinishStart } })

 01  Store the name for the task group in the variable: groupTitle

 02  Store the titles for the subtasks in the variable: jobTitles

 03  Create a new top-level task and stored the resulting object reference in the variable: groupTask

 04  Assign the stored group task name to the created task.

 05  Set the value of the type property of the created task to

 06  Instantiate the variable subTasks to contain an empty array that will hold object references to the created subtasks.

 07-15  Use the JavaScript forEach(…) function to iterate the list of subtask titles. Note that the passed parameters for the callback function will include a reference to the title and its position (index) in the array of titles.

 08  Call the addSubtask() function on the group task object to add a new subtask to it.

 09  Set the title of the created subtask to the iterated title.

 10  Add the object reference of the created subtask to the array of subtasks.

 11-14  If the created subtask is not the first one, add a prerequisite dependency to the previous subtask.

 13  Set the value of the kind property of the dependency to the desired type, which in this case is: DependencyKind.FinishStart

By changing the value of the dependency’s kind property (line 13) to DependencyKind.StartStart the subtasks can be set to run a concurrent (simultaneous) manner:


This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.