ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilEventRaisingActivity.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
5 require_once './Services/WorkflowEngine/interfaces/ilActivity.php';
7 require_once './Services/WorkflowEngine/interfaces/ilNode.php';
8 
18 {
20  private $context;
21 
23  protected $event_type;
24 
26  protected $event_name;
27 
29  protected $fixed_params;
30 
32  protected $name;
33 
38  public function addFixedParam($key, $value)
39  {
40  $this->fixed_params[] = array('key' => $key, 'value' => $value);
41  }
42 
46  public function getEventName()
47  {
48  return $this->event_name;
49  }
50 
54  public function setEventName($event_name)
55  {
56  $this->event_name = $event_name;
57  }
58 
62  public function getEventType()
63  {
64  return $this->event_type;
65  }
66 
70  public function setEventType($event_type)
71  {
72  $this->event_type = $event_type;
73  }
74 
80  public function __construct(ilNode $a_context)
81  {
82  $this->context = $a_context;
83  $this->event_type = 'Services/WorkflowEngine';
84  $this->event_name = 'nondescript';
85  }
86 
94  public function execute()
95  {
96  global $DIC;
98  $ilAppEventHandler = $DIC['ilAppEventHandler'];
99 
100  $ilAppEventHandler->raise(
101  $this->event_type,
102  $this->event_name,
103  $this->getParamsArray()
104  );
105  }
106 
110  public function getParamsArray()
111  {
112  // TODO: Get logic for getting values from incoming data associations.
113 
114  $params = array();
115  $params[] = array('key' => 'context', 'value' => $this);
116 
117  return array_merge((array)$this->fixed_params,$params);
118  }
119 
125  public function getContext()
126  {
127  return $this->context;
128  }
129 
133  public function setName($name)
134  {
135  $this->name = $name;
136  }
137 
141  public function getName()
142  {
143  return $this->name;
144  }
145 }
__construct(ilNode $a_context)
Default constructor.
ilWorkflowEngineElement Interface is part of the petri net based workflow engine. ...
getContext()
Returns a reference to the parent node.
PhpIncludeInspection
Definition: ilNode.php:25
Create styles array
The data for the language used.
global $DIC
ilActivity Interface is part of the petri net based workflow engine.
Definition: ilActivity.php:15
$params
Definition: example_049.php:96