ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSendTaskElement Class Reference

Class ilSendTaskElement. More...

+ Inheritance diagram for ilSendTaskElement:
+ Collaboration diagram for ilSendTaskElement:

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 ilSendTaskElement.

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

/

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

Member Function Documentation

◆ getPHP()

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

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

References $code, array, ilBPMN2ParserUtils\extractILIASEventDefinitionFromProcess(), ilBaseElement\getDataInputAssociationIdentifiers(), ilWorkflowScaffold\registerRequire(), and ilBPMN2ParserUtils\xsIDToPHPVarname().

24  {
25  $code = "";
26  $element_id = ilBPMN2ParserUtils::xsIDToPHPVarname($element['attributes']['id']);
27  $this->element_varname = '$_v_' . $element['attributes']['id'];
28  $event_definition = null;
29  if (count($element['children'])) {
30  foreach ($element['children'] as $child) {
31  if ($child['name'] == 'messageEventDefinition') {
32  $event_definition = ilBPMN2ParserUtils::extractILIASEventDefinitionFromProcess($child['attributes']['messageRef'], 'message', $this->bpmn2_array);
33  }
34  if ($child['name'] == 'signalEventDefinition') {
35  $event_definition = ilBPMN2ParserUtils::extractILIASEventDefinitionFromProcess($child['attributes']['signalRef'], 'signal', $this->bpmn2_array);
36  }
37  }
38  }
39 
40  $message_element = false;
41  if (isset($element['attributes']['ilias:message'])) {
42  $message_element = $element['attributes']['ilias:message'];
43  }
44 
45  $class_object->registerRequire('./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php');
46  $code .= '
47  ' . $this->element_varname . ' = new ilBasicNode($this);
48  $this->addNode(' . $this->element_varname . ');
49  ' . $this->element_varname . '->setName(\'' . $this->element_varname . '\');
50  ';
51 
52  if (isset($event_definition['type']) && isset($event_definition['content'])) {
53  $class_object->registerRequire('./Services/WorkflowEngine/classes/activities/class.ilEventRaisingActivity.php');
54  $code .= '
55  ' . $this->element_varname . '_sendTaskActivity = new ilEventRaisingActivity(' . $this->element_varname . ');
56  ' . $this->element_varname . '_sendTaskActivity->setName(\'' . $this->element_varname . '_sendTaskActivity\');
57  ' . $this->element_varname . '_sendTaskActivity->setEventType("' . $event_definition['type'] . '");
58  ' . $this->element_varname . '_sendTaskActivity->setEventName("' . $event_definition['content'] . '");
59  ' . $this->element_varname . '->addActivity(' . $this->element_varname . '_sendTaskActivity);
60  ';
61  }
62 
63  if (isset($element['attributes']['message'])) {
64  $data_inputs = $this->getDataInputAssociationIdentifiers($element);
65  $task_parameters = '';
66  $message_name = $element['attributes']['message'];
67  if (substr($message_name, 0, 6) == 'ilias:') {
68  $message_name = substr($message_name, 6);
69  }
70  if (count($data_inputs)) {
71  $task_parameters = '"' . implode('","', $data_inputs) . '"';
72  }
73 
74  $class_object->registerRequire('./Services/WorkflowEngine/classes/activities/class.ilSendMailActivity.php');
75  $code .= '
76  ' . $this->element_varname . '_sendTaskActivity = new ilSendMailActivity(' . $this->element_varname . ');
77  ' . $this->element_varname . '_sendTaskActivity->setMessageName(\'' . $message_name . '\');
78  ' . $this->element_varname . '_sendTaskActivity_params = array(' . $task_parameters . ');
79  ' . $this->element_varname . '_sendTaskActivity->setParameters(' . $this->element_varname . '_sendTaskActivity_params);
80  ' . $this->element_varname . '->addActivity(' . $this->element_varname . '_sendTaskActivity);
81  ';
82  }
83 
84  $code .= $this->handleDataAssociations($element, $class_object, $this->element_varname);
85 
86  return $code;
87  }
getDataInputAssociationIdentifiers($element)
static extractILIASEventDefinitionFromProcess($start_event_ref, $type, $bpmn2_array)
$code
Definition: example_050.php:99
Create styles array
The data for the language used.
Class ilRuntime.
+ Here is the call graph for this function:

Field Documentation

◆ $element_varname

ilSendTaskElement::$element_varname

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


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