ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilScriptTaskElement.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 
31  $class_object->registerRequire('./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php');
32  $code .= '
33  ' . $this->element_varname . ' = new ilBasicNode($this);
34  $this->addNode(' . $this->element_varname . ');
35  ' . $this->element_varname . '->setName(\'' . $this->element_varname . '\');
36  ';
37  $script_definition = ilBPMN2ParserUtils::extractScriptDefinitionFromElement($element);
38 
39  $class_object->addAuxilliaryMethod(
40  "public function _v_".$element_id . "_script(\$context)
41  {
42  " . $script_definition . "
43  }"
44  );
45 
46  $class_object->registerRequire('./Services/WorkflowEngine/classes/activities/class.ilScriptActivity.php');
47 
48  $code .= "
49  ". $this->element_varname . "_scriptActivity = new ilScriptActivity(" . $this->element_varname . ");
50  " . $this->element_varname . "_scriptActivity->setName('" . $this->element_varname . "');
51  ". $this->element_varname . "_scriptActivity->setMethod('".'_v_'.$element_id . "_script');
52  " . $this->element_varname . "->addActivity(". $this->element_varname . "_scriptActivity);
53  ";
54 
55  $code .= $this->handleDataAssociations($element, $class_object, $this->element_varname);
56 
57  return $code;
58  }
59 }
Class ilWorkflowScaffold.
$code
Definition: example_050.php:99
getPHP($element, ilWorkflowScaffold $class_object)
Class ilBaseElement.
Class ilScriptTaskElement.
Class ilRuntime.