ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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  $this->setDetectorState(true);
78  return true;
79  } else {
80  return false;
81  }
82  }
83 
89  public function getDetectorState()
90  {
92  }
93 
105  public function setDetectorState($new_state)
106  {
107  $this->detection_state = $new_state;
108 
109  if ($new_state == true) {
110  $this->context->notifyDetectorSatisfaction($this);
111  }
112  }
113 
118  public function onActivate()
119  {
120  return;
121  }
122 
127  public function onDeactivate()
128  {
129  return;
130  }
131 
135  public function getActivated()
136  {
137  return $this->detection_state;
138  }
139 
143  public function setName($name)
144  {
145  $this->name = $name;
146  }
147 
151  public function getName()
152  {
153  return $this->name;
154  }
155 
159  public function getSourceNode()
160  {
161  return $this->source_node;
162  }
163 
167  public function setSourceNode($source_node)
168  {
169  $this->source_node = $source_node;
170  }
171 }
$params
Definition: disable.php:11
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.