ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
SyncTaskManager.php
Go to the documentation of this file.
1<?php
2
4
11
29{
30
34 protected $persistence;
35
36
38 {
39 $this->persistence = $persistence;
40 }
41
42
52 public function run(Bucket $bucket)
53 {
54 $task = $bucket->getTask();
55 $bucket->setCurrentTask($task);
56 $observer = new NonPersistingObserver($bucket);
57
58 try {
59 $task = $this->executeTask($task, $observer);
60 if($task instanceof UserInteraction && $task->canBeSkipped($task->getInput())) {
61 throw new UserInteractionSkippedException('can be skipped');
62 }
63 $bucket->setState(State::FINISHED);
65 $bucket->setState(State::FINISHED);
67 // We're okay!
68 $this->persistence->saveBucketAndItsTasks($bucket);
69 }
70 }
71}
An exception for terminatinating execution or to throw for unit testing.
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...