ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilSimpleDetector.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/ilDetector.php';
7 require_once './Services/WorkflowEngine/interfaces/ilWorkflowEngineElement.php';
8 
24 {
30  private $context;
31 
37  private $detection_state = false;
38 
40  protected $name;
41 
43  protected $source_node;
44 
50  public function __construct(ilNode $context)
51  {
52  $this->context = $context;
53  }
54 
59  public function getContext()
60  {
61  return $this->context;
62  }
63 
74  public function trigger($params)
75  {
76  if ($this->detection_state == false)
77  {
78  $this->setDetectorState(true);
79  return true;
80  }
81  else
82  {
83  return false;
84  }
85  }
86 
92  public function getDetectorState()
93  {
95  }
96 
108  public function setDetectorState($new_state)
109  {
110  $this->detection_state = $new_state;
111 
112  if ($new_state == true)
113  {
114  $this->context->notifyDetectorSatisfaction($this);
115  }
116  }
117 
122  public function onActivate()
123  {
124  return;
125  }
126 
131  public function onDeactivate()
132  {
133  return;
134  }
135 
139  public function getActivated()
140  {
141  return $this->detection_state;
142  }
143 
147  public function setName($name)
148  {
149  $this->name = $name;
150  }
151 
155  public function getName()
156  {
157  return $this->name;
158  }
159 
163  public function getSourceNode()
164  {
165  return $this->source_node;
166  }
167 
171  public function setSourceNode($source_node)
172  {
173  $this->source_node = $source_node;
174  }
175 }
getDetectorState()
Returns if the current detector state is satisfied or not.
ilWorkflowEngineElement Interface is part of the petri net based workflow engine. ...
__construct(ilNode $context)
Default constructor.
trigger($params)
Trigger this detector.
PhpIncludeInspection
Definition: ilNode.php:25
setDetectorState($new_state)
Sets a new detector state.
onActivate()
Method is called, when the parent node is activated.
onDeactivate()
Method is called, when the parent node is deactivated.
ilDetector Interface is part of the petri net based workflow engine.
Definition: ilDetector.php:16
PhpIncludeInspection
getContext()
Returns the parent object.
$params
Definition: example_049.php:96