57 if ($this->definitionsLoaded) {
60 $this->definitionsLoaded =
true;
62 $query =
'SELECT workflow_class, COUNT(workflow_id) total, SUM(active) active 64 GROUP BY workflow_class';
69 $stats[
$row[
'workflow_class']] = array(
'total' => $row[
'total'],
'active' => $row[
'active']);
72 if (!$this->fs->storage()->hasDir($this->path)) {
73 $this->definitions = array();
77 $contents = $this->fs->storage()->listContents($this->path,
false);
78 $contents = array_filter($contents,
function (
ILIAS\
Filesystem\DTO\Metadata $file) {
79 if (!$file->isFile()) {
83 $fileParts = pathinfo($file->getPath());
85 return $fileParts[
'extension'] === self::FILE_EXTENSTION_BPMN2;
88 $prefixLength = strlen(self::FILE_PREFIX);
91 foreach ($contents as $file) {
92 $fileParts = pathinfo($file->getPath());
93 $extensionLength = strlen($fileParts[
'extension']) + 1;
97 $definition[
'file'] = $fileParts[
'basename'];
98 $definition[
'id'] = $fileParts[
'filename'];
100 $parts = explode(
'_', substr($fileParts[
'basename'], $prefixLength, $extensionLength * -1));
102 $definition[
'status'] = 1;
103 if (!$this->fs->storage()->has($this->path .
'/' . $definition[
'id'] .
'.php')) {
104 $definition[
'status'] = 0;
106 $definition[
'version'] = substr(array_pop($parts), 1);
107 $definition[
'title'] = implode(
' ', $parts);
108 $definition[
'instances'] =
$stats[$definition[
'id'] .
'.php'];
132 return isset($this->definitions[
$id]);
144 throw new \ilWorkflowEngineException(sprintf(
"Could not find definition for id: %s",
$id));
147 return $this->definitions[
$id];
const FILE_EXTENSTION_BPMN2
__construct(\ilDBInterface $db, \ILIAS\Filesystem\Filesystems $fs, $path)
ilWorkflowDefinitionRepository constructor.
if(!array_key_exists('StateId', $_REQUEST)) $id
Class ilWorkflowDefinitionRepository.
lazyLoadWorkflowDefinitions()
const FILE_EXTENSTION_PHP
Class FlySystemFileAccessTest.