storeProvider.getUnsafeTaskStore().mutateTasks(query, new TaskMutation() {
@Override
public IScheduledTask apply(IScheduledTask task) {
ScheduledTask mutableTask = task.newBuilder();
mutableTask.setStatus(targetState.get());
mutableTask.addToTaskEvents(new TaskEvent()
.setTimestamp(clock.nowMillis())
.setStatus(targetState.get())
.setMessage(transitionMessage.orNull())
.setScheduler(LOCAL_HOST_SUPPLIER.get()));
return IScheduledTask.build(mutableTask);