62 $replace_thunk_values =
false;
63 foreach ($values as $value) {
65 $value = $this->
executeTask($value->getParentTask(), $observer);
66 $replace_thunk_values =
true;
68 $final_values[] = $value;
71 if ($replace_thunk_values) {
75 if ($task instanceof Job) {
79 $value = $job->run($final_values, $observer);
80 if (!$value->getType()->isExtensionOf($job->getOutputType())) {
81 throw new Exception(
"The job " . $job->getType()
82 .
" did state to output a value of type "
83 . $job->getOutputType() .
" but outputted a value of type "
91 if ($task instanceof UserInteraction) {
93 $user_interaction = $task;
95 if ($user_interaction->canBeSkipped($final_values)) {
96 if ($task->isFinal()) {
97 throw new UserInteractionSkippedException(
'Final interaction skipped');
99 return $task->getSkippedValue($task->
getInput());
104 throw new UserInteractionRequiredException(
"User interaction required.");
107 throw new Exception(
"You need to execute a Job or a UserInteraction.");
120 $this->persistence->deleteBucket($bucket);
129 $this->persistence->deleteBucket($bucket);
quitBucket(Bucket $bucket)
Quits and deletes a Bucket with all it's Jobs.
__construct(protected Persistence $persistence)
continueTask(Bucket $bucket, Option $option)
Continue a task with a given option.
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...