ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilIntermediateThrowEventElement.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
13 {
16 
23  public function getPHP($element, ilWorkflowScaffold $class_object)
24  {
25  $code = "";
26  $element_id = ilBPMN2ParserUtils::xsIDToPHPVarname($element['attributes']['id']);
27  $this->element_varname = '$_v_'.$element_id;
28 
29  $event_definition = null;
30  if(count($element['children']))
31  {
32  foreach ($element['children'] as $child)
33  {
34  if($child['name'] == 'messageEventDefinition')
35  {
36  $event_definition = ilBPMN2ParserUtils::extractILIASEventDefinitionFromProcess($child['attributes']['messageRef'], 'message', $this->bpmn2_array);
37  }
38  if($child['name'] == 'signalEventDefinition')
39  {
40  $event_definition = ilBPMN2ParserUtils::extractILIASEventDefinitionFromProcess($child['attributes']['signalRef'], 'signal', $this->bpmn2_array);
41  }
42  }
43  }
44 
45  $class_object->registerRequire('./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php');
46  $code .= '
47  ' . $this->element_varname . ' = new ilBasicNode($this);
48  $this->addNode(' . $this->element_varname . ');
49  ' . $this->element_varname . '->setName(\'' . $this->element_varname . '\');
50  ';
51 
52  if(isset($event_definition['type']) && isset($event_definition['content']))
53  {
54  $class_object->registerRequire('./Services/WorkflowEngine/classes/activities/class.ilEventRaisingActivity.php');
55  $code .= '
56  ' . $this->element_varname . '_throwEventActivity = new ilEventRaisingActivity(' . $this->element_varname . ');
57  ' . $this->element_varname . '_throwEventActivity->setName(\'' . $this->element_varname . '\');
58  ' . $this->element_varname . '_throwEventActivity->setEventType("'.$event_definition['type'].'");
59  ' . $this->element_varname . '_throwEventActivity->setEventName("'.$event_definition['content'].'");
60  ' . $this->element_varname . '->addActivity(' . $this->element_varname . '_throwEventActivity);
61  ';
62  }
63 
64  return $code;
65  }
66 }
static extractILIASEventDefinitionFromProcess($start_event_ref, $type, $bpmn2_array)
Class ilWorkflowScaffold.
$code
Definition: example_050.php:99
getPHP($element, ilWorkflowScaffold $class_object)
Class ilIntermediateThrowEventElement.
Class ilBaseElement.
Class ilRuntime.