5require_once
'./Services/WorkflowEngine/classes/nodes/class.ilBaseNode.php';
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));
64 foreach ($this->detectors as $detector) {
65 $detector->onActivate();
76 $this->active =
false;
77 foreach ($this->detectors as $detector) {
78 $detector->onDeactivate();
91 $isPreconditionMet =
true;
92 foreach ($this->detectors as $detector) {
93 if ($isPreconditionMet ==
true) {
94 $isPreconditionMet = $detector->getDetectorState();
97 return $isPreconditionMet;
123 if (count($this->activities) != 0) {
124 foreach ($this->activities as $activity) {
125 $activity->execute();
135 if (count($this->emitters) != 0) {
136 foreach ($this->emitters as $emitter) {
149 $this->pingbackToPredecessorNodes();
190 public function deactivateForwardConditionNodes(
ilNode $activated_node)
192 if ($this->is_forward_condition_node) {
193 foreach ($this->emitters as $emitter) {
195 $target_detector = $emitter->getTargetDetector();
198 $target_node = $target_detector->getContext();
200 if ($target_node === $activated_node) {
203 $target_node->deactivate();
208 public function pingbackToPredecessorNodes()
211 foreach ($this->detectors as $detector) {
213 $source_node = $detector->getSourceNode();
214 if ($source_node && $source_node->is_forward_condition_node) {
215 $source_node->deactivateForwardConditionNodes($this);
An exception for terminatinating execution or to throw for unit testing.
@noinspection PhpIncludeInspection
onDeactivate()
Method calles on deactivation of the node.
isActive()
Returns the activation status of the node.
onActivate()
Method called on activation of the node.
@noinspection PhpIncludeInspection
__construct(ilWorkflow $context)
Default constructor.
activate()
Activates the node.
executeEmitters()
Executes all attached emitters.
notifyDetectorSatisfaction(ilDetector $detector)
This method is called by detectors, that just switched to being satisfied.
checkTransitionPreconditions()
Checks, if the preconditions of the node to transit are met.
deactivate()
Deactivates the node.
attemptTransition()
Attempts to transit the node.
$is_forward_condition_event
executeTransition()
Executes the transition, calls all activities and emitters to execute.
setIsForwardConditionNode($is_forward_condition_node)
executeActivities()
Executes all attached activities.
$is_forward_condition_node
ilDetector Interface is part of the petri net based workflow engine.
@noinspection PhpIncludeInspection
@noinspection PhpIncludeInspection