ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilBaseNode.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/ilNode.php';
7require_once './Services/WorkflowEngine/interfaces/ilEmitter.php';
9require_once './Services/WorkflowEngine/interfaces/ilDetector.php';
11require_once './Services/WorkflowEngine/interfaces/ilActivity.php';
13require_once './Services/WorkflowEngine/interfaces/ilWorkflow.php';
14
22abstract class ilBaseNode implements ilNode
23{
29 protected $context;
30
36 protected $detectors;
37
43 protected $emitters;
44
50 protected $activities;
51
57 protected $active = false;
58
60 protected $name;
61
63 protected $runtime_vars;
64
70 public function addDetector(ilDetector $detector)
71 {
72 $this->detectors[] = $detector;
73 $this->context->registerDetector($detector);
74 }
75
81 public function getDetectors()
82 {
83 return $this->detectors;
84 }
85
91 public function addEmitter(ilEmitter $emitter)
92 {
93 $this->emitters[] = $emitter;
94 }
95
101 public function getEmitters()
102 {
103 return $this->emitters;
104 }
105
111 public function addActivity(ilActivity $activity)
112 {
113 $this->activities[] = $activity;
114 }
115
121 public function getActivities()
122 {
123 return $this->activities;
124 }
125
131 public function getContext()
132 {
133 return $this->context;
134 }
135
136 /***
137 * @param string $name
138 */
139 public function setName($name)
140 {
141 $this->name = $name;
142 }
143
147 public function getName()
148 {
149 return $this->name;
150 }
151
155 public function getRuntimeVars()
156 {
157 return $this->runtime_vars;
158 }
159
164 {
165 $this->runtime_vars = $runtime_vars;
166 }
167
173 public function getRuntimeVar($name)
174 {
175 return $this->runtime_vars[$name];
176 }
177
182 public function setRuntimeVar($name, $value)
183 {
184 $this->runtime_vars[$name] = $value;
185 }
186
192 public function onActivate()
193 {
194 return;
195 }
196
202 public function onDeactivate()
203 {
204 return;
205 }
206
212 public function isActive()
213 {
214 return $this->active;
215 }
216
220 abstract public function attemptTransition();
221
225 abstract public function checkTransitionPreconditions();
226
230 abstract public function executeTransition();
231
235 abstract public function activate();
236
240 abstract public function deactivate();
241
247 abstract public function notifyDetectorSatisfaction(ilDetector $detector);
248}
An exception for terminatinating execution or to throw for unit testing.
@noinspection PhpIncludeInspection
getEmitters()
Returns all currently set emitters.
addActivity(ilActivity $activity)
Adds an activity to the list of activities.
onDeactivate()
Method calles on deactivation of the node.
isActive()
Returns the activation status of the node.
getContext()
Returns a reference to the parent workflow object.
setRuntimeVar($name, $value)
addDetector(ilDetector $detector)
Adds a detector to the list of detectors.
addEmitter(ilEmitter $emitter)
Adds an emitter to the list of emitters.
attemptTransition()
getDetectors()
Returns all currently set detectors.
notifyDetectorSatisfaction(ilDetector $detector)
executeTransition()
checkTransitionPreconditions()
setRuntimeVars($runtime_vars)
onActivate()
Method called on activation of the node.
getRuntimeVar($name)
getActivities()
Returns all currently set activities.
ilActivity Interface is part of the petri net based workflow engine.
Definition: ilActivity.php:16
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