ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDataDetector.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
3
5require_once './Services/WorkflowEngine/interfaces/ilDetector.php';
7require_once './Services/WorkflowEngine/interfaces/ilWorkflowEngineElement.php';
8
18{
24 private $context;
25
31 private $detection_state = false;
32
34 protected $name;
35
37 protected $source_node;
38
40 protected $var_name;
41
47 public function __construct(ilNode $context)
48 {
49 $this->context = $context;
50 }
51
56 public function getContext()
57 {
58 return $this->context;
59 }
60
71 public function trigger($params)
72 {
73 return true;
74 }
75
81 public function getDetectorState()
82 {
83 $definitions = $this->getContext()->getContext()->getInstanceVars();
84
87 foreach ($definitions as $definition) {
88 if ($definition['id'] == $name) {
89 if ($definition['reference']) {
90 $id = $definition['target'];
91 }
92 $name = $definition['name'];
93 break;
94 }
95 }
96
97 $this->getContext()->setRuntimeVar(
98 $name,
99 $this->getContext()->getContext()->getInstanceVarById($id)
100 );
101 $this->detection_state = true;
102
103 return true;
104 }
105
117 public function setDetectorState($new_state)
118 {
119 $this->detection_state = true;
120 $this->context->notifyDetectorSatisfaction($this);
121 }
122
127 public function onActivate()
128 {
129 return;
130 }
131
136 public function onDeactivate()
137 {
138 return;
139 }
140
144 public function getActivated()
145 {
147 }
148
152 public function setName($name)
153 {
154 $this->name = $name;
155 }
156
160 public function getName()
161 {
162 return $this->name;
163 }
164
168 public function getSourceNode()
169 {
170 return $this->source_node;
171 }
172
177 {
178 $this->source_node = $source_node;
179 }
180
184 public function getVarName()
185 {
186 return $this->var_name;
187 }
188
192 public function setVarName($var_name)
193 {
194 $this->var_name = $var_name;
195 }
196}
An exception for terminatinating execution or to throw for unit testing.
@noinspection PhpIncludeInspection
__construct(ilNode $context)
Default constructor.
setSourceNode($source_node)
getDetectorState()
Returns if the current detector state is satisfied or not.
onActivate()
Method is called, when the parent node is activated.
getContext()
Returns the parent object.
onDeactivate()
Method is called, when the parent node is deactivated.
setDetectorState($new_state)
Sets a new detector state.
trigger($params)
Trigger this detector.
if(!array_key_exists('StateId', $_REQUEST)) $id
ilDetector Interface is part of the petri net based workflow engine.
Definition: ilDetector.php:17
@noinspection PhpIncludeInspection
Definition: ilNode.php:26
ilWorkflowEngineElement Interface is part of the petri net based workflow engine.
$params
Definition: disable.php:11