ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilBPMN2ElementLoader.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once './Services/WorkflowEngine/classes/parser/elements/class.ilBaseElement.php';
5
15{
17 protected $bpmn2_array;
18
24 public function __construct($bpmn2_array)
25 {
26 $this->bpmn2_array = $bpmn2_array;
27 }
28
34 public function load($element_name)
35 {
36 preg_match('/[A-Z]/', $element_name, $matches, PREG_OFFSET_CAPTURE);
37 $type = strtolower(substr($element_name, @$matches[0][1]));
38 if ($type == 'basedgateway') {
39 // Fixing a violation of the standards naming convention by the standard here.
40 $type = 'gateway';
41 }
42
43 if ($type == 'objectreference') {
44 // Fixing a violation of the standards naming convention by the standard here.
45 $type = 'object';
46 }
47
48 require_once './Services/WorkflowEngine/classes/parser/elements/' . $type . '/class.il' . ucfirst($element_name) . 'Element.php';
49 $classname = 'il' . ucfirst($element_name) . 'Element';
50 $instance = new $classname;
51 $instance->setBPMN2Array($this->bpmn2_array);
52
53 return $instance;
54 }
55}
An exception for terminatinating execution or to throw for unit testing.
Class ilBPMN2ElementLoader.
__construct($bpmn2_array)
ilBPMN2ElementLoader constructor.
$type