ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilScriptTaskElement Class Reference

Class ilScriptTaskElement. More...

+ Inheritance diagram for ilScriptTaskElement:
+ Collaboration diagram for ilScriptTaskElement:

Public Member Functions

 getPHP ($element, ilWorkflowScaffold $class_object)
 
- Public Member Functions inherited from ilBaseElement
 getBpmn2Array ()
 
 setBpmn2Array ($bpmn2_array)
 
 handleDataAssociations ($element, $class_object, $element_varname)
 
 getDataInputAssociationIdentifiers ($element)
 
 getDataOutputAssociationIdentifiers ($element)
 

Data Fields

 $element_varname
 

Additional Inherited Members

- Protected Attributes inherited from ilBaseElement
 $bpmn2_array
 

Detailed Description

Class ilScriptTaskElement.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

/

Definition at line 12 of file class.ilScriptTaskElement.php.

Member Function Documentation

◆ getPHP()

ilScriptTaskElement::getPHP (   $element,
ilWorkflowScaffold  $class_object 
)
Parameters
$element
\ilWorkflowScaffold$class_object
Returns
string

Definition at line 23 of file class.ilScriptTaskElement.php.

References $code, ilWorkflowScaffold\registerRequire(), and ilBPMN2ParserUtils\xsIDToPHPVarname().

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  }
$code
Definition: example_050.php:99
Class ilRuntime.
+ Here is the call graph for this function:

Field Documentation

◆ $element_varname

ilScriptTaskElement::$element_varname

Definition at line 15 of file class.ilScriptTaskElement.php.


The documentation for this class was generated from the following file: