Class ChoreService
java.lang.Object
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());
-
Constructor Summary
ConstructorsConstructorDescriptionChoreService(Tm1Session session) A service sending its requests throughsession. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void> Deprecated.reactor.core.publisher.Mono<ChoreTask> addTask(String name, ChoreTaskPatch task) POST Chores('name')/Tasks: adds a task at the end.reactor.core.publisher.Mono<Chore> create(ChorePatch chore) POST Chores: creates a chore, with its tasks if the patch has them.reactor.core.publisher.Mono<Void> deactivate(String name) Deprecated.Deprecated in TM1 schema 11.8.3: patchActivewithupdate(String, ChorePatch).reactor.core.publisher.Mono<Void> DELETE Chores('name'); its processes stay.reactor.core.publisher.Mono<Void> deleteTask(String name, long step) DELETE Chores('name')/Tasks(step).reactor.core.publisher.Mono<Void> tm1.Execute: runs the chore now, whether or not it's active, and completes when its tasks have run.reactor.core.publisher.Mono<Chore> get(String name, ODataQuery query) GET Chores('name').reactor.core.publisher.Flux<Chore> list(ODataQuery query) GET Chores, streamed.reactor.core.publisher.Mono<Void> setServerLocalStartTime(String name, LocalDate date, LocalTime time) Deprecated.Deprecated in TM1 schema 11.8.3: patchStartTimewithupdate(String, ChorePatch).reactor.core.publisher.Mono<Chore> taskChore(String name, long step, ODataQuery query) GET Chores('name')/Tasks(step)/Chore.reactor.core.publisher.Mono<Process> taskProcess(String name, long step, ODataQuery query) GET Chores('name')/Tasks(step)/Process.reactor.core.publisher.Flux<ChoreTask> tasks(String name, ODataQuery query) GET Chores('name')/Tasks, streamed, in step order.reactor.core.publisher.Mono<Void> update(String name, ChorePatch patch) PATCH Chores('name'): changes the properties the patch sets,Activeincluded, which IBM recommends over the deprecatedactivate(String).reactor.core.publisher.Mono<Void> update(String name, ChorePatch patch, String etag) PATCH Chores('name')withIf-Match.reactor.core.publisher.Mono<Void> updateTask(String name, long step, ChoreTaskPatch patch) PATCH Chores('name')/Tasks(step): changes a task, such as its parameter values.
-
Constructor Details
-
ChoreService
A service sending its requests throughsession.- Parameters:
session- the session
-
-
Method Details
-
list
GET Chores, streamed.- Parameters:
query- what to select, expand, filter and order- Returns:
- the chores
-
get
@Tm1Endpoint("EntitySet Chores") public reactor.core.publisher.Mono<Chore> get(String name, ODataQuery query) GET Chores('name').- Parameters:
name- the chore's namequery- what to select and expand, such asTasks($expand=Process)- Returns:
- the chore, or a
Tm1NotFoundExceptionif there's none
-
create
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
-
update
@Tm1Endpoint("EntitySet Chores") public reactor.core.publisher.Mono<Void> update(String name, ChorePatch patch) PATCH Chores('name'): changes the properties the patch sets,Activeincluded, which IBM recommends over the deprecatedactivate(String). Adding, changing or removing a task changes the chore's ETag too.- Parameters:
name- the chore's namepatch- the changes- Returns:
- completes when the chore is changed
-
update
@Tm1Endpoint("EntitySet Chores") public reactor.core.publisher.Mono<Void> update(String name, ChorePatch patch, String etag) PATCH Chores('name')withIf-Match.- Parameters:
name- the chore's namepatch- the changesetag- the ETag the chore was read with (Chore.etag())- Returns:
- completes when the chore is changed, or a
Tm1PreconditionFailedExceptionif it had changed
-
delete
DELETE Chores('name'); its processes stay.- Parameters:
name- the chore's name- Returns:
- completes when the chore is deleted
-
tasks
@Tm1Endpoint("Navigation Chore/Tasks") public reactor.core.publisher.Flux<ChoreTask> tasks(String name, ODataQuery query) GET Chores('name')/Tasks, streamed, in step order.- Parameters:
name- the chore's namequery- what to select and expand, such asProcess- Returns:
- the tasks
-
addTask
@Tm1Endpoint("Navigation Chore/Tasks") public reactor.core.publisher.Mono<ChoreTask> addTask(String name, ChoreTaskPatch task) POST Chores('name')/Tasks: adds a task at the end.- Parameters:
name- the chore's nametask- 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
-
updateTask
@Tm1Endpoint("Navigation Chore/Tasks") public reactor.core.publisher.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 namestep- the task's steppatch- the changes- Returns:
- completes when the task is changed
-
deleteTask
@Tm1Endpoint("Navigation Chore/Tasks") public reactor.core.publisher.Mono<Void> deleteTask(String name, long step) DELETE Chores('name')/Tasks(step).- Parameters:
name- the chore's namestep- the task's step- Returns:
- completes when the task is removed
-
taskProcess
@Tm1Endpoint("Navigation ChoreTask/Process") public reactor.core.publisher.Mono<Process> taskProcess(String name, long step, ODataQuery query) GET Chores('name')/Tasks(step)/Process.- Parameters:
name- the chore's namestep- the task's stepquery- what to select- Returns:
- the process the task runs
-
taskChore
@Tm1Endpoint("Navigation ChoreTask/Chore") public reactor.core.publisher.Mono<Chore> taskChore(String name, long step, ODataQuery query) GET Chores('name')/Tasks(step)/Chore.- Parameters:
name- the chore's namestep- the task's stepquery- what to select- Returns:
- the task's chore
-
execute
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
-
activate
@Deprecated(since="11.8.3") @Tm1Endpoint("Action Chore/Activate") public reactor.core.publisher.Mono<Void> activate(String name) Deprecated.Deprecated in TM1 schema 11.8.3: patchActivewithupdate(String, ChorePatch).tm1.Activate: schedules the chore.- Parameters:
name- the chore's name- Returns:
- completes when it's active
-
deactivate
@Deprecated(since="11.8.3") @Tm1Endpoint("Action Chore/Deactivate") public reactor.core.publisher.Mono<Void> deactivate(String name) Deprecated.Deprecated in TM1 schema 11.8.3: patchActivewithupdate(String, ChorePatch).tm1.Deactivate: unschedules the chore.- Parameters:
name- the chore's name- Returns:
- completes when it's inactive
-
setServerLocalStartTime
@Deprecated(since="11.8.3") @Tm1Endpoint("Action Chore/SetServerLocalStartTime") public reactor.core.publisher.Mono<Void> setServerLocalStartTime(String name, LocalDate date, LocalTime time) Deprecated.Deprecated in TM1 schema 11.8.3: patchStartTimewithupdate(String, ChorePatch).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 namedate- the start datetime- the start time of day- Returns:
- completes when it's set
-
Activewithupdate(String, ChorePatch).