ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilDataDetector Class Reference

@noinspection 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)
 
 trigger ($params)
 
 getDetectorState ()
 
 onActivate ()
 
 onDeactivate ()
 
 getContext ()
 This method returns the context of the element. More...
 
 setName ($name)
 
 getName ()
 

Protected Attributes

 $name
 
 $source_node
 
 $var_name
 

Private Attributes

 $context
 
 $detection_state = false
 

Detailed Description

@noinspection PhpIncludeInspection

@noinspection 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.

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

References $context.

Member Function Documentation

◆ getActivated()

ilDataDetector::getActivated ( )
Returns
bool

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

145 {
147 }

References $detection_state.

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

57 {
58 return $this->context;
59 }

References $context.

Referenced by getDetectorState().

+ 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.

82 {
83 $definitions = $this->getContext()->getContext()->getInstanceVars();
84
85 $id = $this->var_name;
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 }
getContext()
Returns the parent object.

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

+ Here is the call graph for this function:

◆ getName()

ilDataDetector::getName ( )
Returns
string

Implements ilWorkflowEngineElement.

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

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

References $name.

◆ getSourceNode()

ilDataDetector::getSourceNode ( )
Returns
ilNode

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

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

References $source_node.

◆ getVarName()

ilDataDetector::getVarName ( )
Returns
string

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

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

References $var_name.

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

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

References $name.

◆ setSourceNode()

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

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

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

References $source_node.

◆ setVarName()

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

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

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

References $var_name.

◆ 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

string ilDataDetector::$name
protected

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

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

◆ $source_node

ilNode ilDataDetector::$source_node
protected

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

Referenced by getSourceNode(), and setSourceNode().

◆ $var_name

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