skipcheck

TM1 client · Docs · Processes and chores

ChoreService

using Skipcheck.Tm1.Client.Services;

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.
var 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();
return await tm1.Chores.CreateAsync(
    ChorePatch
        .Builder()
        .Name("Nightly Load")
        .StartTime(new DateTimeOffset(2026, 1, 1, 2, 0, 0, TimeSpan.Zero))
        .DstSensitive(false)
        .Frequency(TimeSpan.FromDays(1))
        .ExecutionMode(ChoreExecutionMode.SingleCommit)
        .Active(false)
        .Tasks([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
var 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();
var task = await tm1.Chores.AddTaskAsync("Nightly Load", loadForecast);
return task.Step;

Schedule the chore, by patching Active:

// Scheduling a chore is a patch of Active
await tm1.Chores.UpdateAsync("Nightly Load", ChorePatch.Builder().Active(true).Build());

Members

ChoreService constructorA service that sends its requests through session.
ListAsyncGET Chores, streamed.
GetAsyncGET Chores('name').
CreateAsyncCreates a chore, with its tasks if the patch has them.
UpdateAsyncChanges the properties the patch sets, Active included, which IBM recommends over the deprecated ActivateAsync.
UpdateAsyncPATCH Chores('name') with If-Match.
DeleteAsyncDELETE Chores('name'); its processes stay.
TasksAsyncGET Chores('name')/Tasks, streamed, in step order.
AddTaskAsyncAdds a task at the end.
UpdateTaskAsyncChanges a task, such as its parameter values.
DeleteTaskAsyncDELETE Chores('name')/Tasks(step).
TaskProcessAsyncGET Chores('name')/Tasks(step)/Process.
TaskChoreAsyncGET Chores('name')/Tasks(step)/Chore.
ExecuteAsyncRuns the chore now, whether or not it's active, and completes when its tasks have run.
ActivateAsyncSchedules the chore.
DeactivateAsyncUnschedules the chore.
SetServerLocalStartTimeAsyncSets the chore's start in the server's time zone.

ChoreService

constructor
ChoreService(Tm1Session session)

A service that sends its requests through session.

ListAsync

IAsyncEnumerable<Chore> ListAsync(ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Chores, streamed.

TM1 REST EntitySet Chores

GetAsync

Task<Chore> GetAsync(string name, ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Chores('name').

TM1 REST EntitySet Chores

CreateAsync

Task<Chore> CreateAsync(ChorePatch chore, CancellationToken cancellationToken = default)

POST Chores: creates a chore, with its tasks if the patch has them.

TM1 REST EntitySet Chores

UpdateAsync

Task UpdateAsync(string name, ChorePatch patch, CancellationToken cancellationToken = default)

PATCH Chores('name'): changes the properties the patch sets, Active included, which IBM recommends over the deprecated ActivateAsync. Adding, changing or removing a task changes the chore's ETag too.

TM1 REST EntitySet Chores

UpdateAsync

Task UpdateAsync(string name, ChorePatch patch, string etag, CancellationToken cancellationToken = default)

PATCH Chores('name') with If-Match: only if the chore hasn't changed since it was read with etag, else a Tm1PreconditionFailedException.

TM1 REST EntitySet Chores

DeleteAsync

Task DeleteAsync(string name, CancellationToken cancellationToken = default)

DELETE Chores('name'); its processes stay.

TM1 REST EntitySet Chores

TasksAsync

IAsyncEnumerable<ChoreTask> TasksAsync(string name, ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Chores('name')/Tasks, streamed, in step order.

TM1 REST Navigation Chore/Tasks

AddTaskAsync

Task<ChoreTask> AddTaskAsync(string name, ChoreTaskPatch task, CancellationToken cancellationToken = default)

POST Chores('name')/Tasks: adds a task at the end. TM1 (11.8) needs a value for every parameter of the task's process.

TM1 REST Navigation Chore/Tasks

UpdateTaskAsync

Task UpdateTaskAsync(string name, long step, ChoreTaskPatch patch, CancellationToken cancellationToken = default)

PATCH Chores('name')/Tasks(step): changes a task, such as its parameter values.

TM1 REST Navigation Chore/Tasks

DeleteTaskAsync

Task DeleteTaskAsync(string name, long step, CancellationToken cancellationToken = default)

DELETE Chores('name')/Tasks(step). TM1 (11.8) renumbers the steps after it.

TM1 REST Navigation Chore/Tasks

TaskProcessAsync

Task<Process> TaskProcessAsync(string name, long step, ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Chores('name')/Tasks(step)/Process.

TM1 REST Navigation ChoreTask/Process

TaskChoreAsync

Task<Chore> TaskChoreAsync(string name, long step, ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Chores('name')/Tasks(step)/Chore.

TM1 REST Navigation ChoreTask/Chore

ExecuteAsync

Task ExecuteAsync(string name, CancellationToken cancellationToken = default)

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.

TM1 REST Action Chore/Execute

ActivateAsync

Task ActivateAsync(string name, CancellationToken cancellationToken = default)

tm1.Activate: schedules the chore. Deprecated in TM1 schema 11.8.3: patch Active with UpdateAsync.

TM1 REST Action Chore/Activate

DeactivateAsync

Task DeactivateAsync(string name, CancellationToken cancellationToken = default)

tm1.Deactivate: unschedules the chore. Deprecated in TM1 schema 11.8.3: patch Active with UpdateAsync.

TM1 REST Action Chore/Deactivate

SetServerLocalStartTimeAsync

Task SetServerLocalStartTimeAsync(string name, DateOnly date, TimeOnly time, CancellationToken cancellationToken = default)

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. Deprecated in TM1 schema 11.8.3: patch StartTime with UpdateAsync.

TM1 REST Action Chore/SetServerLocalStartTime