ChoreService
import io.skipcheck.tm1.client.service.process.ChoreService; 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.
ChoreTaskPatch loadActuals = ChoreTaskPatch.builder()
.bindProcess(ODataPath.of("Processes").key("Load Sales"))
.parameters(List.of(ChoreTaskParameterPatch.builder().name("pVersion").value("Actual").build(),
ChoreTaskParameterPatch.builder().name("pYear").value(2026).build()))
.build();
return tm1.chores()
.create(ChorePatch.builder()
.name("Nightly Load")
.startTime(OffsetDateTime.parse("2026-01-01T02:00:00Z"))
.dstSensitive(false)
.frequency(Duration.ofDays(1))
.executionMode(ChoreExecutionMode.SINGLE_COMMIT)
.active(false)
.tasks(List.of(loadActuals))
.build());
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
ChoreTaskPatch loadForecast = ChoreTaskPatch.builder()
.bindProcess(ODataPath.of("Processes").key("Load Sales"))
.parameters(List.of(ChoreTaskParameterPatch.builder().name("pVersion").value("Forecast").build(),
ChoreTaskParameterPatch.builder().name("pYear").value(2026).build()))
.build();
return tm1.chores().addTask("Nightly Load", loadForecast).mapNotNull(ChoreTask::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
ChoreService constructor | A service sending its requests through session. |
list | GET Chores, streamed. |
get | GET Chores('name'). |
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. |
update | PATCH Chores('name') with If-Match. |
delete | DELETE Chores('name'); its processes stay. |
tasks | GET Chores('name')/Tasks, streamed, in step order. |
addTask | Adds a task at the end. |
updateTask | Changes a task, such as its parameter values. |
deleteTask | DELETE Chores('name')/Tasks(step). |
taskProcess | GET Chores('name')/Tasks(step)/Process. |
taskChore | GET Chores('name')/Tasks(step)/Chore. |
execute | Runs the chore now, whether or not it's active, and completes 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. |
ChoreService
constructorChoreService(Tm1Session session) A service sending its requests through session.
Parameters
session- the session
list
Flux<Chore> list(ODataQuery query) GET Chores, streamed.
Parameters
query- what to select, expand, filter and order
Returns
- the chores
TM1 REST EntitySet Chores
get
Mono<Chore> get(String name, ODataQuery query) GET Chores('name').
Parameters
name- the chore's name
query- what to select and expand, such as
Tasks($expand=Process)
Returns
- the chore, or a
Tm1NotFoundExceptionif there's none
TM1 REST EntitySet Chores
create
Mono<Chore> create(ChorePatch chore) POST Chores: creates a chore, with its tasks if the patch has them.
Parameters
chore- the new chore; it needs a name, start time, frequency and execution mode
Returns
- the chore as created
TM1 REST EntitySet Chores
update
Mono<Void> update(String name, ChorePatch patch) 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.
Parameters
name- the chore's name
patch- the changes
Returns
- completes when the chore is changed
TM1 REST EntitySet Chores
update
Mono<Void> update(String name, ChorePatch patch, String etag) PATCH Chores('name') with If-Match.
Parameters
name- the chore's name
patch- the changes
etag- the ETag the chore was read with (
Chore.etag)
Returns
- completes when the chore is changed, or a
Tm1PreconditionFailedExceptionif it had changed
TM1 REST EntitySet Chores
delete
Mono<Void> delete(String name) DELETE Chores('name'); its processes stay.
Parameters
name- the chore's name
Returns
- completes when the chore is deleted
TM1 REST EntitySet Chores
tasks
Flux<ChoreTask> tasks(String name, ODataQuery query) GET Chores('name')/Tasks, streamed, in step order.
Parameters
name- the chore's name
query- what to select and expand, such as
Process
Returns
- the tasks
TM1 REST Navigation Chore/Tasks
addTask
Mono<ChoreTask> addTask(String name, ChoreTaskPatch task) POST Chores('name')/Tasks: adds a task at the end.
Parameters
name- the chore's name
task- the task: its bound process and a value for each of the process's parameters
Returns
- the task as created, with the
StepTM1 gave it
TM1 REST Navigation Chore/Tasks
updateTask
Mono<Void> updateTask(String name, long step, ChoreTaskPatch patch) PATCH Chores('name')/Tasks(step): changes a task, such as its parameter
values.
Parameters
name- the chore's name
step- the task's step
patch- the changes
Returns
- completes when the task is changed
TM1 REST Navigation Chore/Tasks
deleteTask
Mono<Void> deleteTask(String name, long step) DELETE Chores('name')/Tasks(step).
Parameters
name- the chore's name
step- the task's step
Returns
- completes when the task is removed
TM1 REST Navigation Chore/Tasks
taskProcess
Mono<Process> taskProcess(String name, long step, ODataQuery query) GET Chores('name')/Tasks(step)/Process.
Parameters
name- the chore's name
step- the task's step
query- what to select
Returns
- the process the task runs
TM1 REST Navigation ChoreTask/Process
taskChore
Mono<Chore> taskChore(String name, long step, ODataQuery query) GET Chores('name')/Tasks(step)/Chore.
Parameters
name- the chore's name
step- the task's step
query- what to select
Returns
- the task's chore
TM1 REST Navigation ChoreTask/Chore
execute
Mono<Void> execute(String name) tm1.Execute: runs the chore now, whether or not it's active, and completes
when its tasks have run. Needs schema 10.2.2.2.
Parameters
name- the chore's name
Returns
- completes when the chore has run
TM1 REST Action Chore/Execute
activate
Mono<Void> activate(String name) tm1.Activate: schedules the chore.
Parameters
name- the chore's name
Returns
- completes when it's active
TM1 REST Action Chore/Activate
deactivate
Mono<Void> deactivate(String name) tm1.Deactivate: unschedules the chore.
Parameters
name- the chore's name
Returns
- completes when it's inactive
TM1 REST Action Chore/Deactivate
setServerLocalStartTime
Mono<Void> setServerLocalStartTime(String name, LocalDate date, LocalTime time) tm1.SetServerLocalStartTime: sets the chore's start in the server's time
zone. TM1 (11.8) refuses it while the chore is active ("Can't duplicate active
chore", code 7): deactivate it first.
Parameters
name- the chore's name
date- the start date
time- the start time of day
Returns
- completes when it's set
TM1 REST Action Chore/SetServerLocalStartTime
Also in the Javadoc.