5 require_once
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
7 require_once
'./Services/WorkflowEngine/interfaces/ilExternalDetector.php';
142 return array(
'type' => $this->event_type,
'content' => $this->event_content);
164 return array(
'type' => $this->event_subject_type,
'identifier' => $this->event_subject_identifier);
186 return array(
'type' => $this->event_context_type,
'identifier' => $this->event_context_identifier);
215 if ($this->event_type !==
$params[0]) {
220 if ($this->event_content !==
$params[1]) {
225 if ($this->event_subject_type !==
$params[2]) {
230 if ($this->event_subject_identifier !==
$params[3] && $this->event_subject_identifier != 0) {
235 if ($this->event_context_type !==
$params[4]) {
240 if ($this->event_context_identifier !==
$params[5] && $this->event_context_identifier != 0) {
252 $this->was_activated =
true;
268 if ($this->listening_start == 0 && $this->listening_end == 0) {
273 require_once
'./Services/WorkflowEngine/classes/utils/class.ilWorkflowUtils.php';
274 if ($this->listening_start <= ilWorkflowUtils::time()) {
276 if ($this->listening_end >= ilWorkflowUtils::time()
277 || $this->listening_end == 0) {
298 require_once
'./Services/WorkflowEngine/exceptions/ilWorkflowInvalidArgumentException.php';
330 $this->db_id = $a_id;
341 if ($this->db_id != null) {
344 require_once
'./Services/WorkflowEngine/exceptions/ilWorkflowObjectStateException.php';
355 if ($this->db_id == null) {
368 require_once
'./Services/WorkflowEngine/classes/utils/class.ilWorkflowDbHelper.php';
369 ilWorkflowDbHelper::writeDetector($this);
378 require_once
'./Services/WorkflowEngine/classes/utils/class.ilWorkflowDbHelper.php';
379 ilWorkflowDbHelper::deleteDetector($this);
389 return array(
'listening_start' => $this->listening_start,
'listening_end' => $this->listening_end);
isListening()
Returns if the detector is currently listening.
getDetectorState()
Returns if the current detector state is satisfied or not.
getEvent()
Returns the event type and content currently set to the detector.
hasDbId()
Returns, if the detector has a database id.
setDbId($a_id)
Sets the database id of the detector.
getListeningTimeframe()
Returns the listening timefrage of the detector.
getEventSubject()
Get the event subject set to the detector.
setEventSubject($event_subject_type, $event_subject_identifier)
Set the event subject type to the detector.
getEventContext()
Get the event context set to the detector.
trigger($params)
Triggers the detector.
setListeningTimeframe($listening_start, $listening_end)
Sets the timeframe, in which the detector is listening.
onActivate()
Method called on activation.
$event_subject_identifier
setDetectorState($new_state)
Sets a new detector state.
getDbId()
Returns the database id of the detector if set.
setEventContext($event_context_type, $event_context_identifier)
Set the event context to the detector.
$event_context_identifier
__construct($context)
Default constructor, passing the context to the parent constructor.
deleteDetectorFromDb()
Passes this detector to the ilWorkflowDbHelper in order to remove the detector data from the database...
setEvent($event_type, $event_content)
Sets the event type and content (/qualifier) for the detector.
writeDetectorToDb()
Passes this detector to the ilWorkflowDBHelper in order to write or update the detector data to the d...
onDeactivate()
Method called on deactivation.
getContext()
Returns the parent object.