63 $replace_thunk_values =
false;
64 foreach ($values as $value) {
65 if (is_a($value, ThunkValue::class)) {
66 $value = $this->
executeTask($value->getParentTask(), $observer);
67 $replace_thunk_values =
true;
69 $final_values[] = $value;
72 if ($replace_thunk_values) {
76 if (is_a($task, Task\Job::class)) {
80 $value = $job->run($final_values, $observer);
81 if (!$value->getType()->isExtensionOf($job->getOutputType())) {
82 throw new Exception(
"The job " . $job->getType()
83 .
" did state to output a value of type "
84 . $job->getOutputType() .
" but outputted a value of type "
92 if (is_a($task, Task\UserInteraction::class)) {
94 $user_interaction = $task;
96 if ($user_interaction->canBeSkipped($final_values)) {
97 if ($task->isFinal()) {
98 throw new UserInteractionSkippedException(
'Final interaction skipped');
100 return $task->getSkippedValue($task->
getInput());
105 throw new UserInteractionRequiredException(
"User interaction required.");
108 throw new Exception(
"You need to execute a Job or a UserInteraction.");
121 $this->persistence->deleteBucket($bucket);
130 $this->persistence->deleteBucket($bucket);
quitBucket(Bucket $bucket)
Quits and deletes a Bucket with all it's Jobs.
continueTask(Bucket $bucket, Option $option)
Continue a task with a given option.
__construct(Persistence $persistence)
userInteraction(Option $option)
Let the user interact with the bucket task queue.
notifyPercentage(Task $task, int $percentage)
You can change the progress of a currently running task.
notifyCurrentTask(Task $task)
If the current task changes notify the observer.
notifyState(int $state)
If the bucket goes into another state notify the observer.
executeTask(Task $task, Observer $observer)
Actually executes a task.
run(Bucket $bucket)
Depending on your background task settings, executes or puts the task into the queue.
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...