ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilActivationEmitter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3
5require_once './Services/WorkflowEngine/interfaces/ilEmitter.php';
7require_once './Services/WorkflowEngine/interfaces/ilDetector.php';
9require_once './Services/WorkflowEngine/interfaces/ilNode.php';
11require_once './Services/WorkflowEngine/interfaces/ilWorkflowEngineElement.php';
12
33{
40
46 private $context;
47
49 private $emitted;
50
52 protected $name;
53
59 public function __construct(ilNode $context)
60 {
61 $this->context = $context;
62 $this->emitted = false;
63 }
64
70 public function setTargetDetector(ilDetector $a_target_detector)
71 {
72 $this->target_detector = $a_target_detector;
73 }
74
80 public function getTargetDetector()
81 {
83 }
84
90 public function getContext()
91 {
92 return $this->context;
93 }
94
98 public function emit()
99 {
100 $this->emitted = true;
101 $target_node = $this->target_detector->getContext();
102 $target_node->activate();
103 $this->target_detector->trigger(array());
104 }
105
109 public function getActivated()
110 {
111 return $this->emitted;
112 }
113
117 public function setName($name)
118 {
119 $this->name = $name;
120 }
121
125 public function getName()
126 {
127 return $this->name;
128 }
129}
An exception for terminatinating execution or to throw for unit testing.
@noinspection PhpIncludeInspection
setTargetDetector(ilDetector $a_target_detector)
Sets the target detector for this emitter.
getTargetDetector()
Gets the currently set target detector of this emitter.
getContext()
Returns a reference to the parent node of this emitter.
__construct(ilNode $context)
Default constructor.
emit()
Executes this emitter after activating the target node.
ilDetector Interface is part of the petri net based workflow engine.
Definition: ilDetector.php:17
ilEmitter Interface is part of the petri net based workflow engine.
Definition: ilEmitter.php:17
@noinspection PhpIncludeInspection
Definition: ilNode.php:26
ilWorkflowEngineElement Interface is part of the petri net based workflow engine.