[Canonical page](<https://docs.dhtmlx.com/planning-engine/java/api/overview/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# API reference

The Java API of Planning Engine ships as one dependency-free JAR that needs JDK 21 or newer. It schedules, edits, levels and scores projects, turns workers and skill requirements into slots for auto-assignment, and reads and writes the shared JSON format.

## How the API is organized

Every public type lives in the single package `org.dhtmlx.plen`. There's no `module-info.java`. The folders of this reference group the types by topic and aren't packages:

- [project](<https://docs.dhtmlx.com/planning-engine/java/api/project/overview.md>) - the [`Project`](<https://docs.dhtmlx.com/planning-engine/java/api/project/project.md>) handle, its options and [`Validation`](<https://docs.dhtmlx.com/planning-engine/java/api/project/validation.md>)
- [data](<https://docs.dhtmlx.com/planning-engine/java/api/data/overview.md>) - the input snapshot: [`ProjectData`](<https://docs.dhtmlx.com/planning-engine/java/api/data/project-data.md>), tasks, links, calendars, resources, assignments, [`Id`](<https://docs.dhtmlx.com/planning-engine/java/api/data/id.md>) and [`Moment`](<https://docs.dhtmlx.com/planning-engine/java/api/data/moment.md>)
- [changes](<https://docs.dhtmlx.com/planning-engine/java/api/changes/overview.md>) - edits for a live project: [`SchedulingChanges`](<https://docs.dhtmlx.com/planning-engine/java/api/changes/scheduling-changes.md>), the update records and [`Patch`](<https://docs.dhtmlx.com/planning-engine/java/api/changes/patch.md>)
- [results](<https://docs.dhtmlx.com/planning-engine/java/api/results/overview.md>) - [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/java/api/results/schedule-result.md>) and what it holds
- [resources](<https://docs.dhtmlx.com/planning-engine/java/api/resources/overview.md>) - load profiles and leveling
- [evaluate](<https://docs.dhtmlx.com/planning-engine/java/api/evaluate/overview.md>) - candidates, metrics and [`Execution`](<https://docs.dhtmlx.com/planning-engine/java/api/evaluate/execution.md>)
- [suggest](<https://docs.dhtmlx.com/planning-engine/java/api/suggest/overview.md>) - slots and auto-assignment results
- [assign](<https://docs.dhtmlx.com/planning-engine/java/api/assign/overview.md>) - the skill layer input: [`Pool`](<https://docs.dhtmlx.com/planning-engine/java/api/assign/pool.md>), [`Worker`](<https://docs.dhtmlx.com/planning-engine/java/api/assign/worker.md>), [`Skill`](<https://docs.dhtmlx.com/planning-engine/java/api/assign/skill.md>) and [`Requirement`](<https://docs.dhtmlx.com/planning-engine/java/api/assign/requirement.md>)
- [errors](<https://docs.dhtmlx.com/planning-engine/java/api/errors/overview.md>) - [`PlenException`](<https://docs.dhtmlx.com/planning-engine/java/api/errors/plen-exception.md>) and its subclasses, plus [`MatchException`](<https://docs.dhtmlx.com/planning-engine/java/api/errors/match-exception.md>)
- [json](<https://docs.dhtmlx.com/planning-engine/java/api/json/overview.md>) - the JSON API: [`JsonProject`](<https://docs.dhtmlx.com/planning-engine/java/api/json/json-project.md>), [`Wire`](<https://docs.dhtmlx.com/planning-engine/java/api/json/wire.md>), [`Decode`](<https://docs.dhtmlx.com/planning-engine/java/api/json/decode.md>), [`Encode`](<https://docs.dhtmlx.com/planning-engine/java/api/json/encode.md>) and [`Json`](<https://docs.dhtmlx.com/planning-engine/java/api/json/json.md>). See [Exchange JSON with a client](<https://docs.dhtmlx.com/planning-engine/java/how-to/exchange-json-with-a-client.md>)
- [support](<https://docs.dhtmlx.com/planning-engine/java/api/support/overview.md>) - [`ValueRecord`](<https://docs.dhtmlx.com/planning-engine/java/api/support/value-record.md>), [`Vec`](<https://docs.dhtmlx.com/planning-engine/java/api/support/vec.md>), [`SortedDict`](<https://docs.dhtmlx.com/planning-engine/java/api/support/sorted-dict.md>) and [`Ref`](<https://docs.dhtmlx.com/planning-engine/java/api/support/ref.md>)

Each call has its own page at the top of `api/`: the methods of [`Project`](<https://docs.dhtmlx.com/planning-engine/java/api/project/project.md>) and the static methods [`Engine.schedule`](<https://docs.dhtmlx.com/planning-engine/java/api/engine-schedule.md>) and [`SkillLayer.slots`](<https://docs.dhtmlx.com/planning-engine/java/api/skill-layer-slots.md>).

The library is a private Maven package.

```xml
<repositories>
  <repository>
    <id>plen</id>
    <url>{repository-url}</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>org.dhtmlx</groupId>
    <artifactId>plen</artifactId>
    <version>{version}</version>
  </dependency>
</dependencies>
```

```kotlin
repositories {
    maven { url = uri("{repository-url}") }
}

dependencies {
    implementation("org.dhtmlx:plen:{version}")
}
```

```java
import org.dhtmlx.plen.*;
```

The package also holds `Set`, `Queue`, `PriorityQueue`, `Array` and `Runtime`, which clash with `java.util` and `java.lang` names. Alongside a wildcard import of `java.util.*`, import the needed Planning Engine types by name. Other public classes in the package that this reference doesn't list are implementation details.

Every call is synchronous and CPU-only: no `CompletableFuture`, no I/O. Nothing is `AutoCloseable`. A `Project` isn't synchronized; see [Share a project between threads](<https://docs.dhtmlx.com/planning-engine/java/how-to/share-a-project-between-threads.md>) and [Call from async code](<https://docs.dhtmlx.com/planning-engine/java/how-to/call-from-async-code.md>).

Failures are unchecked exceptions, and no method declares `throws`. Invalid input throws [`InputException`](<https://docs.dhtmlx.com/planning-engine/java/api/errors/input-exception.md>), and a call that doesn't fit the project's state throws [`ProjectException`](<https://docs.dhtmlx.com/planning-engine/java/api/errors/project-exception.md>). Both extend [`PlenException`](<https://docs.dhtmlx.com/planning-engine/java/api/errors/plen-exception.md>). `SkillLayer.slots` throws [`MatchException`](<https://docs.dhtmlx.com/planning-engine/java/api/errors/match-exception.md>) instead. A `null` argument that isn't documented as nullable throws `NullPointerException`. Cycles, conflicts and rejected edits come back as data in the result. See [Error handling](<https://docs.dhtmlx.com/planning-engine/java/error-handling.md>) for which failures throw and which don't.

## Calls by task

| To | Call | Options | Returns |
|---|---|---|---|
| Load a live project or reschedule its edits | [`Project#solve`](<https://docs.dhtmlx.com/planning-engine/java/api/project-solve.md>) | [`SolveOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/project/solve-options.md>) | [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/java/api/results/schedule-result.md>) |
| See what an edit would do | [`Project#preview`](<https://docs.dhtmlx.com/planning-engine/java/api/project-preview.md>) | [`PreviewOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/project/preview-options.md>) | [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/java/api/results/schedule-result.md>) |
| Get critical path and slack without scheduling | [`Project#analyze`](<https://docs.dhtmlx.com/planning-engine/java/api/project-analyze.md>) | [`AnalyzeOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/project/analyze-options.md>) | [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/java/api/results/schedule-result.md>) |
| Commit an edit | [`Project#apply`](<https://docs.dhtmlx.com/planning-engine/java/api/project-apply.md>) | [`SchedulingChanges`](<https://docs.dhtmlx.com/planning-engine/java/api/changes/scheduling-changes.md>) | [`ApplyReport`](<https://docs.dhtmlx.com/planning-engine/java/api/changes/apply-report.md>) |
| Resolve resource overallocation | [`Project#level`](<https://docs.dhtmlx.com/planning-engine/java/api/project-level.md>) | [`LevelingOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/leveling-options.md>) | [`LevelingResult`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/leveling-result.md>) |
| Read resource load per day or hour | [`Project#loadProfile`](<https://docs.dhtmlx.com/planning-engine/java/api/project-load-profile.md>) | [`LoadProfileOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/load-profile-options.md>) | [`LoadProfile`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/load-profile.md>) |
| Compare alternative edits | [`Project#evaluate`](<https://docs.dhtmlx.com/planning-engine/java/api/project-evaluate.md>) | [`EvaluateOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/evaluate/evaluate-options.md>) | [`EvaluateResult`](<https://docs.dhtmlx.com/planning-engine/java/api/evaluate/evaluate-result.md>) |
| Compare alternative edits on several threads | [`Project#evaluateWith`](<https://docs.dhtmlx.com/planning-engine/java/api/project-evaluate.md#evaluatewith>) | [`EvaluateOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/evaluate/evaluate-options.md>), [`Execution`](<https://docs.dhtmlx.com/planning-engine/java/api/evaluate/execution.md>) | [`EvaluateResult`](<https://docs.dhtmlx.com/planning-engine/java/api/evaluate/evaluate-result.md>) |
| Pick resources for open positions | [`Project#suggestAssignments`](<https://docs.dhtmlx.com/planning-engine/java/api/project-suggest-assignments.md>) | [`SuggestOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/suggest/suggest-options.md>) | [`SuggestResult`](<https://docs.dhtmlx.com/planning-engine/java/api/suggest/suggest-result.md>) |
| Read tasks, resources and assignments for building slots | [`Project#roster`](<https://docs.dhtmlx.com/planning-engine/java/api/project-roster.md>) | - | [`Roster`](<https://docs.dhtmlx.com/planning-engine/java/api/suggest/roster.md>) |
| Schedule a snapshot once | [`Engine.schedule`](<https://docs.dhtmlx.com/planning-engine/java/api/engine-schedule.md>) | [`SolveOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/project/solve-options.md>) | [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/java/api/results/schedule-result.md>) |
| Build slots from skills and requirements | [`SkillLayer.slots`](<https://docs.dhtmlx.com/planning-engine/java/api/skill-layer-slots.md>) | [`Pool`](<https://docs.dhtmlx.com/planning-engine/java/api/assign/pool.md>), [`Requirement`](<https://docs.dhtmlx.com/planning-engine/java/api/assign/requirement.md>) | `Vec<`[`Slot`](<https://docs.dhtmlx.com/planning-engine/java/api/suggest/slot.md>)`>` |

`preview`, `loadProfile`, `evaluate`, `evaluateWith`, `suggestAssignments`, `roster` and `SkillLayer.slots` need a solved project. `evaluate`, `evaluateWith`, `suggestAssignments` and `SkillLayer.slots` also accept any `Collection` in place of `Vec`. The constructors and `copy()` are on the [`Project`](<https://docs.dhtmlx.com/planning-engine/java/api/project/project.md>) page.
