ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSimpleDetector Class Reference

PhpIncludeInspection More...

+ Inheritance diagram for ilSimpleDetector:
+ Collaboration diagram for ilSimpleDetector:

Public Member Functions

 __construct (ilNode $context)
 Default constructor. More...
 
 getContext ()
 Returns the parent object. More...
 
 trigger ($params)
 Trigger this detector. More...
 
 getDetectorState ()
 Returns if the current detector state is satisfied or not. More...
 
 setDetectorState ($new_state)
 Sets a new detector state. More...
 
 onActivate ()
 Method is called, when the parent node is activated. More...
 
 onDeactivate ()
 Method is called, when the parent node is deactivated. More...
 
 getActivated ()
 
 setName ($name)
 
 getName ()
 
 getSourceNode ()
 
 setSourceNode ($source_node)
 

Protected Attributes

 $name
 
 $source_node
 

Private Attributes

 $context
 
 $detection_state = false
 

Detailed Description

PhpIncludeInspection

PhpIncludeInspection ilSimpleDetector of the petri net based workflow engine.

The simple detector does nothing but detect, if it was triggered. Until reset, the trigger method will return false, if the detection state is already fulfilled. (This would be proper behaviour in a petri net, still it has to be fleshed out how the system works out with 'ready-to-transit' nodes the do not transit because of later nodes not accepting ther impulse.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

/

Definition at line 23 of file class.ilSimpleDetector.php.

Constructor & Destructor Documentation

◆ __construct()

ilSimpleDetector::__construct ( ilNode  $context)

Default constructor.

Parameters
ilNode$context

Definition at line 50 of file class.ilSimpleDetector.php.

References $context.

51  {
52  $this->context = $context;
53  }

Member Function Documentation

◆ getActivated()

ilSimpleDetector::getActivated ( )
Returns
bool

Definition at line 135 of file class.ilSimpleDetector.php.

References $detection_state.

136  {
137  return $this->detection_state;
138  }

◆ getContext()

ilSimpleDetector::getContext ( )

Returns the parent object.

Type is ilNode, implements ilWorkflowEngineElement

Returns
ilNode Parent node of this element.

Implements ilWorkflowEngineElement.

Definition at line 59 of file class.ilSimpleDetector.php.

References $context.

Referenced by ilEventDetector\trigger().

60  {
61  return $this->context;
62  }
+ Here is the caller graph for this function:

◆ getDetectorState()

ilSimpleDetector::getDetectorState ( )

Returns if the current detector state is satisfied or not.

Returns
boolean

Implements ilDetector.

Definition at line 89 of file class.ilSimpleDetector.php.

References $detection_state.

Referenced by ilTimerDetector\trigger(), and ilEventDetector\trigger().

90  {
92  }
+ Here is the caller graph for this function:

◆ getName()

ilSimpleDetector::getName ( )
Returns
string

Implements ilWorkflowEngineElement.

Definition at line 151 of file class.ilSimpleDetector.php.

References $name.

152  {
153  return $this->name;
154  }

◆ getSourceNode()

ilSimpleDetector::getSourceNode ( )
Returns
ilNode

Definition at line 159 of file class.ilSimpleDetector.php.

References $source_node.

160  {
161  return $this->source_node;
162  }

◆ onActivate()

ilSimpleDetector::onActivate ( )

Method is called, when the parent node is activated.

Returns
void

Implements ilDetector.

Definition at line 118 of file class.ilSimpleDetector.php.

119  {
120  return;
121  }

◆ onDeactivate()

ilSimpleDetector::onDeactivate ( )

Method is called, when the parent node is deactivated.

Returns
void

Implements ilDetector.

Definition at line 127 of file class.ilSimpleDetector.php.

128  {
129  return;
130  }

◆ setDetectorState()

ilSimpleDetector::setDetectorState (   $new_state)

Sets a new detector state.

In this case, the only meaningful param is false, since it should only be set to true, if the detector was triggered. Reason this method exists, is to allow the workflow controller to "fast forward" workflows to set a non-default state. I.e. a workflow has to be set into a state in the middle of running. Use with care.

Parameters
boolean$new_state

Definition at line 105 of file class.ilSimpleDetector.php.

Referenced by ilTimerDetector\onActivate(), ilEventDetector\onActivate(), ilTimerDetector\onDeactivate(), ilEventDetector\onDeactivate(), trigger(), ilCounterDetector\trigger(), ilTimerDetector\trigger(), and ilEventDetector\trigger().

106  {
107  $this->detection_state = $new_state;
108 
109  if ($new_state == true) {
110  $this->context->notifyDetectorSatisfaction($this);
111  }
112  }
+ Here is the caller graph for this function:

◆ setName()

ilSimpleDetector::setName (   $name)
Parameters
string$name

Implements ilWorkflowEngineElement.

Definition at line 143 of file class.ilSimpleDetector.php.

References $name.

144  {
145  $this->name = $name;
146  }

◆ setSourceNode()

ilSimpleDetector::setSourceNode (   $source_node)
Parameters
ilNode$source_node

Definition at line 167 of file class.ilSimpleDetector.php.

References $source_node.

168  {
169  $this->source_node = $source_node;
170  }

◆ trigger()

ilSimpleDetector::trigger (   $params)

Trigger this detector.

Params are an array. These are part of the interface but ignored here.

Todo:
Handle ignored $params.
Parameters
array$params
Returns
boolean False, if detector was already satisfied before.

Implements ilDetector.

Definition at line 74 of file class.ilSimpleDetector.php.

References setDetectorState().

75  {
76  if ($this->detection_state == false) {
77  $this->setDetectorState(true);
78  return true;
79  } else {
80  return false;
81  }
82  }
setDetectorState($new_state)
Sets a new detector state.
+ Here is the call graph for this function:

Field Documentation

◆ $context

ilSimpleDetector::$context
private

◆ $detection_state

ilSimpleDetector::$detection_state = false
private

Definition at line 37 of file class.ilSimpleDetector.php.

Referenced by getActivated(), and getDetectorState().

◆ $name

ilSimpleDetector::$name
protected

Definition at line 40 of file class.ilSimpleDetector.php.

Referenced by getName(), and setName().

◆ $source_node

ilSimpleDetector::$source_node
protected

Definition at line 43 of file class.ilSimpleDetector.php.

Referenced by getSourceNode(), and setSourceNode().


The documentation for this class was generated from the following file: