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

PhpIncludeInspection More...

+ Inheritance diagram for ilBasicNode:
+ Collaboration diagram for ilBasicNode:

Public Member Functions

 __construct (ilWorkflow $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 transition, calls all activities and emitters to execute. More...
 
 notifyDetectorSatisfaction (ilDetector $detector)
 This method is called by detectors, that just switched to being satisfied. More...
 
 isForwardConditionNode ()
 
 setIsForwardConditionNode ($is_forward_condition_node)
 
- 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)
 

Data Fields

 $is_forward_condition_event
 
 $ident
 

Private Member Functions

 executeActivities ()
 Executes all attached activities. More...
 
 executeEmitters ()
 Executes all attached emitters. More...
 

Private Attributes

 $is_forward_condition_node
 

Additional Inherited Members

- Protected Attributes inherited from ilBaseNode
 $context
 
 $detectors
 
 $emitters
 
 $activities
 
 $active = false
 
 $name
 
 $runtime_vars
 

Detailed Description

PhpIncludeInspection

Workflow Node 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 15 of file class.ilBasicNode.php.

Constructor & Destructor Documentation

◆ __construct()

ilBasicNode::__construct ( ilWorkflow  $context)

Default constructor.

Parameters
ilWorkflow$contextReference to the workflow the node is attached to.

Definition at line 41 of file class.ilBasicNode.php.

References ilBaseNode\$context, and array.

42  {
43  $this->context = $context;
44  $this->detectors = array();
45  $this->emitters = array();
46  $this->activities = array();
47  $this->active = false;
48  $this->is_forward_condition_node = false;
49  $this->is_forward_condition_event = false;
50  $this->ident = strtoupper(substr(md5(spl_object_hash($this)),0,6));
51  }
Create styles array
The data for the language used.

Member Function Documentation

◆ activate()

ilBasicNode::activate ( )

Activates the node.

Implements ilNode.

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

References attemptTransition(), ilBaseNode\isActive(), and ilBaseNode\onActivate().

57  {
58  if ($this->isActive())
59  {
60  return;
61  }
62 
63  $this->active = true;
64 
65  foreach($this->detectors as $detector)
66  {
67  $detector->onActivate();
68  }
69  $this->onActivate();
70  $this->attemptTransition();
71  }
isActive()
Returns the activation status of the node.
onActivate()
Method called on activation of the node.
attemptTransition()
Attempts to transit the node.
+ Here is the call graph for this function:

◆ attemptTransition()

ilBasicNode::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.

Returns
boolean True, if transition succeeded.

Implements ilNode.

Definition at line 113 of file class.ilBasicNode.php.

References checkTransitionPreconditions(), and executeTransition().

Referenced by activate(), and notifyDetectorSatisfaction().

114  {
115  if ($this->checkTransitionPreconditions() == true)
116  {
117  $this->executeTransition();
118  return true;
119  }
120  else
121  {
122  return false;
123  }
124  }
executeTransition()
Executes the transition, calls all activities and emitters to execute.
checkTransitionPreconditions()
Checks, if the preconditions of the node to transit are met.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkTransitionPreconditions()

ilBasicNode::checkTransitionPreconditions ( )

Checks, if the preconditions of the node to transit are met.

Returns
boolean True, if node is ready to transit.

Implements ilNode.

Definition at line 91 of file class.ilBasicNode.php.

Referenced by attemptTransition().

92  {
93  // queries the $detectors if their conditions are met.
94  $isPreconditionMet = true;
95  foreach ($this->detectors as $detector)
96  {
97  if ($isPreconditionMet == true)
98  {
99  $isPreconditionMet = $detector->getDetectorState();
100  }
101  }
102  return $isPreconditionMet;
103  }
+ Here is the caller graph for this function:

◆ deactivate()

ilBasicNode::deactivate ( )

Deactivates the node.

Implements ilNode.

Definition at line 76 of file class.ilBasicNode.php.

References ilBaseNode\onDeactivate().

Referenced by executeTransition().

77  {
78  $this->active = false;
79  foreach($this->detectors as $detector)
80  {
81  $detector->onDeactivate();
82  }
83  $this->onDeactivate();
84  }
onDeactivate()
Method calles on deactivation of the node.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeActivities()

ilBasicNode::executeActivities ( )
private

Executes all attached activities.

Definition at line 129 of file class.ilBasicNode.php.

Referenced by executeTransition().

130  {
131  if (count($this->activities) != 0)
132  {
133  foreach ($this->activities as $activity)
134  {
135  $activity->execute();
136  }
137  }
138  }
+ Here is the caller graph for this function:

◆ executeEmitters()

ilBasicNode::executeEmitters ( )
private

Executes all attached emitters.

Definition at line 143 of file class.ilBasicNode.php.

Referenced by executeTransition().

144  {
145  if (count($this->emitters) != 0)
146  {
147  foreach ($this->emitters as $emitter)
148  {
149  $emitter->emit();
150  }
151  }
152  }
+ Here is the caller graph for this function:

◆ executeTransition()

ilBasicNode::executeTransition ( )

Executes the transition, calls all activities and emitters to execute.

Implements ilNode.

Definition at line 157 of file class.ilBasicNode.php.

References deactivate(), executeActivities(), and executeEmitters().

Referenced by attemptTransition().

158  {
159  $this->deactivate();
160  $this->executeActivities();
161  $this->pingbackToPredecessorNodes();
162  $this->executeEmitters();
163  }
deactivate()
Deactivates the node.
executeEmitters()
Executes all attached emitters.
executeActivities()
Executes all attached activities.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isForwardConditionNode()

ilBasicNode::isForwardConditionNode ( )
Returns
boolean

Definition at line 183 of file class.ilBasicNode.php.

References $is_forward_condition_node.

184  {
186  }

◆ notifyDetectorSatisfaction()

ilBasicNode::notifyDetectorSatisfaction ( ilDetector  $detector)

This method is called by detectors, that just switched to being satisfied.

Parameters
ilDetector$detectorilDetector which is now satisfied.
Returns
mixed|void

Implements ilNode.

Definition at line 172 of file class.ilBasicNode.php.

References attemptTransition(), and ilBaseNode\isActive().

173  {
174  if ($this->isActive())
175  {
176  $this->attemptTransition();
177  }
178  }
isActive()
Returns the activation status of the node.
attemptTransition()
Attempts to transit the node.
+ Here is the call graph for this function:

◆ setIsForwardConditionNode()

ilBasicNode::setIsForwardConditionNode (   $is_forward_condition_node)
Parameters
boolean$is_forward_condition_node

Definition at line 191 of file class.ilBasicNode.php.

References $is_forward_condition_node.

192  {
193  $this->is_forward_condition_node = $is_forward_condition_node;
194  }

Field Documentation

◆ $ident

ilBasicNode::$ident

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

◆ $is_forward_condition_event

ilBasicNode::$is_forward_condition_event

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

◆ $is_forward_condition_node

ilBasicNode::$is_forward_condition_node
private

Definition at line 28 of file class.ilBasicNode.php.

Referenced by isForwardConditionNode(), and setIsForwardConditionNode().


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