14 #region XML to Array conversion 24 $node=@simplexml_load_string($xml_string);
38 $namespaces = $node->getNameSpaces(
true);
41 $r[
'name']=$node->getName();
44 $tmp=array_keys($node->getNameSpaces(
false));
45 $r[
'namespace']=$tmp[0];
46 $r[
'namespaces']=$namespaces;
49 if ($content)
$r[
'content']=$content;
51 foreach ($namespaces as $pre=>$ns)
53 foreach ($node->children($ns) as $k=>$v)
55 $this->
add_node($v,
$r[
'children'], $pre,
true);
57 foreach ($node->attributes($ns) as $k=>$v)
59 $r[
'attributes'][$k]=
"$pre:$v";
63 foreach ($node->children() as $k=>$v)
68 foreach ($node->attributes() as $k=>$v)
70 $r[
'attributes'][$k]=
"$v";
102 $xsID_converted = str_replace(
'.',
'__period__',$xsID);
103 $xsID_converted = str_replace(
'-',
'__hyphen__',$xsID_converted);
104 return $xsID_converted;
116 $descriptor_extension =
array();
117 $subject_extension =
array();
118 $context_extension =
array();
119 $timeframe_extension =
array();
121 foreach ($bpmn2_array[
'children'] as $element)
123 if ($element[
'name'] == $type && $element[
'attributes'][
'id'] == $start_event_ref)
125 $bpmn_extension_elements = $element[
'children'][0];
126 $extension_elements = $bpmn_extension_elements[
'children'][0][
'children'];
128 foreach ($extension_elements as $child)
131 if($child[
'namespace'] ==
'ilias')
135 if ($child[
'name'] == $prefix.
'eventDescriptor')
137 $descriptor_extension = $child;
139 if ($child[
'name'] == $prefix.
'eventSubject')
141 $subject_extension = $child;
144 if ($child[
'name'] == $prefix.
'eventContext')
146 $context_extension = $child;
149 if ($child[
'name'] == $prefix.
'eventTimeframe')
151 $timeframe_extension = $child;
157 $event_definition =
array(
158 'type' => $descriptor_extension[
'attributes'][
'type'],
159 'content' => $descriptor_extension[
'attributes'][
'name'],
160 'subject_type' => $subject_extension[
'attributes'][
'type'],
161 'subject_id' => $subject_extension[
'attributes'][
'id'],
162 'context_type' => $context_extension[
'attributes'][
'type'],
163 'context_id' => $context_extension[
'attributes'][
'id'],
164 'listening_start' => $timeframe_extension[
'attributes'][
'start'],
165 'listening_end' => $timeframe_extension[
'attributes'][
'end']
168 return $event_definition;
181 foreach($bpmn2_array[
'children'] as $elements)
183 foreach($elements[
'children'] as $element)
185 if ($element[
'name'] == $type)
187 foreach((
array)$element[
'children'] as $event_child)
189 if($event_child[
'name'] ==
'timerEventDefinition')
191 if($event_child[
'children'][0][
'name'] ==
'timeDate')
193 $content = $event_child[
'children'][0][
'content'];
198 'type' =>
'time_passed',
199 'content' =>
'time_passed',
200 'subject_type' =>
'none',
202 'context_type' =>
'none',
204 'listening_start' =>
$start,
205 'listening_end' => $end
209 if($event_child[
'children'][0][
'name'] ==
'timeDuration')
211 $content = $event_child[
'children'][0][
'content'];
212 $interval = new \DateInterval(strtotime($content));
213 $duration = ($interval->d * 24 * 60 * 60) + ($interval->h * 60 * 60) +
214 ($interval->i * 60) + $interval->s;
217 'type' =>
'time_passed',
218 'content' =>
'time_passed',
219 'subject_type' =>
'none',
221 'context_type' =>
'none',
223 'listening_relative'=> 1,
242 $library_call =
array();
243 foreach($element[
'children'] as $child)
245 if($child[
'name'] ==
'extensionElements')
247 foreach($child[
'children'] as $extension)
250 if($extension[
'namespace'] ==
'ilias')
254 if($extension[
'name'] == $prefix.
'properties')
256 if($extension[
'children'][0][
'name'] == $prefix.
'libraryCall')
258 $library_call = $extension[
'children'][0][
'attributes'];
269 'include_filename' => $library_call[
'location'],
270 'class_and_method' => $library_call[
'api'] .
'::' . $library_call[
'method']
282 foreach($element[
'children'] as $child)
284 if($child[
'name'] ==
'script')
286 $code = $child[
'content'];
299 if(!isset($element[
'children']))
304 foreach($element[
'children'] as $child)
306 if($child[
'name'] ==
'extensionElements')
308 foreach($child[
'children'] as $extension)
311 if($extension[
'children'][0][
'namespace'] ==
'ilias')
315 if($extension[
'name'] == $prefix.
'properties')
317 if($extension[
'children'][0][
'name'] == $prefix.
'property')
319 $attributes = $extension[
'children'][0][
'attributes'];
320 return $attributes[
'value'];
338 if(!isset($element[
'children']))
344 foreach((
array)$element[
'children'] as $child)
346 if($child[
'name'] ==
'extensionElements')
348 foreach($child[
'children'] as $extension)
351 if($extension[
'children'][0][
'namespace'] ==
'ilias')
355 if($extension[
'name'] == $prefix.
'properties')
357 foreach((
array)$extension[
'children'] as $child)
359 if($child[
'name'] ==
'inputproperty')
361 $retval[$child[
'attributes'][
'name']] = $child[
'attributes'][
'value'];
378 if(!isset($element[
'children']))
384 foreach((
array)$element[
'children'] as $child)
386 if($child[
'name'] ==
'extensionElements')
388 foreach($child[
'children'] as $extension)
391 if($extension[
'children'][0][
'namespace'] ==
'ilias')
395 if($extension[
'name'] == $prefix.
'properties')
397 foreach((
array)$extension[
'children'] as $child)
399 if($child[
'name'] ==
'dataobject')
401 $retval[
'role'] = $child[
'attributes'][
'role'];
402 $retval[
'type'] = $child[
'attributes'][
'type'];
419 if(!isset($element[
'children']))
425 foreach((
array)$element[
'children'] as $child)
427 if($child[
'name'] ==
'extensionElements')
429 foreach($child[
'children'] as $extension)
432 if($extension[
'children'][0][
'namespace'] ==
'ilias')
436 if($extension[
'name'] == $prefix.
'properties')
438 foreach((
array)$extension[
'children'] as $child)
440 if($child[
'attributes'][
'name'] ==
'mailtext')
442 $retval[
'mailtext'] = base64_encode($child[
'content']);
static extractILIASMessageDefinitionFromElement($element)
if($err=$client->getError()) $namespace
static xsIDToPHPVarname($xsID)
static extractDataNamingFromElement($element)
static extractILIASEventDefinitionFromProcess($start_event_ref, $type, $bpmn2_array)
static extractScriptDefinitionFromElement($element)
Class ilBPMN2ParserUtils.
static extractILIASLibraryCallDefinitionFromElement($element)
static extractILIASInputPropertiesFromElement($element)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
add_node($node, &$parent=null, $namespace='', $recursive=false)
Create styles array
The data for the language used.
static extractILIASDataObjectDefinitionFromElement($element)
static extractTimeDateEventDefinitionFromElement($start_event_ref, $type, $bpmn2_array)