ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilCallActivityElement.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 {
15 
16  public function getPHP($element, ilWorkflowScaffold $class_object)
17  {
18  $code = "";
19  $element_id = ilBPMN2ParserUtils::xsIDToPHPVarname($element['attributes']['id']);
20  $this->element_varname = '$_v_'.$element_id;
21 
23 
24  $class_object->registerRequire('./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php');
25  $class_object->registerRequire('./Services/WorkflowEngine/classes/activities/class.ilStaticMethodCallActivity.php');
26 
27  $data_inputs = $this->getDataInputAssociationIdentifiers($element);
28  $activity_parameters = '';
29  if(count($data_inputs))
30  {
31  $activity_parameters = '"'.implode('","', $data_inputs).'"';
32  }
33 
34  $data_outputs = $this->getDataOutputAssociationIdentifiers($element);
35  $activity_outputs = '';
36  if(count($data_outputs))
37  {
38  $activity_outputs = '"'.implode('","', $data_outputs).'"';
39  }
40 
41  $code .= '
42  ' . $this->element_varname . ' = new ilBasicNode($this);
43  $this->addNode(' . $this->element_varname . ');
44  ' . $this->element_varname . '->setName(\'' . $this->element_varname . '\');
45 
46  ' . $this->element_varname . '_callActivity = new ilStaticMethodCallActivity(' . $this->element_varname . ');
47  ' . $this->element_varname . '_callActivity->setName(\'' . $this->element_varname . '_callActivity\');
48  ' . $this->element_varname . '_callActivity->setIncludeFilename("'.$library_definition['include_filename'].'");
49  ' . $this->element_varname . '_callActivity->setClassAndMethodName("'.$library_definition['class_and_method'].'");
50  ' . $this->element_varname . '_callActivity_params = array(' . $activity_parameters . ');
51  ' . $this->element_varname . '_callActivity->setParameters(' . $this->element_varname . '_callActivity_params);
52  ' . $this->element_varname . '_callActivity_outputs = array(' . $activity_outputs . ');
53  ' . $this->element_varname . '_callActivity->setOutputs(' . $this->element_varname . '_callActivity_outputs);
54  ' . $this->element_varname . '->addActivity(' . $this->element_varname . '_callActivity);
55  ';
56  $code .= $this->handleDataAssociations($element, $class_object, $this->element_varname);
57  return $code;
58  }
59 }
getDataInputAssociationIdentifiers($element)
Class ilWorkflowScaffold.
handleDataAssociations($element, $class_object, $element_varname)
$code
Definition: example_050.php:99
getDataOutputAssociationIdentifiers($element)
static extractILIASLibraryCallDefinitionFromElement($element)
Class ilCallActivityElement.
getPHP($element, ilWorkflowScaffold $class_object)
Class ilBaseElement.