ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 355 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().

356  {
357  $this->nodes[] = $node;
358  }
+ 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 424 of file class.ilBaseWorkflow.php.

References $filename.

425  {
426  switch (true) {
427  case strtolower(substr($class_name, strlen($class_name) - 8, 8)) == 'activity':
428  $componentDirectory = 'activities';
429  break;
430 
431  case strtolower(substr($class_name, strlen($class_name) - 8, 8)) == 'detector':
432  $componentDirectory = 'detectors';
433  break;
434 
435  case strtolower(substr($class_name, strlen($class_name) - 7, 7)) == 'emitter':
436  $componentDirectory = 'emitters';
437  break;
438 
439  case strtolower(substr($class_name, strlen($class_name) - 4, 4)) == 'node':
440  $componentDirectory = 'node';
441  break;
442 
443  default:
444  return;
445  }
446 
447  $filename = './Services/WorkflowEngine/classes/' . $componentDirectory . '/class.' . $class_name . '.php';
448  if (file_exists($filename)) {
449  require_once $filename;
450  }
451  }

◆ defineInputVar()

ilBaseWorkflow::defineInputVar (   $name)
Deprecated:

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

References $name.

665  {
666  $this->data_inputs[$name] = null;
667  $this->require_data_persistence = true;
668  }
if($format !==null) $name
Definition: metadata.php:146

◆ 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 489 of file class.ilBaseWorkflow.php.

References $id, $name, $type, and 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().

496  {
497  $this->instance_vars[] = array(
498  'id' => $id,
499  'name' => $name,
500  'value' => null,
501  'reference' => $reference,
502  'target' => $reference_target,
503  'type' => $type,
504  'role' => $role
505  );
506  }
$type
if(!array_key_exists('StateId', $_REQUEST)) $id
if($format !==null) $name
Definition: metadata.php:146
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 673 of file class.ilBaseWorkflow.php.

References $name.

674  {
675  $this->data_outputs[$name] = null;
676  $this->require_data_persistence = true;
677  }
if($format !==null) $name
Definition: metadata.php:146

◆ flushInstanceVars()

ilBaseWorkflow::flushInstanceVars ( )

Empties the instance variables.

Implements ilWorkflow.

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

References array.

653  {
654  $this->instance_vars = array();
655  }
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 317 of file class.ilBaseWorkflow.php.

References $db_id.

318  {
319  if ($this->db_id != null) {
320  return $this->db_id;
321  } else {
322  require_once './Services/WorkflowEngine/exceptions/ilWorkflowObjectStateException.php';
323  throw new ilWorkflowObjectStateException('No database ID set.');
324  }
325  }
$db_id
This holds the database id of the workflow.

◆ getInputVars()

ilBaseWorkflow::getInputVars ( )

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

References $data_inputs, and array.

736  {
737  return (array) $this->data_inputs;
738  }
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 567 of file class.ilBaseWorkflow.php.

References $id.

568  {
569  foreach ($this->instance_vars as $instance_var) {
570  if ($instance_var['id'] == $id) {
571  if ($instance_var['reference'] === true) {
572  return $this->getInstanceVarById($instance_var['target']);
573  } else {
574  return $instance_var['value'];
575  }
576  }
577  }
578  return false;
579  }
if(!array_key_exists('StateId', $_REQUEST)) $id
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 547 of file class.ilBaseWorkflow.php.

References $name.

548  {
549  foreach ($this->instance_vars as &$instance_var) {
550  if ($instance_var['name'] == $name) {
551  if ($instance_var['reference'] === true) {
552  return $this->getInstanceVarByName($instance_var['target']);
553  } else {
554  return $instance_var['value'];
555  }
556  }
557  }
558  return false;
559  }
getInstanceVarByName($name)
Returns the given instance variables content.
if($format !==null) $name
Definition: metadata.php:146

◆ getInstanceVars()

ilBaseWorkflow::getInstanceVars ( )

Returns an array with all set instance variables.

Returns
array Associative array of mixed.

Implements ilWorkflow.

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

References $instance_vars, and array.

645  {
646  return (array) $this->instance_vars;
647  }
Create styles array
The data for the language used.

◆ getNodes()

ilBaseWorkflow::getNodes ( )

Returns all nodes attached to the workflow.

Returns
ilNode[]

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

References $nodes.

414  {
415  return $this->nodes;
416  }

◆ getOutputVars()

ilBaseWorkflow::getOutputVars ( )
Deprecated:

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

