ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 144 of file class.ilDataDetector.php.

References $detection_state.

145  {
146  return $this->detection_state;
147  }

◆ 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 $id, $name, $var_name, and getContext().

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

◆ getName()

ilDataDetector::getName ( )
Returns
string

Implements ilWorkflowEngineElement.

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

References $name.

161  {
162  return $this->name;
163  }

◆ getSourceNode()

ilDataDetector::getSourceNode ( )
Returns
ilNode

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

References $source_node.

169  {
170  return $this->source_node;
171  }

◆ getVarName()

ilDataDetector::getVarName ( )
Returns
string

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

References $var_name.

185  {
186  return $this->var_name;
187  }

◆ onActivate()

ilDataDetector::onActivate ( )

Method is called, when the parent node is activated.

Returns
void

Implements ilDetector.

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

128  {
129  return;
130  }

◆ onDeactivate()

ilDataDetector::onDeactivate ( )

Method is called, when the parent node is deactivated.

Returns
void

Implements ilDetector.

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

137  {
138  return;
139  }

◆ 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 117 of file class.ilDataDetector.php.

118  {
119  $this->detection_state = true;
120  $this->context->notifyDetectorSatisfaction($this);
121  }

◆ setName()

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

Implements ilWorkflowEngineElement.

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

References $name.

153  {
154  $this->name = $name;
155  }

◆ setSourceNode()

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

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

References $source_node.

177  {
178  $this->source_node = $source_node;
179  }

◆ setVarName()

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

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

References $var_name.

193  {
194  $this->var_name = $var_name;
195  }

◆ 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: