ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
PhpIncludeInspection More...
Public Member Functions | |
__construct (ilWorkflow $a_context) | |
Default constructor. More... | |
activate () | |
Activates the node. More... | |
deactivate () | |
Deactivates the node. More... | |
checkTransitionPreconditions () | |
Checks, if the preconditions of the node to transit are met. More... | |
attemptTransition () | |
Attempts to transit the node. More... | |
executeTransition () | |
Executes the 'then'-transition of the node. More... | |
executeElseTransition () | |
Executes the 'else'-transition of the node. More... | |
addEmitter (ilEmitter $emitter, $else_emitter=false) | |
Adds an emitter to one of the lists attached to the node. More... | |
addActivity (ilActivity $activity, $else_activity=false) | |
Adds an activity to one of the lists attached to the node. More... | |
setEvaluationExpression ($a_expression) | |
notifyDetectorSatisfaction (ilDetector $detector) | |
This method is called by detectors, that just switched to being satisfied. More... | |
getActivities ($else=false) | |
Returns all currently set activites. More... | |
getEmitters ($else=false) | |
Returns all currently set emitters. More... | |
Public Member Functions inherited from ilBaseNode | |
addDetector (ilDetector $detector) | |
Adds a detector to the list of detectors. More... | |
getDetectors () | |
Returns all currently set detectors. More... | |
addEmitter (ilEmitter $emitter) | |
Adds an emitter to the list of emitters. More... | |
getEmitters () | |
Returns all currently set emitters. More... | |
addActivity (ilActivity $activity) | |
Adds an activity to the list of activities. More... | |
getActivities () | |
Returns all currently set activities. More... | |
getContext () | |
Returns a reference to the parent workflow object. More... | |
setName ($name) | |
getName () | |
getRuntimeVars () | |
setRuntimeVars ($runtime_vars) | |
getRuntimeVar ($name) | |
setRuntimeVar ($name, $value) | |
onActivate () | |
Method called on activation of the node. More... | |
onDeactivate () | |
Method calles on deactivation of the node. More... | |
isActive () | |
Returns the activation status of the node. More... | |
attemptTransition () | |
checkTransitionPreconditions () | |
executeTransition () | |
activate () | |
deactivate () | |
notifyDetectorSatisfaction (ilDetector $detector) | |
Private Member Functions | |
executeActivities () | |
Executes all 'then'-activities attached to the node. More... | |
executeElseActivities () | |
Exectes all 'else'-activities attached to the node. More... | |
executeEmitters () | |
Executes all 'then'-emitters attached to the node. More... | |
executeElseEmitters () | |
Executes all 'else'-emitters attached to the node. More... | |
Private Attributes | |
$else_emitters | |
$else_activities | |
$evaluation_expression = "return true;" | |
Additional Inherited Members | |
Protected Attributes inherited from ilBaseNode | |
$context | |
$detectors | |
$emitters | |
$activities | |
$active = false | |
$name | |
$runtime_vars | |
PhpIncludeInspection
Conditional node of the petri net based workflow engine.
The conditional node is a deciding node. It features a doubled set of emitters and activities. The new set is prefixed with 'else_'. In the core of it, a given piece of php code is executed that returns either true, false or null, telling the node which set is to be executed - if any. This takes advantage of create_function, which is just as evil as eval. Because of that, the configuration of the conditional node must not be made available to users/admins and the content which makes up the evaluation method has no business in the database as this may pose a severe risk. Put these code pieces into the workflow object and set it during workflow creation. Remember: I told you before. Alternatively, you can extend this class and pre-set a code, that takes parameters from ilSetting, ini-Files, water diviner... up to you. Keep in mind to check these parameters for type and where possible, avoid strings and/or types that allow larger code segments.
/
Definition at line 29 of file class.ilConditionalNode.php.
ilConditionalNode::__construct | ( | ilWorkflow | $a_context | ) |
Default constructor.
ilWorkflow | Reference to the parent workflow. |
Definition at line 60 of file class.ilConditionalNode.php.
References array.
ilConditionalNode::activate | ( | ) |
Activates the node.
Implements ilNode.
Definition at line 73 of file class.ilConditionalNode.php.
References attemptTransition(), and ilBaseNode\onActivate().
ilConditionalNode::addActivity | ( | ilActivity | $activity, |
$else_activity = false |
|||
) |
Adds an activity to one of the lists attached to the node.
ilActivity | $activity | |
boolean | $else_activity | True, if the activity should be an 'else'-activity. |
Definition at line 254 of file class.ilConditionalNode.php.
ilConditionalNode::addEmitter | ( | ilEmitter | $emitter, |
$else_emitter = false |
|||
) |
Adds an emitter to one of the lists attached to the node.
ilEmitter | $emitter | |
boolean | $else_emitter | True, if the emitter should be an 'else'-emitter. |
Definition at line 236 of file class.ilConditionalNode.php.
ilConditionalNode::attemptTransition | ( | ) |
Attempts to transit the node.
Basically, this checks for preconditions and transits, returning true or false if preconditions are not met, aka detectors are not fully satisfied.
Implements ilNode.
Definition at line 133 of file class.ilConditionalNode.php.
References executeElseTransition(), and executeTransition().
Referenced by activate(), and notifyDetectorSatisfaction().
ilConditionalNode::checkTransitionPreconditions | ( | ) |
Checks, if the preconditions of the node to transit are met.
Please note, that in a conditional node, this means the node can transit to one or another outcome. This method only returns false, if the return value of the method is neither true nor false.
Implements ilNode.
Definition at line 106 of file class.ilConditionalNode.php.
ilConditionalNode::deactivate | ( | ) |
Deactivates the node.
Implements ilNode.
Definition at line 87 of file class.ilConditionalNode.php.
References ilBaseNode\onDeactivate().
Referenced by executeElseTransition(), and executeTransition().
|
private |
Executes all 'then'-activities attached to the node.
Definition at line 157 of file class.ilConditionalNode.php.
Referenced by executeTransition().
|
private |
Exectes all 'else'-activities attached to the node.
Definition at line 171 of file class.ilConditionalNode.php.
Referenced by executeElseTransition().
|
private |
Executes all 'else'-emitters attached to the node.
Definition at line 199 of file class.ilConditionalNode.php.
Referenced by executeElseTransition().
ilConditionalNode::executeElseTransition | ( | ) |
Executes the 'else'-transition of the node.
Definition at line 223 of file class.ilConditionalNode.php.
References deactivate(), executeElseActivities(), and executeElseEmitters().
Referenced by attemptTransition().
|
private |
Executes all 'then'-emitters attached to the node.
Definition at line 185 of file class.ilConditionalNode.php.
Referenced by executeTransition().
ilConditionalNode::executeTransition | ( | ) |
Executes the 'then'-transition of the node.
Implements ilNode.
Definition at line 213 of file class.ilConditionalNode.php.
References deactivate(), executeActivities(), and executeEmitters().
Referenced by attemptTransition().
ilConditionalNode::getActivities | ( | $else = false | ) |
Returns all currently set activites.
boolean | $else | True, if else activities should be returned. |
Definition at line 329 of file class.ilConditionalNode.php.
References ilBaseNode\$activities, and $else_activities.
ilConditionalNode::getEmitters | ( | $else = false | ) |
Returns all currently set emitters.
boolean | $else | True, if else emitters should be returned. |
Definition at line 346 of file class.ilConditionalNode.php.
References $else_emitters, and ilBaseNode\$emitters.
ilConditionalNode::notifyDetectorSatisfaction | ( | ilDetector | $detector | ) |
This method is called by detectors, that just switched to being satisfied.
ilDetector | $detector | ilDetector which is now satisfied. |
Implements ilNode.
Definition at line 314 of file class.ilConditionalNode.php.
References attemptTransition(), and ilBaseNode\isActive().
ilConditionalNode::setEvaluationExpression | ( | $a_expression | ) |
Definition at line 302 of file class.ilConditionalNode.php.
|
private |
Definition at line 45 of file class.ilConditionalNode.php.
Referenced by getActivities().
|
private |
Definition at line 37 of file class.ilConditionalNode.php.
Referenced by getEmitters().
|
private |
Definition at line 53 of file class.ilConditionalNode.php.