ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SyncTaskManager.php
Go to the documentation of this file.
1<?php
2
20
27
40{
41 public function __construct(protected Persistence $persistence)
42 {
43 }
44
49 public function run(Bucket $bucket): void
50 {
51 $task = $bucket->getTask();
52 $bucket->setCurrentTask($task);
53 $observer = new NonPersistingObserver($bucket);
54
55 try {
56 $task = $this->executeTask($task, $observer);
57 if ($task instanceof UserInteraction && $task->canBeSkipped($task->getInput())) {
58 throw new UserInteractionSkippedException('can be skipped');
59 }
60 $bucket->setState(State::FINISHED);
62 $bucket->setState(State::FINISHED);
64 // We're okay!
65 $this->persistence->saveBucketAndItsTasks($bucket);
66 }
67 }
68}
run(Bucket $bucket)
This will add an Observer of the Task and start running the task.
executeTask(Task $task, Observer $observer)
Actually executes a task.
canBeSkipped(array $input)
Decide whether the UserInteraction is presented to the user and he has to decide or user UserInteract...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Option.php:19