ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 355 of file class.ilBaseWorkflow.php.

356 {
357 $this->nodes[] = $node;
358 }

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(), 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 424 of file class.ilBaseWorkflow.php.

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 }
$filename
Definition: buildRTE.php:89

References $filename.

◆ defineInputVar()

ilBaseWorkflow::defineInputVar (   $name)
Deprecated:

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

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

References $name.

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

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

References $name, and $type.

Referenced by Task_ReadLearnersFromCourse\__construct(), DataInput_RepositoryObjectSelector\__construct(), DataInput_Simple\__construct(), DataInput_WithProperties\__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 673 of file class.ilBaseWorkflow.php.

674 {
675 $this->data_outputs[$name] = null;
676 $this->require_data_persistence = true;
677 }

References $name.

◆ flushInstanceVars()

ilBaseWorkflow::flushInstanceVars ( )

Empties the instance variables.

Implements ilWorkflow.

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

653 {
654 $this->instance_vars = array();
655 }

◆ getDbId()

ilBaseWorkflow::getDbId ( )

Returns the database id of the detector if set.

Returns
int
Exceptions

ilWorkflowObjectStateException

Implements ilWorkflow.

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

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

References $db_id.

◆ getInputVars()

ilBaseWorkflow::getInputVars ( )

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

736 {
737 return (array) $this->data_inputs;
738 }

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

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 }
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 547 of file class.ilBaseWorkflow.php.

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.

References $name, and 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 644 of file class.ilBaseWorkflow.php.

645 {
646 return (array) $this->instance_vars;
647 }

References $instance_vars.

◆ getNodes()

ilBaseWorkflow::getNodes ( )

Returns all nodes attached to the workflow.

Returns
ilNode[]

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

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

References $nodes.

◆ getOutputVars()

ilBaseWorkflow::getOutputVars ( )
Deprecated:

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

744 {
745 return (array) $this->data_outputs;
746 }

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

380 {
382 }

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

297 {
298 return array('type' => $this->workflow_context_type, 'identifier' => $this->workflow_context_identifier);
299 }

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

277 {
278 return array('type' => $this->workflow_type, 'content' => $this->workflow_content);
279 }

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

404 {
406 }

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

287 {
288 return array('type' => $this->workflow_subject_type, 'identifier' => $this->workflow_subject_identifier);
289 }

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

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 }
onWorkflowFinished()
Method called after workflow is finished, after detecting no more nodes are active.

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

694 {
695 return array_key_exists($name, (array) $this->data_inputs);
696 }

References $name.

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

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

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

515 {
516 foreach ($this->instance_vars as $instance_var) {
517 if ($instance_var['name'] == $name) {
518 return true;
519 }
520 }
521 return false;
522 }

References $name.

◆ hasOutputVar()

ilBaseWorkflow::hasOutputVar (   $name)
Deprecated:

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

702 {
703 return array_key_exists($name, (array) $this->data_outputs);
704 }

References $name.

◆ isActive()

ilBaseWorkflow::isActive ( )

Returns the activation status of the workflow.

Returns
boolean

Implements ilWorkflow.

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

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

References $active.

◆ isDataPersistenceRequired()

ilBaseWorkflow::isDataPersistenceRequired ( )
Returns
bool

Implements ilWorkflow.

Definition at line 456 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 193 of file class.ilBaseWorkflow.php.

194 {
195 return;
196 }

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

206 {
207 return;
208 }

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

218 {
219 return;
220 }

Referenced by handleEvent().

+ Here is the caller graph for this function:

◆ readInputVar()

ilBaseWorkflow::readInputVar (   $name)
Deprecated:

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

683 {
684 if ($this->data_inputs[$name]) {
685 return $this->data_inputs[$name];
686 }
687 return null;
688 }

References $name.

◆ readOutputVar()

ilBaseWorkflow::readOutputVar (   $name)
Deprecated:

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

719 {
720 if ($this->data_outputs[$name]) {
721 return $this->data_outputs[$name];
722 }
723 return null;
724 }

References $name.

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

753 {
754 $definition['name'] = $name;
755 $this->data_inputs[$name] = $definition;
756 }

References $name.

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

762 {
763 $this->data_outputs[] = $name;
764 }

References $name.

Referenced by DataObject_Wiring_Input_Object_Output\__construct().

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

307 {
308 $this->db_id = $id;
309 }

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

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.

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

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 }

References $name, and 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 625 of file class.ilBaseWorkflow.php.

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 }

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

346 {
347 $this->start_node = $node;
348 }

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

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.

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.

References onStartWorkflow().

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

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.

References onStopWorkflow().

+ Here is the call graph for this function:

◆ writeInputVar()

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

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

710 {
711 $this->data_inputs[$name] = $value;
712 $this->require_data_persistence = true;
713 }

References $name.

◆ writeOutputVar()

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

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

730 {
731 $this->data_outputs[$name] = $value;
732 $this->require_data_persistence = true;
733 }

References $name.

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: