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

@noinspection 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
 handleEvent ($params)
 
 addNode (ilNode $node)
 
 setStartNode (ilNode $node)
 
 registerDetector (ilDetector $detector)
 
 startWorkflow ()
 
 stopWorkflow ()
 
 isActive ()
 
 onStartWorkflow ()
 
 onStopWorkflow ()
 
 onWorkflowFinished ()
 
 getWorkflowData ()
 
 getWorkflowSubject ()
 
 getWorkflowContext ()
 
 getWorkflowClass ()
 
 getWorkflowLocation ()
 
 setDbId ($id)
 
 getDbId ()
 
 hasDbId ()
 
 isDataPersistenceRequired ()
 
 resetDataPersistenceRequirement ()
 
 defineInstanceVar ($id, $name)
 
 hasInstanceVarByName ($name)
 
 hasInstanceVarById ($id)
 
 getInstanceVarByName ($name)
 
 getInstanceVarById ($id)
 
 setInstanceVarByName ($name, $value)
 
 setInstanceVarById ($id, $value)
 
 getInstanceVars ()
 
 flushInstanceVars ()
 

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

@noinspection PhpIncludeInspection

@noinspection PhpIncludeInspection @noinspection 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()

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.

368 {
369 $this->nodes[] = $node;
370 }

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

+ 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.

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 }

References $filename.

◆ 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.

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 }

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

+ 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.

691 {
692 $this->instance_vars = array();
693 }

◆ getDbId()

ilBaseWorkflow::getDbId ( )

Returns the database id of the detector if set.

Returns
int
Exceptions

ilWorkflowObjectStateException

Implements ilWorkflow.

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

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.
@noinspection PhpIncludeInspection

References $db_id.

◆ getInputVars()

ilBaseWorkflow::getInputVars ( )

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

776 {
777 return (array)$this->data_inputs;
778 }

References $data_inputs.

◆ 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.

References getInstanceVarById().

Referenced by getInstanceVarById().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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

References getInstanceVarByName().

Referenced by getInstanceVarByName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

683 {
684 return (array) $this->instance_vars;
685 }

References $instance_vars.

◆ getNodes()

ilBaseWorkflow::getNodes ( )

Returns all nodes attached to the workflow.

Returns
ilNode[]

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

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

References $nodes.

◆ getOutputVars()

ilBaseWorkflow::getOutputVars ( )
Deprecated:

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

784 {
785 return (array)$this->data_outputs;
786 }

References $data_outputs.

◆ 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.

392 {
394 }

References $workflow_class.

◆ 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.

305 {
306 return array('type' => $this->workflow_context_type, 'identifier' => $this->workflow_context_identifier);
307 }

◆ 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.

285 {
286 return array('type' => $this->workflow_type, 'content' => $this->workflow_content);
287 }

◆ 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.

416 {
418 }

References $workflow_location.

◆ 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.

295 {
296 return array('type' => $this->workflow_subject_type, 'identifier' => $this->workflow_subject_identifier);
297 }

◆ 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.

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.
$params
Definition: example_049.php:96

References $params, and onWorkflowFinished().

+ 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.

733 {
734 return array_key_exists($name, (array)$this->data_inputs);
735 }

◆ 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.

741 {
742 return array_key_exists($name, (array)$this->data_outputs);
743 }

◆ isActive()

ilBaseWorkflow::isActive ( )

Returns the activation status of the workflow.

Returns
boolean

Implements ilWorkflow.

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

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

References $active.

◆ isDataPersistenceRequired()

ilBaseWorkflow::isDataPersistenceRequired ( )
Returns
bool

Implements ilWorkflow.

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

References $require_data_persistence.

◆ 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.

197 {
198 return;
199 }

Referenced by startWorkflow().

+ 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.

209 {
210 return;
211 }

Referenced by stopWorkflow().

+ 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.

221 {
222 return;
223 }

Referenced by handleEvent().

+ 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.

793 {
794 $definition['name'] = $name;
795 $this->data_inputs[$name] = $definition;
796 }

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

+ Here is the caller graph for this function:

◆ registerOutputVar()

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

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

802 {
803 $this->data_outputs[] = $name;
804 }

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

+ 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.

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.

References setInstanceVarById().

Referenced by setInstanceVarById(), setInstanceVarByName(), and setInstanceVarByRole().

+ Here is the call graph for this function:
+ 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.

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 }

References setInstanceVarById().

+ 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.

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 }

References setInstanceVarById().

+ 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.

358 {
359 $this->start_node = $node;
360 }

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

+ 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.

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

References $path.

◆ startWorkflow()

ilBaseWorkflow::startWorkflow ( )

Starts the workflow, activating the start_node.

Implements ilWorkflow.

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

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.

References onStartWorkflow().

+ 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.

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.

References onStopWorkflow().

+ 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: