ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 foreach ($element['children'] as $child) {
32 if ($child['name'] == 'messageEventDefinition') {
33 $event_definition = ilBPMN2ParserUtils::extractILIASEventDefinitionFromProcess($child['attributes']['messageRef'], 'message', $this->bpmn2_array);
34 }
35 if ($child['name'] == 'signalEventDefinition') {
36 $event_definition = ilBPMN2ParserUtils::extractILIASEventDefinitionFromProcess($child['attributes']['signalRef'], 'signal', $this->bpmn2_array);
37 }
38 }
39 }
40
41 $class_object->registerRequire('./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php');
42 $code .= '
43 ' . $this->element_varname . ' = new ilBasicNode($this);
44 $this->addNode(' . $this->element_varname . ');
45 ' . $this->element_varname . '->setName(\'' . $this->element_varname . '\');
46 ';
47
48 if (isset($event_definition['type']) && isset($event_definition['content'])) {
49 $class_object->registerRequire('./Services/WorkflowEngine/classes/activities/class.ilEventRaisingActivity.php');
50 $code .= '
51 ' . $this->element_varname . '_throwEventActivity = new ilEventRaisingActivity(' . $this->element_varname . ');
52 ' . $this->element_varname . '_throwEventActivity->setName(\'' . $this->element_varname . '\');
53 ' . $this->element_varname . '_throwEventActivity->setEventType("' . $event_definition['type'] . '");
54 ' . $this->element_varname . '_throwEventActivity->setEventName("' . $event_definition['content'] . '");
55 ' . $this->element_varname . '->addActivity(' . $this->element_varname . '_throwEventActivity);
56 ';
57 }
58
59 return $code;
60 }
61}
An exception for terminatinating execution or to throw for unit testing.
static extractILIASEventDefinitionFromProcess($start_event_ref, $type, $bpmn2_array)
Class ilBaseElement.
@noinspection PhpIncludeInspection
Class ilIntermediateThrowEventElement.
getPHP($element, ilWorkflowScaffold $class_object)
Class ilWorkflowScaffold.
Class ilAsqQuestionAuthoringFactory.