ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 139 of file class.ilSimpleDetector.php.

References $detection_state.

140  {
141  return $this->detection_state;
142  }

◆ 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 92 of file class.ilSimpleDetector.php.

References $detection_state.

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

93  {
95  }
+ Here is the caller graph for this function:

◆ getName()

ilSimpleDetector::getName ( )
Returns
string

Implements ilWorkflowEngineElement.

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

References $name.

156  {
157  return $this->name;
158  }

◆ getSourceNode()

ilSimpleDetector::getSourceNode ( )
Returns
ilNode

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

References $source_node.

164  {
165  return $this->source_node;
166  }

◆ onActivate()

ilSimpleDetector::onActivate ( )

Method is called, when the parent node is activated.

Returns
void

Implements ilDetector.

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

123  {
124  return;
125  }

◆ onDeactivate()

ilSimpleDetector::onDeactivate ( )

Method is called, when the parent node is deactivated.

Returns
void

Implements ilDetector.

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

132  {
133  return;
134  }

◆ 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 108 of file class.ilSimpleDetector.php.

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

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

◆ setName()

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

Implements ilWorkflowEngineElement.

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

References $name.

148  {
149  $this->name = $name;
150  }

◆ setSourceNode()

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

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

References $source_node.

172  {
173  $this->source_node = $source_node;
174  }

◆ 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  {
78  $this->setDetectorState(true);
79  return true;
80  }
81  else
82  {
83  return false;
84  }
85  }
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: