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

PhpIncludeInspection More...

+ Inheritance diagram for ilBaseWorkflow:
+ Collaboration diagram for ilBaseWorkflow:

Public Member Functions

 __construct ()
 Default constructor. More...
 
 startWorkflow ()
 Starts the workflow, activating the start_node. More...
 
 stopWorkflow ()
 Stops the workflow, deactivating all nodes. More...
 
 onStartWorkflow ()
 Method called on start of the workflow, prior to activating the first node. More...
 
 onStopWorkflow ()
 Method called on stopping of the workflow, after deactivating all nodes. More...
 
 onWorkflowFinished ()
 Method called after workflow is finished, after detecting no more nodes are active. More...
 
 isActive ()
 Returns the activation status of the workflow. More...
 
 handleEvent ($params)
 Handles an event. More...
 
 registerDetector (ilDetector $detector)
 
 getWorkflowData ()
 Returns the workflow type and content currently set to the workflow. More...
 
 getWorkflowSubject ()
 Get the workflow subject set to the workflow. More...
 
 getWorkflowContext ()
 Get the event context set to the workflow. More...
 
 setDbId ($id)
 Sets the database id of the detector. More...
 
 getDbId ()
 Returns the database id of the detector if set. More...
 
 hasDbId ()
 Returns, if the detector has a database id. More...
 
 setStartNode (ilNode $node)
 Sets the start node of the workflow. More...
 
 addNode (ilNode $node)
 This method adds a node to the workflow. More...
 
 setWorkflowClass ($class)
 Sets the classname of the workflow definition. More...
 
 getWorkflowClass ()
 Returns the currently set workflow class definition name. More...
 
 setWorkflowLocation ($path)
 Sets the location of the workflow definition file as relative path. More...
 
 getWorkflowLocation ()
 Returns the currently set path to the workflow definition. More...
 
 getNodes ()
 Returns all nodes attached to the workflow. More...
 
 isDataPersistenceRequired ()
 
 resetDataPersistenceRequirement ()
 
 defineInstanceVar ($id, $name, $reference=false, $reference_target='', $type='mixed', $role='undefined')
 
 hasInstanceVarByName ($name)
 Returns if an instance variable of the given name is set. More...
 
 hasInstanceVarById ($id)
 Returns if an instance variable of the given id is set. More...
 
 getInstanceVarByName ($name)
 Returns the given instance variables content. More...
 
 getInstanceVarById ($id)
 Returns the given instance variables content. More...
 
 setInstanceVarByName ($name, $value)
 Sets the given instance var with the given content. More...
 
 setInstanceVarById ($id, $value)
 Sets the given instance var with the given content. More...
 
 setInstanceVarByRole ($role, $value)
 Sets the given instance var with the given content. More...
 
 getInstanceVars ()
 Returns an array with all set instance variables. More...
 
 flushInstanceVars ()
 Empties the instance variables. More...
 
 defineInputVar ($name)
 
 defineOutputVar ($name)
 
 readInputVar ($name)
 
 hasInputVar ($name)
 
 hasOutputVar ($name)
 
 writeInputVar ($name, $value)
 
 readOutputVar ($name)
 
 writeOutputVar ($name, $value)
 
 getInputVars ()
 
 getOutputVars ()
 
 registerInputVar ($name, $definition)
 
 registerOutputVar ($name)
 
- Public Member Functions inherited from ilWorkflow
 defineInstanceVar ($id, $name)
 

Static Public Member Functions

static autoload ($class_name)
 Autoloader function to dynamically include files for instantiation of objects during deserialization. More...
 

Protected Attributes

 $nodes
 
 $detectors
 
 $start_node
 
 $active
 Holds the activation state of the workflow. More...
 
 $db_id
 This holds the database id of the workflow. More...
 
 $workflow_type
 
 $workflow_content
 
 $workflow_class
 
 $workflow_location
 
 $workflow_subject_type
 
 $workflow_subject_identifier
 
 $workflow_context_type
 
 $workflow_context_identifier
 
 $instance_vars = array()
 
 $data_inputs
 
 $data_outputs
 
 $require_data_persistence = false
 

