ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 {
40 // Fixing a violation of the standards naming convention by the standard here.
41 $type = 'gateway';
42 }
43
44 if ($type == 'objectreference')
45 {
46 // Fixing a violation of the standards naming convention by the standard here.
47 $type = 'object';
48 }
49
50 require_once './Services/WorkflowEngine/classes/parser/elements/' . $type . '/class.il' . ucfirst($element_name) . 'Element.php';
51 $classname = 'il'.ucfirst($element_name).'Element';
52 $instance = new $classname;
53 $instance->setBPMN2Array($this->bpmn2_array);
54
55 return $instance;
56 }
57}
An exception for terminatinating execution or to throw for unit testing.
Class ilBPMN2ElementLoader.
__construct($bpmn2_array)
ilBPMN2ElementLoader constructor.