ChoreService
import { ChoreService } from "@skipcheck/tm1-client"; Chores: scheduled runs of processes, as ordered tasks. /Chores, their tasks,
and running them now.
A task binds a process (ChoreTaskPatch.Builder.bindProcess) and gives each of
its parameters a value; its Step, its place in the chore, is TM1's to number.
Create a daily chore with one task:
// A daily chore at 02:00 UTC, inactive until it's switched on. A task gives every
// parameter of its process a value.
const loadActuals = ChoreTaskPatch.builder()
.bindProcess(ODataPath.of("Processes").key("Load Sales"))
.parameters([
ChoreTaskParameterPatch.builder().name("pVersion").value("Actual").build(),
ChoreTaskParameterPatch.builder().name("pYear").value(2026).build(),
])
.build();
const nightly = ChorePatch.builder()
.name("Nightly Load")
.startTime("2026-01-01T02:00:00Z")
.dstSensitive(false)
.frequency(Tm1Duration.ofMillis(24 * 60 * 60 * 1000))
.executionMode(ChoreExecutionMode.SingleCommit)
.active(false)
.tasks([loadActuals])
.build();
return tm1.chores.create(nightly);
Add a task at the end, and get the step TM1 gave it:
// A task goes at the end; TM1 numbers the steps from 0
const loadForecast = ChoreTaskPatch.builder()
.bindProcess(ODataPath.of("Processes").key("Load Sales"))
.parameters([
ChoreTaskParameterPatch.builder().name("pVersion").value("Forecast").build(),
ChoreTaskParameterPatch.builder().name("pYear").value(2026).build(),
])
.build();
const task = await tm1.chores.addTask("Nightly Load", loadForecast);
return task.Step;
Schedule the chore, by patching Active:
// Scheduling a chore is a patch of Active
return tm1.chores.update("Nightly Load", ChorePatch.builder().active(true).build());
Members
list | GET Chores, streamed. |
get | GET Chores('name'), with what query expands, such as Tasks($expand=Process); a Tm1NotFoundException if there's none. |
create | Creates a chore, with its tasks if the patch has them. |
update | Changes the properties the patch sets, Active included, which IBM recommends over the deprecated activate. |
delete | DELETE Chores('name'); its processes stay. |
tasks | GET Chores('name')/Tasks, streamed, in step order. |
addTask | Adds a task at the end (its bound process and a value for each of the process's parameters); returns it as created, with the Step TM1 gave it. |
updateTask | Changes a task, such as its parameter values. |
deleteTask | DELETE Chores('name')/Tasks(step). |
taskProcess | The process the task runs. |
taskChore | The task's chore. |
execute | Runs the chore now, whether or not it's active, and settles when its tasks have run. |
activate | Schedules the chore. |
deactivate | Unschedules the chore. |
setServerLocalStartTime | Sets the chore's start in the server's time zone. |
list
list(query?: ODataQuery | null, options?: Tm1CallOptions): Tm1Stream<Chore>GET Chores, streamed.
TM1 REST EntitySet Chores
get
get(name: string, query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Chore>GET Chores('name'), with what query expands, such as Tasks($expand=Process); a Tm1NotFoundException if there's none.
TM1 REST EntitySet Chores
create
create(chore: ChorePatch, options?: Tm1CallOptions): Promise<Chore>POST Chores: creates a chore, with its tasks if the patch has them. It needs a name, start time, frequency and execution mode; returns the chore as created.
TM1 REST EntitySet Chores
update
update(name: string, patch: ChorePatch, etag?: string | null, options?: Tm1CallOptions): Promise<void>PATCH Chores('name'): changes the properties the patch sets, Active included, which IBM recommends over the deprecated activate. Adding, changing or removing a task changes the chore's ETag too. With etag (chore["@odata.etag"]), sent as If-Match: only if the chore hasn't changed since, else a Tm1PreconditionFailedException.
TM1 REST EntitySet Chores
delete
delete(name: string, options?: Tm1CallOptions): Promise<void>DELETE Chores('name'); its processes stay.
TM1 REST EntitySet Chores
tasks
tasks(name: string, query?: ODataQuery | null, options?: Tm1CallOptions): Tm1Stream<ChoreTask>GET Chores('name')/Tasks, streamed, in step order.
TM1 REST Navigation Chore/Tasks
addTask
addTask(name: string, task: ChoreTaskPatch, options?: Tm1CallOptions): Promise<ChoreTask>POST Chores('name')/Tasks: adds a task at the end (its bound process and a value for each of the process's parameters); returns it as created, with the Step TM1 gave it.
TM1 REST Navigation Chore/Tasks
updateTask
updateTask(name: string, step: number, patch: ChoreTaskPatch, options?: Tm1CallOptions): Promise<void>PATCH Chores('name')/Tasks(step): changes a task, such as its parameter values.
TM1 REST Navigation Chore/Tasks
deleteTask
deleteTask(name: string, step: number, options?: Tm1CallOptions): Promise<void>DELETE Chores('name')/Tasks(step).
TM1 REST Navigation Chore/Tasks
taskProcess
taskProcess(name: string, step: number, query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Process>GET Chores('name')/Tasks(step)/Process: the process the task runs.
TM1 REST Navigation ChoreTask/Process
taskChore
taskChore(name: string, step: number, query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Chore>GET Chores('name')/Tasks(step)/Chore: the task's chore.
TM1 REST Navigation ChoreTask/Chore
execute
execute(name: string, options?: Tm1CallOptions): Promise<void>tm1.Execute: runs the chore now, whether or not it's active, and settles when its tasks have run. Needs schema 10.2.2.2.
TM1 REST Action Chore/Execute
activate
activate(name: string, options?: Tm1CallOptions): Promise<void>tm1.Activate: schedules the chore.
TM1 REST Action Chore/Activate
deactivate
deactivate(name: string, options?: Tm1CallOptions): Promise<void>tm1.Deactivate: unschedules the chore.
TM1 REST Action Chore/Deactivate
setServerLocalStartTime
setServerLocalStartTime(name: string, date: string, time: string, options?: Tm1CallOptions): Promise<void>tm1.SetServerLocalStartTime: sets the chore's start in the server's time zone: date as 2026-01-02, time as 02:00 or 02:00:30 (Java's LocalDate and LocalTime, sent as their toString writes them). TM1 (11.8) refuses it while the chore is active ("Can't duplicate active chore", code 7): deactivate it first.
TM1 REST Action Chore/SetServerLocalStartTime