References $data_outputs, and array.

744  {
745  return (array) $this->data_outputs;
746  }
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 379 of file class.ilBaseWorkflow.php.

References $workflow_class.

380  {
381  return $this->workflow_class;
382  }

◆ 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 296 of file class.ilBaseWorkflow.php.

References array.

297  {
298  return array('type' => $this->workflow_context_type, 'identifier' => $this->workflow_context_identifier);
299  }
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 276 of file class.ilBaseWorkflow.php.

References array.

277  {
278  return array('type' => $this->workflow_type, 'content' => $this->workflow_content);
279  }
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 403 of file class.ilBaseWorkflow.php.

References $workflow_location.

404  {
406  }

◆ 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 286 of file class.ilBaseWorkflow.php.

References array.

287  {
288  return array('type' => $this->workflow_subject_type, 'identifier' => $this->workflow_subject_identifier);
289  }
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 239 of file class.ilBaseWorkflow.php.

References $params, array, and onWorkflowFinished().

240  {
241  $active_nodes_available = false;
242  // Hier nur an aktive Nodes dispatchen.
243  foreach ((array) $this->detectors as $detector) {
244  $node = $detector->getContext();
245  if ($node->isActive()) {
246  $detector->trigger($params);
247  $node = $detector->getContext();
248  if ($node->isActive()) {
249  $active_nodes_available = true;
250  }
251  }
252  }
253 
254  if ($active_nodes_available == false) {
255  $this->active = false;
256  $this->onWorkflowFinished();
257  }
258  }
$params
Definition: disable.php:11
onWorkflowFinished()
Method called after workflow is finished, after detecting no more nodes are active.
Create styles array
The data for the language used.
+ 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 331 of file class.ilBaseWorkflow.php.

332  {
333  if ($this->db_id == null) {
334  return false;
335  }
336  return true;
337  }

◆ hasInputVar()

ilBaseWorkflow::hasInputVar (   $name)
Deprecated:

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

References $name, and array.

694  {
695  return array_key_exists($name, (array) $this->data_inputs);
696  }
if($format !==null) $name
Definition: metadata.php:146
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 531 of file class.ilBaseWorkflow.php.

References $id.

532  {
533  foreach ($this->instance_vars as $instance_var) {
534  if ($instance_var['id'] == $id) {
535  return true;
536  }
537  }
538  return false;
539  }
if(!array_key_exists('StateId', $_REQUEST)) $id

◆ 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 514 of file class.ilBaseWorkflow.php.

References $name.

515  {
516  foreach ($this->instance_vars as $instance_var) {
517  if ($instance_var['name'] == $name) {
518  return true;
519  }
520  }
521  return false;
522  }
if($format !==null) $name
Definition: metadata.php:146

◆ hasOutputVar()

ilBaseWorkflow::hasOutputVar (   $name)
Deprecated:

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

References $name, and array.

702  {
703  return array_key_exists($name, (array) $this->data_outputs);
704  }
if($format !==null) $name
Definition: metadata.php:146
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 227 of file class.ilBaseWorkflow.php.

References $active.

228  {
229  return (bool) $this->active;
230  }
$active
Holds the activation state of the workflow.

◆ isDataPersistenceRequired()

ilBaseWorkflow::isDataPersistenceRequired ( )
Returns
bool

Implements ilWorkflow.

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

References $require_data_persistence.

457  {
459  }

◆ onStartWorkflow()

ilBaseWorkflow::onStartWorkflow ( )

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

Returns
void

Implements ilWorkflow.

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

Referenced by startWorkflow().

194  {
195  return;
196  }
+ 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 205 of file class.ilBaseWorkflow.php.

Referenced by stopWorkflow().

206  {
207  return;
208  }
+ 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 217 of file class.ilBaseWorkflow.php.

Referenced by handleEvent().

218  {
219  return;
220  }
+ Here is the caller graph for this function:

◆ readInputVar()

ilBaseWorkflow::readInputVar (   $name)
Deprecated:

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

References $name.

683  {
684  if ($this->data_inputs[$name]) {
685  return $this->data_inputs[$name];
686  }
687  return null;
688  }
if($format !==null) $name
Definition: metadata.php:146

◆ readOutputVar()

ilBaseWorkflow::readOutputVar (   $name)
Deprecated:

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

References $name.