Detailed Description

PhpIncludeInspection

PhpIncludeInspection PhpIncludeInspection ilBaseWorkflow is part of the petri net based workflow engine.

The base workflow class is the ancestor for all concrete workflow implementations.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

/

Definition at line 21 of file class.ilBaseWorkflow.php.

Constructor & Destructor Documentation

◆ __construct()

ilBaseWorkflow::__construct ( )

Default constructor.

Here the definition of the workflow is to be done.

Definition at line 149 of file class.ilBaseWorkflow.php.

150  {
151  }

Member Function Documentation

◆ addNode()

ilBaseWorkflow::addNode ( ilNode  $node)

This method adds a node to the workflow.

Parameters
ilNode$node

Implements ilWorkflow.

Definition at line 367 of file class.ilBaseWorkflow.php.

Referenced by StartEvent_Blank\__construct(), ParallelGateway_Simple\__construct(), Task_Simple\__construct(), EndEvent_Blanko_Simple\__construct(), ParallelGateway_Forking\__construct(), Task_ManualTask_Simple\__construct(), ParallelGateway_Joining\__construct(), DataInput_WithProperties\__construct(), Data_Wiring_Input_Task\__construct(), InclusiveGateway_Simple\__construct(), DataObject_Role\__construct(), ComplexGateway_Blanko_Simple\__construct(), DataObject_Simple\__construct(), IntermediateCatchEvent_Message_Simple\__construct(), EndEvent_Message_Simple\__construct(), ExclusiveGateway_Join_Simple\__construct(), IntermediateCatchEvent_Signal_Simple\__construct(), IntermediateCatchEvent_Timer_Simple\__construct(), IntermediateThrowEvent_Message_Simple\__construct(), IntermediateThrowEvent_Signal_Simple\__construct(), ExclusiveGateway_Fork_Simple\__construct(), DataOutput_Simple\__construct(), Task_ScriptTask_Simple\__construct(), DataInput_Simple\__construct(), Task_CallActivity_Simple\__construct(), EndEvent_Signal_Simple\__construct(), EndEvent_Terminate_Simple\__construct(), DataInput_RepositoryObjectSelector\__construct(), DataObject_Wiring_Input_Object_Output\__construct(), EventBasedGateway_Blanko_Simple\__construct(), Task_ReadLearnersFromCourse\__construct(), StartEvent_Message\__construct(), StartEvent_Timer_Date\__construct(), StartEvent_Signal\__construct(), StartEvent_Multistart\__construct(), and Booking_System_FullDiagram\__construct().

368  {
369  $this->nodes[] = $node;
370  }
+ Here is the caller graph for this function:

◆ autoload()

static ilBaseWorkflow::autoload (   $class_name)
static

Autoloader function to dynamically include files for instantiation of objects during deserialization.

Parameters
string$class_name

Definition at line 436 of file class.ilBaseWorkflow.php.

References $filename.

437  {
438  switch(true)
439  {
440  case strtolower(substr($class_name, strlen($class_name) - 8, 8)) == 'activity':
441  $componentDirectory = 'activities';
442  break;
443 
444  case strtolower(substr($class_name, strlen($class_name) - 8, 8)) == 'detector':
445  $componentDirectory = 'detectors';
446  break;
447 
448  case strtolower(substr($class_name, strlen($class_name) - 7, 7)) == 'emitter':
449  $componentDirectory = 'emitters';
450  break;
451 
452  case strtolower(substr($class_name, strlen($class_name) - 4, 4)) == 'node':
453  $componentDirectory = 'node';
454  break;
455 
456  default:
457  return;
458  }
459 
460  $filename = './Services/WorkflowEngine/classes/' . $componentDirectory . '/class.'.$class_name.'.php';
461  if(file_exists($filename))
462  {
463  require_once $filename;
464  }
465  }

◆ defineInputVar()

ilBaseWorkflow::defineInputVar (   $name)
Deprecated:

Definition at line 702 of file class.ilBaseWorkflow.php.

703  {
704  $this->data_inputs[$name] = null;
705  $this->require_data_persistence = true;
706  }

◆ defineInstanceVar()

