Skip to content

Commit

Permalink
NC 18 Workflow integration #10
Browse files Browse the repository at this point in the history
  • Loading branch information
Rello committed Jan 6, 2020
1 parent 4ce6d3d commit 3334e19
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/Flow/Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@

use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IURLGenerator;
use OCP\Util;
use OCP\WorkflowEngine\EntityContext\IDisplayText;
use OCP\WorkflowEngine\EntityContext\IUrl;
use OCP\WorkflowEngine\IEntity;
use OCP\WorkflowEngine\IManager as FlowManager;
use OCP\WorkflowEngine\IManager;
use OCP\WorkflowEngine\IOperation;
use OCP\WorkflowEngine\IRuleMatcher;
use Symfony\Component\EventDispatcher\GenericEvent;
Expand All @@ -28,18 +27,26 @@
class Operation implements IOperation
{

/** @var IL10N */
private $l;
/** @var IURLGenerator */
private $urlGenerator;
private $logger;

public function __construct(
IL10N $l,
IURLGenerator $urlGenerator,
ILogger $logger
)
{
$this->l = $l;
$this->urlGenerator = $urlGenerator;
$this->logger = $logger;
}

public static function register(IEventDispatcher $dispatcher): void
{
$dispatcher->addListener(FlowManager::EVENT_NAME_REG_OPERATION, function (GenericEvent $event) {
$dispatcher->addListener(IManager::EVENT_NAME_REG_OPERATION, function (GenericEvent $event) {
$operation = \OC::$server->query(Operation::class);
$event->getSubject()->registerOperation($operation);
Util::addScript('analytics', 'flow');
Expand Down

0 comments on commit 3334e19

Please sign in to comment.