MaestroEndTask.php in Maestro 8.2
File
src/Plugin/EngineTasks/MaestroEndTask.php
View source
<?php
namespace Drupal\maestro\Plugin\EngineTasks;
use Drupal\Core\Plugin\PluginBase;
use Drupal\maestro\MaestroEngineTaskInterface;
use Drupal\maestro\Engine\MaestroEngine;
use Drupal\maestro\MaestroTaskTrait;
use Drupal\Core\Form\FormStateInterface;
use Drupal\maestro\Form\MaestroExecuteInteractive;
class MaestroEndTask extends PluginBase implements MaestroEngineTaskInterface {
use MaestroTaskTrait;
public function __construct($configuration = NULL) {
if (is_array($configuration)) {
$this->processID = $configuration[0];
$this->queueID = $configuration[1];
}
}
public function isInteractive() {
return FALSE;
}
public function shortDescription() {
return t('End Task');
}
public function description() {
return $this
->t('End Task.');
}
public function getPluginId() {
return 'MaestroEnd';
}
public function getTaskColours() {
return '#ff0000';
}
public function execute() {
if ($this->processID > 0) {
MaestroEngine::endProcess($this->processID);
return TRUE;
}
else {
return FALSE;
}
}
public function getExecutableForm($modal, MaestroExecuteInteractive $parent) {
}
public function handleExecuteSubmit(array &$form, FormStateInterface $form_state) {
}
public function getTaskEditForm(array $task, $templateMachineName) {
$form = [
'#markup' => '',
];
return $form;
}
public function validateTaskEditForm(array &$form, FormStateInterface $form_state) {
}
public function prepareTaskForSave(array &$form, FormStateInterface $form_state, array &$task) {
}
public function performValidityCheck(array &$validation_failure_tasks, array &$validation_information_tasks, array $task) {
}
public function getTemplateBuilderCapabilities() {
return [
'edit',
'removelines',
'remove',
];
}
}