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:

Each call has its own page at the top of api/: the methods of Project and the static methods Engine.schedule and SkillLayer.slots.

The library is a private Maven package.

<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>
repositories {
    maven { url = uri("{repository-url}") }
}

dependencies {
    implementation("org.dhtmlx:plen:{version}")
}
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 and Call from async code.

Failures are unchecked exceptions, and no method declares throws. Invalid input throws InputException, and a call that doesn't fit the project's state throws ProjectException. Both extend PlenException. SkillLayer.slots throws MatchException 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 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 SolveOptions ScheduleResult
See what an edit would do Project#preview PreviewOptions ScheduleResult
Get critical path and slack without scheduling Project#analyze AnalyzeOptions ScheduleResult
Commit an edit Project#apply SchedulingChanges ApplyReport
Resolve resource overallocation Project#level LevelingOptions LevelingResult
Read resource load per day or hour Project#loadProfile LoadProfileOptions LoadProfile
Compare alternative edits Project#evaluate EvaluateOptions EvaluateResult
Compare alternative edits on several threads Project#evaluateWith EvaluateOptions, Execution EvaluateResult
Pick resources for open positions Project#suggestAssignments SuggestOptions SuggestResult
Read tasks, resources and assignments for building slots Project#roster - Roster
Schedule a snapshot once Engine.schedule SolveOptions ScheduleResult
Build slots from skills and requirements SkillLayer.slots Pool, Requirement Vec<Slot>

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 page.