ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilDataDetector Class Reference

PhpIncludeInspection More...

+ Inheritance diagram for ilDataDetector:
+ Collaboration diagram for ilDataDetector:

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)
 
 getVarName ()
 
 setVarName ($var_name)
 

Protected Attributes

 $name
 
 $source_node
 
 $var_name
 

Private Attributes

 $context
 
 $detection_state = false
 

Detailed Description

PhpIncludeInspection

PhpIncludeInspection ilDataDetector of the petri net based workflow engine.

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

/

Definition at line 17 of file class.ilDataDetector.php.

Constructor & Destructor Documentation

◆ __construct()

ilDataDetector::__construct ( ilNode  $context)

Default constructor.

Parameters
ilNode$context

Definition at line 47 of file class.ilDataDetector.php.

References $context.

48  {
49  $this->context = $context;
50  }

Member Function Documentation

◆ getActivated()

ilDataDetector::getActivated ( )
Returns
bool

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

References $detection_state.

148  {
149  return $this->detection_state;
150  }

◆ getContext()

ilDataDetector::getContext ( )

Returns the parent object.

Type is ilNode, implements ilWorkflowEngineElement

Returns
ilNode Parent node of this element.

Implements ilWorkflowEngineElement.

Definition at line 56 of file class.ilDataDetector.php.

References $context.

Referenced by getDetectorState().

57  {
58  return $this->context;
59  }
+ Here is the caller graph for this function:

◆ getDetectorState()

ilDataDetector::getDetectorState ( )

Returns if the current detector state is satisfied or not.

Returns
boolean

Implements ilDetector.

Definition at line 81 of file class.ilDataDetector.php.

References $name, $var_name, and getContext().

82  {
83  $definitions = $this->getContext()->getContext()->getInstanceVars();
84 
85  $id = $this->var_name;
87  foreach($definitions as $definition)
88  {
89  if($definition['id'] == $name)
90  {
91  if($definition['reference'])
92  {
93  $id = $definition['target'];
94  }
95  $name = $definition['name'];
96  break;
97  }
98  }
99 
100  $this->getContext()->setRuntimeVar(
101  $name,
102  $this->getContext()->getContext()->getInstanceVarById($id)
103  );
104  $this->detection_state = true;
105 
106  return true;
107  }
getContext()
Returns the parent object.
+ Here is the call graph for this function:

◆ getName()

ilDataDetector::getName ( )
Returns
string

Implements ilWorkflowEngineElement.

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

References $name.

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

◆ getSourceNode()

ilDataDetector::getSourceNode ( )
Returns
ilNode

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

References $source_node.

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

◆ getVarName()

ilDataDetector::getVarName ( )
Returns
string

Definition at line 187 of file class.ilDataDetector.php.

References $var_name.

188  {
189  return $this->var_name;
190  }

◆ onActivate()

ilDataDetector::onActivate ( )

Method is called, when the parent node is activated.

Returns
void

Implements ilDetector.

Definition at line 130 of file class.ilDataDetector.php.

131  {
132  return;
133  }

◆ onDeactivate()

ilDataDetector::onDeactivate ( )

Method is called, when the parent node is deactivated.

Returns
void

Implements ilDetector.

Definition at line 139 of file class.ilDataDetector.php.

140  {
141  return;
142  }

◆ setDetectorState()

ilDataDetector::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 120 of file class.ilDataDetector.php.

121  {
122  $this->detection_state = true;
123  $this->context->notifyDetectorSatisfaction($this);
124  }

◆ setName()

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

Implements ilWorkflowEngineElement.

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

References $name.

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

◆ setSourceNode()

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

Definition at line 179 of file class.ilDataDetector.php.

References $source_node.

180  {
181  $this->source_node = $source_node;
182  }

◆ setVarName()

ilDataDetector::setVarName (   $var_name)
Parameters
string$var_name

Definition at line 195 of file class.ilDataDetector.php.

References $var_name.

196  {
197  $this->var_name = $var_name;
198  }

◆ trigger()

ilDataDetector::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 71 of file class.ilDataDetector.php.

72  {
73  return true;
74  }

Field Documentation

◆ $context

ilDataDetector::$context
private

Definition at line 24 of file class.ilDataDetector.php.

Referenced by __construct(), and getContext().

◆ $detection_state

ilDataDetector::$detection_state = false
private

Definition at line 31 of file class.ilDataDetector.php.

Referenced by getActivated().

◆ $name

ilDataDetector::$name
protected

Definition at line 34 of file class.ilDataDetector.php.

Referenced by getDetectorState(), getName(), and setName().

◆ $source_node

ilDataDetector::$source_node
protected

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

Referenced by getSourceNode(), and setSourceNode().

◆ $var_name

ilDataDetector::$var_name
protected

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

Referenced by getDetectorState(), getVarName(), and setVarName().


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