ilBaseWorkflow::defineInstanceVar (   $id,
  $name,
  $reference = false,
  $reference_target = '',
  $type = 'mixed',
  $role = 'undefined' 
)
Parameters
string$id
string$name
bool$reference
string$reference_target
string$type
string$role

Definition at line 503 of file class.ilBaseWorkflow.php.

References array.

Referenced by DataInput_RepositoryObjectSelector\__construct(), DataInput_WithProperties\__construct(), Data_Wiring_Input_Task\__construct(), DataOutput_Simple\__construct(), DataObject_Simple\__construct(), DataObject_Role\__construct(), DataInput_Simple\__construct(), DataObject_Wiring_Input_Object_Output\__construct(), Task_ReadLearnersFromCourse\__construct(), and Booking_System_FullDiagram\__construct().

505  {
506  $this->instance_vars[] = array(
507  'id' => $id,
508  'name' => $name,
509  'value' => null,
510  'reference' => $reference,
511  'target' => $reference_target,
512  'type' => $type,
513  'role' => $role
514  );
515  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ defineOutputVar()

ilBaseWorkflow::defineOutputVar (   $name)
Deprecated:

Definition at line 711 of file class.ilBaseWorkflow.php.

712  {
713  $this->data_outputs[$name] = null;
714  $this->require_data_persistence = true;
715  }

◆ flushInstanceVars()

ilBaseWorkflow::flushInstanceVars ( )

Empties the instance variables.

Implements ilWorkflow.

Definition at line 690 of file class.ilBaseWorkflow.php.

References array.

691  {
692  $this->instance_vars = array();
693  }
Create styles array
The data for the language used.

◆ getDbId()

ilBaseWorkflow::getDbId ( )

Returns the database id of the detector if set.

Returns
int
Exceptions

Implements ilWorkflow.

Definition at line 325 of file class.ilBaseWorkflow.php.

References $db_id.

326  {
327  if ($this->db_id != null)
328  {
329  return $this->db_id;
330  }
331  else
332  {
333  require_once './Services/WorkflowEngine/exceptions/ilWorkflowObjectStateException.php';
334  throw new ilWorkflowObjectStateException('No database ID set.');
335  }
336  }
$db_id
This holds the database id of the workflow.

◆ getInputVars()

ilBaseWorkflow::getInputVars ( )

Definition at line 775 of file class.ilBaseWorkflow.php.

References $data_inputs, and array.

776  {
777  return (array)$this->data_inputs;
778  }
Create styles array
The data for the language used.

◆ getInstanceVarById()

ilBaseWorkflow::getInstanceVarById (   $id)

Returns the given instance variables content.

Parameters
string$nameName of the variable.
Returns
mixed Content of the variable.

Implements ilWorkflow.

Definition at line 585 of file class.ilBaseWorkflow.php.

586  {
587  foreach($this->instance_vars as $instance_var)
588  {
589  if($instance_var['id'] == $id)
590  {
591  if($instance_var['reference'] === true)
592  {
593  return $this->getInstanceVarById($instance_var['target']);
594  }
595  else
596  {
597  return $instance_var['value'];
598  }
599  }
600  }
601  return false;
602  }
getInstanceVarById($id)
Returns the given instance variables content.

◆ getInstanceVarByName()

ilBaseWorkflow::getInstanceVarByName (   $name)

Returns the given instance variables content.

Parameters
string$nameName of the variable.
Returns
mixed Content of the variable.

Implements ilWorkflow.

Definition at line 560 of file class.ilBaseWorkflow.php.

561  {
562  foreach($this->instance_vars as &$instance_var)
563  {
564  if($instance_var['name'] == $name)
565  {
566  if($instance_var['reference'] === true)
567  {
568  return $this->getInstanceVarByName($instance_var['target']);
569  }
570  else
571  {
572  return $instance_var['value'];
573  }
574  }
575  }
576  return false;
577  }
getInstanceVarByName($name)
Returns the given instance variables content.

◆ getInstanceVars()

ilBaseWorkflow::getInstanceVars ( )

Returns an array with all set instance variables.

Returns
array Associative array of mixed.

Implements ilWorkflow.

Definition at line 682 of file class.ilBaseWorkflow.php.

References $instance_vars, and array.

683  {
684  return (array) $this->instance_vars;
685  }
Create styles array
The data for the language used.

◆ getNodes()

ilBaseWorkflow::getNodes ( )

Returns all nodes attached to the workflow.

Returns
ilNode[]

Definition at line 425 of file class.ilBaseWorkflow.php.

References $nodes.

426  {
427  return $this->nodes;
428  }

◆ getOutputVars()

ilBaseWorkflow::getOutputVars ( )
Deprecated:

Definition at line 783 of file class.ilBaseWorkflow.php.

References $data_outputs, and array.

784  {
785  return (array)$this->data_outputs;
786  }
Create styles array
The data for the language used.

◆ getWorkflowClass()

ilBaseWorkflow::getWorkflowClass ( )

Returns the currently set workflow class definition name.

See also
$this->workflow_class
Returns
string Class name

Implements ilWorkflow.

Definition at line 391 of file class.ilBaseWorkflow.php.

References $workflow_class.

392  {
393  return $this->workflow_class;
394  }

◆ getWorkflowContext()

ilBaseWorkflow::getWorkflowContext ( )

Get the event context set to the workflow.

Returns
array array('type' => $this->workflow_context_type, 'identifier' => $this->workflow_context_identifier)

Implements ilWorkflow.

Definition at line 304 of file class.ilBaseWorkflow.php.

References array.

305  {
306  return array('type' => $this->workflow_context_type, 'identifier' => $this->workflow_context_identifier);
307  }
Create styles array
The data for the language used.

◆ getWorkflowData()

ilBaseWorkflow::getWorkflowData ( )

Returns the workflow type and content currently set to the workflow.

Returns
array array('type' => $this->workflow_type, 'content' => $this->workflow_content)

Implements ilWorkflow.

Definition at line 284 of file class.ilBaseWorkflow.php.

References array.

285  {
286  return array('type' => $this->workflow_type, 'content' => $this->workflow_content);
287  }
Create styles array
The data for the language used.

◆ getWorkflowLocation()

ilBaseWorkflow::getWorkflowLocation ( )

Returns the currently set path to the workflow definition.

See also
$this->workflow_location
Returns
string

Implements ilWorkflow.

Definition at line 415 of file class.ilBaseWorkflow.php.

References $workflow_location.

416  {
418  }

◆ getWorkflowSubject()

ilBaseWorkflow::getWorkflowSubject ( )

Get the workflow subject set to the workflow.

Returns
array array('type' => $this->workflow_subject_type, 'identifier' => $this->workflow_subject_identifier)

Implements ilWorkflow.

Definition at line 294 of file class.ilBaseWorkflow.php.

References array.

295  {
296  return array('type' => $this->workflow_subject_type, 'identifier' => $this->workflow_subject_identifier);
297  }
Create styles array
The data for the language used.

◆ handleEvent()

ilBaseWorkflow::handleEvent (   $params)

Handles an event.

The event is passed to all active event handlers.

Parameters
string[]$params

Implements ilWorkflow.

Definition at line 242 of file class.ilBaseWorkflow.php.

References $params, array, and onWorkflowFinished().

243  {
244  $active_nodes_available = false;
245  // Hier nur an aktive Nodes dispatchen.
246  foreach ((array)$this->detectors as $detector)
247  {
248  $node = $detector->getContext();
249  if ($node->isActive())
250  {
251  $detector->trigger($params);
252  $node = $detector->getContext();
253  if ($node->isActive())
254  {
255  $active_nodes_available = true;
256  }
257  }
258  }
259 
260  if ($active_nodes_available == false)
261  {
262  $this->active = false;
263  $this->onWorkflowFinished();
264  }
265  }
onWorkflowFinished()
Method called after workflow is finished, after detecting no more nodes are active.
Create styles array
The data for the language used.
$params
Definition: example_049.php:96
+ Here is the call graph for this function:

◆ hasDbId()

ilBaseWorkflow::hasDbId ( )

Returns, if the detector has a database id.

Returns
boolean If a database id is set.

Implements ilWorkflow.

Definition at line 342 of file class.ilBaseWorkflow.php.

343  {
344  if ($this->db_id == null)
345  {
346  return false;
347  }
348  return true;
349  }

◆ hasInputVar()

ilBaseWorkflow::hasInputVar (   $name)
Deprecated:

Definition at line 732 of file class.ilBaseWorkflow.php.

References array.

733  {
734  return array_key_exists($name, (array)$this->data_inputs);
735  }
Create styles array
The data for the language used.

◆ hasInstanceVarById()

ilBaseWorkflow::hasInstanceVarById (   $id)

Returns if an instance variable of the given id is set.

Parameters
string$id
Returns
boolean True, if a variable by that id is set.

Implements ilWorkflow.

Definition at line 542 of file class.ilBaseWorkflow.php.

543  {
544  foreach($this->instance_vars as $instance_var)
545  {
546  if($instance_var['id'] == $id)
547  {
548  return true;
549  }
550  }
551  return false;
552  }

◆ hasInstanceVarByName()

ilBaseWorkflow::hasInstanceVarByName (   $name)

Returns if an instance variable of the given name is set.

Parameters
string$name
Returns
boolean True, if a variable by that name is set.

Implements ilWorkflow.

Definition at line 523 of file class.ilBaseWorkflow.php.

524  {
525  foreach($this->instance_vars as $instance_var)
526  {
527  if($instance_var['name'] == $name)
528  {
529  return true;
530  }
531  }
532  return false;
533  }

◆ hasOutputVar()

ilBaseWorkflow::hasOutputVar (   $name)
Deprecated:

Definition at line 740 of file class.ilBaseWorkflow.php.

References array.

741  {
742  return array_key_exists($name, (array)$this->data_outputs);
743  }
Create styles array
The data for the language used.

◆ isActive()

ilBaseWorkflow::isActive ( )

Returns the activation status of the workflow.

Returns
boolean

Implements ilWorkflow.

Definition at line 230 of file class.ilBaseWorkflow.php.

References $active.

231  {
232  return (bool)$this->active;
233  }
$active
Holds the activation state of the workflow.

◆ isDataPersistenceRequired()

ilBaseWorkflow::isDataPersistenceRequired ( )
Returns
bool

Implements ilWorkflow.

Definition at line 470 of file class.ilBaseWorkflow.php.

References $require_data_persistence.

471  {
473  }

◆ onStartWorkflow()

ilBaseWorkflow::onStartWorkflow ( )

Method called on start of the workflow, prior to activating the first node.

Returns
void

Implements ilWorkflow.

Definition at line 196 of file class.ilBaseWorkflow.php.

Referenced by startWorkflow().

197  {
198  return;
199  }
+ Here is the caller graph for this function:

◆ onStopWorkflow()

ilBaseWorkflow::onStopWorkflow ( )

Method called on stopping of the workflow, after deactivating all nodes.

Please note: Stopping a workflow 'cancels' the execution. The graceful end of a workflow is handled with

See also
onWorkflowFinished().
Returns
void

Implements ilWorkflow.

Definition at line 208 of file class.ilBaseWorkflow.php.

Referenced by stopWorkflow().

209  {
210  return;
211  }
+ Here is the caller graph for this function:

◆ onWorkflowFinished()

ilBaseWorkflow::onWorkflowFinished ( )

Method called after workflow is finished, after detecting no more nodes are active.

This is the graceful end of the workflow. Forced shutdown of a workflow is handled in

See also
onStopWorkflow().
Returns
void

Implements ilWorkflow.

Definition at line 220 of file class.ilBaseWorkflow.php.

Referenced by handleEvent().

221  {
222  return;
223  }
+ Here is the caller graph for this function:

◆ readInputVar()

ilBaseWorkflow::readInputVar (   $name)
Deprecated:

Definition at line 720 of file class.ilBaseWorkflow.php.

721  {
722  if($this->data_inputs[$name])
723  {
724  return $this->data_inputs[$name];
725  }
726  return null;
727  }

◆ readOutputVar()

ilBaseWorkflow::readOutputVar (   $name)
Deprecated:

Definition at line 757 of file class.ilBaseWorkflow.php.

758  {
759  if($this->data_outputs[$name])
760  {
761  return $this->data_outputs[$name];
762  }
763  return null;
764  }

◆ registerDetector()

ilBaseWorkflow::registerDetector ( ilDetector  $detector)
Parameters
\ilDetector$detector

Implements ilWorkflow.

Definition at line 270 of file class.ilBaseWorkflow.php.

271  {
272  $reflection_class = new ReflectionClass($detector);
273  if (in_array('ilExternalDetector', $reflection_class->getInterfaceNames()))
274  {
275  $this->detectors[] = $detector;
276  }
277  }

◆ registerInputVar()

ilBaseWorkflow::registerInputVar (   $name,
  $definition 
)
Parameters
string$name
mixed$definition

Definition at line 792 of file class.ilBaseWorkflow.php.

Referenced by DataInput_RepositoryObjectSelector\__construct(), DataInput_WithProperties\__construct(), Data_Wiring_Input_Task\__construct(), DataInput_Simple\__construct(), DataObject_Wiring_Input_Object_Output\__construct(), and Task_ReadLearnersFromCourse\__construct().

793  {
794  $definition['name'] = $name;
795  $this->data_inputs[$name] = $definition;
796  }
+ Here is the caller graph for this function:

◆ registerOutputVar()

ilBaseWorkflow::registerOutputVar (   $name)
Parameters
string$name

Definition at line 801 of file class.ilBaseWorkflow.php.

References array.

Referenced by DataOutput_Simple\__construct(), and DataObject_Wiring_Input_Object_Output\__construct().

802  {
803  $this->data_outputs[] = $name;
804  }
+ Here is the caller graph for this function:

◆ resetDataPersistenceRequirement()

ilBaseWorkflow::resetDataPersistenceRequirement ( )
Returns
void

Implements ilWorkflow.

Definition at line 478 of file class.ilBaseWorkflow.php.

479  {
480  $this->require_data_persistence = false;
481  }

◆ setDbId()

ilBaseWorkflow::setDbId (   $id)

Sets the database id of the detector.

Parameters
integer$id

Implements ilWorkflow.

Definition at line 314 of file class.ilBaseWorkflow.php.

315  {
316  $this->db_id = $id;
317  }

◆ setInstanceVarById()

ilBaseWorkflow::setInstanceVarById (   $id,
  $value 
)

Sets the given instance var with the given content.

Parameters
string$idName of the variable
mixed$value

Implements ilWorkflow.

Definition at line 633 of file class.ilBaseWorkflow.php.

Referenced by setInstanceVarByName(), and setInstanceVarByRole().

634  {
635  foreach($this->instance_vars as &$instance_var)
636  {
637  if($instance_var['id'] == $id)
638  {
639  if($instance_var['reference'] === true)
640  {
641  $this->setInstanceVarById($instance_var['target'], $value);
642  }
643  else
644  {
645  $instance_var['value'] = $value;
646  return;
647  }
648  }
649  }
650  }
setInstanceVarById($id, $value)
Sets the given instance var with the given content.
+ Here is the caller graph for this function:

◆ setInstanceVarByName()

ilBaseWorkflow::setInstanceVarByName (   $name,
  $value 
)

Sets the given instance var with the given content.

Parameters
string$nameName of the variable
mixed$value

Implements ilWorkflow.

Definition at line 609 of file class.ilBaseWorkflow.php.

References setInstanceVarById().

610  {
611  foreach($this->instance_vars as &$instance_var)
612  {
613  if($instance_var['name'] == $name)
614  {
615  if($instance_var['reference'] === true)
616  {
617  $this->setInstanceVarById($instance_var['target'], $value);
618  }
619  else
620  {
621  $instance_var['value'] = $value;
622  }
623  }
624  }
625  }
setInstanceVarById($id, $value)
Sets the given instance var with the given content.
+ Here is the call graph for this function:

◆ setInstanceVarByRole()

ilBaseWorkflow::setInstanceVarByRole (   $role,
  $value 
)

Sets the given instance var with the given content.

only during startup to write event params

Parameters
string$roleRole of the variable
mixed$value

Definition at line 658 of file class.ilBaseWorkflow.php.

References setInstanceVarById().

659  {
660  foreach($this->instance_vars as &$instance_var)
661  {
662  if($instance_var['role'] == $role)
663  {
664  if($instance_var['reference'] === true)
665  {
666  $this->setInstanceVarById($instance_var['target'], $value);
667  }
668  else
669  {
670  $instance_var['value'] = $value;
671  return;
672  }
673  }
674  }
675  }
setInstanceVarById($id, $value)
Sets the given instance var with the given content.
+ Here is the call graph for this function:

◆ setStartNode()

ilBaseWorkflow::setStartNode ( ilNode  $node)

Sets the start node of the workflow.

This node is activated, when the workflow is started.

Parameters
ilNode$node

Implements ilWorkflow.

Definition at line 357 of file class.ilBaseWorkflow.php.

Referenced by StartEvent_Blank\__construct(), ParallelGateway_Joining\__construct(), EndEvent_Blanko_Simple\__construct(), ParallelGateway_Simple\__construct(), Task_ManualTask_Simple\__construct(), ParallelGateway_Forking\__construct(), Task_Simple\__construct(), DataInput_Simple\__construct(), DataInput_RepositoryObjectSelector\__construct(), DataObject_Role\__construct(), ComplexGateway_Blanko_Simple\__construct(), IntermediateCatchEvent_Timer_Simple\__construct(), EndEvent_Signal_Simple\__construct(), EndEvent_Message_Simple\__construct(), Task_CallActivity_Simple\__construct(), IntermediateThrowEvent_Message_Simple\__construct(), ExclusiveGateway_Join_Simple\__construct(), IntermediateThrowEvent_Signal_Simple\__construct(), IntermediateCatchEvent_Signal_Simple\__construct(), IntermediateCatchEvent_Message_Simple\__construct(), InclusiveGateway_Simple\__construct(), Task_ScriptTask_Simple\__construct(), EndEvent_Terminate_Simple\__construct(), DataObject_Simple\__construct(), Data_Wiring_Input_Task\__construct(), DataInput_WithProperties\__construct(), ExclusiveGateway_Fork_Simple\__construct(), DataOutput_Simple\__construct(), EventBasedGateway_Blanko_Simple\__construct(), DataObject_Wiring_Input_Object_Output\__construct(), Task_ReadLearnersFromCourse\__construct(), and StartEvent_Multistart\__construct().

358  {
359  $this->start_node = $node;
360  }
+ Here is the caller graph for this function:

◆ setWorkflowClass()

ilBaseWorkflow::setWorkflowClass (   $class)

Sets the classname of the workflow definition.

See also
$this->workflow_class
Parameters
string$class

Definition at line 379 of file class.ilBaseWorkflow.php.

380  {
381  $this->workflow_class = $class;
382  }

◆ setWorkflowLocation()

ilBaseWorkflow::setWorkflowLocation (   $path)

Sets the location of the workflow definition file as relative path.

See also
$this->workflow_location
Parameters
string$pathe.g. Services/WorkflowEngine

Definition at line 403 of file class.ilBaseWorkflow.php.

References $path.

404  {
405  $this->workflow_location = $path;
406  }
$path
Definition: aliased.php:25

◆ startWorkflow()

ilBaseWorkflow::startWorkflow ( )

Starts the workflow, activating the start_node.

Implements ilWorkflow.

Definition at line 156 of file class.ilBaseWorkflow.php.

References onStartWorkflow().

157  {
158  // Write the workflow to the database, so detectors find a parent id to save with them.
159  require_once './Services/WorkflowEngine/classes/utils/class.ilWorkflowDbHelper.php';
160  $this->active = true;
161  ilWorkflowDbHelper::writeWorkflow($this);
162  $this->onStartWorkflow();
163 
164  // Figure out, if there is a start-node set - or nodes at all.
165  if ($this->start_node == null)
166  {
167  if (count($this->nodes) != 0)
168  {
169  $this->start_node = $this->nodes[0];
170  } else {
171  //ilWorkflowDbHelper::deleteWorkflow($this);
172  throw new Exception ('No start_node, no node, no start. Doh.');
173  }
174  }
175  $this->start_node->activate();
176  ilWorkflowDbHelper::writeWorkflow($this);
177  }
onStartWorkflow()
Method called on start of the workflow, prior to activating the first node.
+ Here is the call graph for this function:

◆ stopWorkflow()

ilBaseWorkflow::stopWorkflow ( )

Stops the workflow, deactivating all nodes.

Implements ilWorkflow.

Definition at line 182 of file class.ilBaseWorkflow.php.

References onStopWorkflow().

183  {
184  $this->active = false;
185  foreach ($this->nodes as $node)
186  {
187  $node->deactivate();
188  }
189  $this->onStopWorkflow();
190  }
onStopWorkflow()
Method called on stopping of the workflow, after deactivating all nodes.
+ Here is the call graph for this function:

◆ writeInputVar()

ilBaseWorkflow::writeInputVar (   $name,
  $value 
)
Deprecated:

Definition at line 748 of file class.ilBaseWorkflow.php.

749  {
750  $this->data_inputs[$name] = $value;
751  $this->require_data_persistence = true;
752  }

◆ writeOutputVar()

ilBaseWorkflow::writeOutputVar (   $name,
  $value 
)
Deprecated:

Definition at line 769 of file class.ilBaseWorkflow.php.

770  {
771  $this->data_outputs[$name] = $value;
772  $this->require_data_persistence = true;
773  }

Field Documentation

◆ $active

boolean ilBaseWorkflow::$active
protected

Holds the activation state of the workflow.

Definition at line 49 of file class.ilBaseWorkflow.php.

Referenced by isActive().

◆ $data_inputs

ilBaseWorkflow::$data_inputs
protected

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

Referenced by getInputVars().

◆ $data_outputs

ilBaseWorkflow::$data_outputs
protected

Definition at line 139 of file class.ilBaseWorkflow.php.

Referenced by getOutputVars().

◆ $db_id

integer ilBaseWorkflow::$db_id
protected

This holds the database id of the workflow.

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

Referenced by getDbId().

◆ $detectors

ilBaseWorkflow::$detectors
protected

Definition at line 35 of file class.ilBaseWorkflow.php.

◆ $instance_vars

ilBaseWorkflow::$instance_vars = array()
protected

Definition at line 133 of file class.ilBaseWorkflow.php.

Referenced by getInstanceVars().

◆ $nodes

ilBaseWorkflow::$nodes
protected

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

Referenced by getNodes().

◆ $require_data_persistence

ilBaseWorkflow::$require_data_persistence = false
protected

Definition at line 142 of file class.ilBaseWorkflow.php.

Referenced by isDataPersistenceRequired().

◆ $start_node

ilBaseWorkflow::$start_node
protected

Definition at line 42 of file class.ilBaseWorkflow.php.

◆ $workflow_class

ilBaseWorkflow::$workflow_class
protected

Definition at line 85 of file class.ilBaseWorkflow.php.

Referenced by getWorkflowClass().

◆ $workflow_content

ilBaseWorkflow::$workflow_content
protected

Definition at line 79 of file class.ilBaseWorkflow.php.

◆ $workflow_context_identifier

ilBaseWorkflow::$workflow_context_identifier
protected

Definition at line 126 of file class.ilBaseWorkflow.php.

◆ $workflow_context_type

ilBaseWorkflow::$workflow_context_type
protected

Definition at line 117 of file class.ilBaseWorkflow.php.

◆ $workflow_location

ilBaseWorkflow::$workflow_location
protected

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

Referenced by getWorkflowLocation().

◆ $workflow_subject_identifier

ilBaseWorkflow::$workflow_subject_identifier
protected

Definition at line 108 of file class.ilBaseWorkflow.php.

◆ $workflow_subject_type

ilBaseWorkflow::$workflow_subject_type
protected

Definition at line 100 of file class.ilBaseWorkflow.php.

◆ $workflow_type

ilBaseWorkflow::$workflow_type
protected

Definition at line 68 of file class.ilBaseWorkflow.php.


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