ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
5 require_once './Services/WorkflowEngine/interfaces/ilNode.php';
7 require_once './Services/WorkflowEngine/interfaces/ilEmitter.php';
9 require_once './Services/WorkflowEngine/interfaces/ilDetector.php';
11 require_once './Services/WorkflowEngine/interfaces/ilActivity.php';
13 require_once './Services/WorkflowEngine/interfaces/ilWorkflow.php';
14 
22 abstract 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 
163  public function setRuntimeVars($runtime_vars)
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 }
setRuntimeVars($runtime_vars)
getActivities()
Returns all currently set activities.
getDetectors()
Returns all currently set detectors.
getEmitters()
Returns all currently set emitters.
isActive()
Returns the activation status of the node.
attemptTransition()
onActivate()
Method called on activation of the node.
getRuntimeVar($name)
PhpIncludeInspection
Definition: ilNode.php:25
setRuntimeVar($name, $value)
onDeactivate()
Method calles on deactivation of the node.
addEmitter(ilEmitter $emitter)
Adds an emitter to the list of emitters.
addActivity(ilActivity $activity)
Adds an activity to the list of activities.
addDetector(ilDetector $detector)
Adds a detector to the list of detectors.
executeTransition()
notifyDetectorSatisfaction(ilDetector $detector)
PhpIncludeInspection
ilDetector Interface is part of the petri net based workflow engine.
Definition: ilDetector.php:16
getContext()
Returns a reference to the parent workflow object.
checkTransitionPreconditions()
ilActivity Interface is part of the petri net based workflow engine.
Definition: ilActivity.php:15
ilEmitter Interface is part of the petri net based workflow engine.
Definition: ilEmitter.php:16