719  {
720  if ($this->data_outputs[$name]) {
721  return $this->data_outputs[$name];
722  }
723  return null;
724  }
if($format !==null) $name
Definition: metadata.php:146

◆ registerDetector()

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

Implements ilWorkflow.

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

264  {
265  $reflection_class = new ReflectionClass($detector);
266  if (in_array('ilExternalDetector', $reflection_class->getInterfaceNames())) {
267  $this->detectors[] = $detector;
268  }
269  }

◆ registerInputVar()

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

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

References $name.

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().

753  {
754  $definition['name'] = $name;
755  $this->data_inputs[$name] = $definition;
756  }
if($format !==null) $name
Definition: metadata.php:146
+ Here is the caller graph for this function:

◆ registerOutputVar()

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

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

References $name, and array.

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

762  {
763  $this->data_outputs[] = $name;
764  }
if($format !==null) $name
Definition: metadata.php:146
+ Here is the caller graph for this function:

◆ resetDataPersistenceRequirement()

ilBaseWorkflow::resetDataPersistenceRequirement ( )
Returns
void

Implements ilWorkflow.

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

465  {
466  $this->require_data_persistence = false;
467  }

◆ setDbId()

ilBaseWorkflow::setDbId (   $id)

Sets the database id of the detector.

Parameters
integer$id

Implements ilWorkflow.

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

References $id.

307  {
308  $this->db_id = $id;
309  }
if(!array_key_exists('StateId', $_REQUEST)) $id

◆ 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 605 of file class.ilBaseWorkflow.php.

References $id.

Referenced by setInstanceVarByName(), and setInstanceVarByRole().

606  {
607  foreach ($this->instance_vars as &$instance_var) {
608  if ($instance_var['id'] == $id) {
609  if ($instance_var['reference'] === true) {
610  $this->setInstanceVarById($instance_var['target'], $value);
611  } else {
612  $instance_var['value'] = $value;
613  return;
614  }
615  }
616  }
617  }
setInstanceVarById($id, $value)
Sets the given instance var with the given content.
if(!array_key_exists('StateId', $_REQUEST)) $id
+ 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 586 of file class.ilBaseWorkflow.php.

References $name, and setInstanceVarById().

587  {
588  foreach ($this->instance_vars as &$instance_var) {
589  if ($instance_var['name'] == $name) {
590  if ($instance_var['reference'] === true) {
591  $this->setInstanceVarById($instance_var['target'], $value);
592  } else {
593  $instance_var['value'] = $value;
594  }
595  }
596  }
597  }
setInstanceVarById($id, $value)
Sets the given instance var with the given content.
if($format !==null) $name
Definition: metadata.php:146
+ 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 625 of file class.ilBaseWorkflow.php.

References setInstanceVarById().

626  {
627  foreach ($this->instance_vars as &$instance_var) {
628  if ($instance_var['role'] == $role) {
629  if ($instance_var['reference'] === true) {
630  $this->setInstanceVarById($instance_var['target'], $value);
631  } else {
632  $instance_var['value'] = $value;
633  return;
634  }
635  }
636  }
637  }
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 345 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().

346  {
347  $this->start_node = $node;
348  }
+ 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 367 of file class.ilBaseWorkflow.php.

368  {
369  $this->workflow_class = $class;
370  }

◆ 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 391 of file class.ilBaseWorkflow.php.

References $path.

392  {
393  $this->workflow_location = $path;
394  }

◆ 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  if (count($this->nodes) != 0) {
167  $this->start_node = $this->nodes[0];
168  } else {
169  //ilWorkflowDbHelper::deleteWorkflow($this);
170  throw new Exception('No start_node, no node, no start. Doh.');
171  }
172  }
173  $this->start_node->activate();
174  ilWorkflowDbHelper::writeWorkflow($this);
175  }
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 180 of file class.ilBaseWorkflow.php.

References onStopWorkflow().

181  {
182  $this->active = false;
183  foreach ($this->nodes as $node) {
184  $node->deactivate();
185  }
186  $this->onStopWorkflow();
187  }
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 709 of file class.ilBaseWorkflow.php.

References $name.

710  {
711  $this->data_inputs[$name] = $value;
712  $this->require_data_persistence = true;
713  }
if($format !==null) $name
Definition: metadata.php:146

◆ writeOutputVar()

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

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

References $name.

730  {
731  $this->data_outputs[$name] = $value;
732  $this->require_data_persistence = true;
733  }
if($format !==null) $name
Definition: metadata.php:146

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: