ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
5require_once './Services/WorkflowEngine/interfaces/ilDetector.php';
7require_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 {
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
168 {
169 $this->source_node = $source_node;
170 }
171}
An exception for terminatinating execution or to throw for unit testing.
@noinspection PhpIncludeInspection
__construct(ilNode $context)
Default constructor.
getDetectorState()
Returns if the current detector state is satisfied or not.
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.
onActivate()
Method is called, when the parent node is activated.
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.