Ignore unavailable entity/operation classes
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
4011262fab
commit
99c30453dd
|
@ -22,6 +22,7 @@
|
||||||
namespace OCA\WorkflowEngine\AppInfo;
|
namespace OCA\WorkflowEngine\AppInfo;
|
||||||
|
|
||||||
use OCA\WorkflowEngine\Manager;
|
use OCA\WorkflowEngine\Manager;
|
||||||
|
use OCP\AppFramework\QueryException;
|
||||||
use OCP\Template;
|
use OCP\Template;
|
||||||
use OCA\WorkflowEngine\Controller\RequestTime;
|
use OCA\WorkflowEngine\Controller\RequestTime;
|
||||||
use OCP\WorkflowEngine\IEntity;
|
use OCP\WorkflowEngine\IEntity;
|
||||||
|
@ -89,12 +90,16 @@ class Application extends \OCP\AppFramework\App {
|
||||||
$eventName,
|
$eventName,
|
||||||
function (GenericEvent $event) use ($eventName, $operationClass, $entityClass) {
|
function (GenericEvent $event) use ($eventName, $operationClass, $entityClass) {
|
||||||
$ruleMatcher = $this->manager->getRuleMatcher();
|
$ruleMatcher = $this->manager->getRuleMatcher();
|
||||||
|
try {
|
||||||
/** @var IEntity $entity */
|
/** @var IEntity $entity */
|
||||||
$entity = $this->getContainer()->query($entityClass);
|
$entity = $this->getContainer()->query($entityClass);
|
||||||
$entity->prepareRuleMatcher($ruleMatcher, $eventName, $event);
|
$entity->prepareRuleMatcher($ruleMatcher, $eventName, $event);
|
||||||
/** @var IOperation $operation */
|
/** @var IOperation $operation */
|
||||||
$operation = $this->getContainer()->query($operationClass);
|
$operation = $this->getContainer()->query($operationClass);
|
||||||
$operation->onEvent($eventName, $event, $ruleMatcher);
|
$operation->onEvent($eventName, $event, $ruleMatcher);
|
||||||
|
} catch (QueryException $e) {
|
||||||
|
// Ignore query exceptions since they might occur when an entity/operation were setup before by an app that is disabled now
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}, $eventNames);
|
}, $eventNames);
|
||||||
|
|
Loading…
Reference in New Issue