ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
31  foreach ($element['children'] as $child)
32  {
33  if($child['name'] == 'messageEventDefinition')
34  {
35  $event_definition = ilBPMN2ParserUtils::extractILIASEventDefinitionFromProcess($child['attributes']['messageRef'], 'message', $this->bpmn2_array);
36  }
37  if($child['name'] == 'signalEventDefinition')
38  {
39  $event_definition = ilBPMN2ParserUtils::extractILIASEventDefinitionFromProcess($child['attributes']['signalRef'], 'signal', $this->bpmn2_array);
40  }
41  }
42  }
43 
44  $message_element = false;
45  if(isset($element['attributes']['ilias:message']))
46  {
47  $message_element = $element['attributes']['ilias:message'];
48  }
49 
50  $class_object->registerRequire('./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php');
51  $code .= '
52  ' . $this->element_varname . ' = new ilBasicNode($this);
53  $this->addNode(' . $this->element_varname . ');
54  ' . $this->element_varname . '->setName(\'' . $this->element_varname . '\');
55  ';
56 
57  if(isset($event_definition['type']) && isset($event_definition['content']))
58  {
59  $class_object->registerRequire('./Services/WorkflowEngine/classes/activities/class.ilEventRaisingActivity.php');
60  $code .= '
61  ' . $this->element_varname . '_sendTaskActivity = new ilEventRaisingActivity(' . $this->element_varname . ');
62  ' . $this->element_varname . '_sendTaskActivity->setName(\'' . $this->element_varname . '_sendTaskActivity\');
63  ' . $this->element_varname . '_sendTaskActivity->setEventType("'.$event_definition['type'].'");
64  ' . $this->element_varname . '_sendTaskActivity->setEventName("'.$event_definition['content'].'");
65  ' . $this->element_varname . '->addActivity(' . $this->element_varname . '_sendTaskActivity);
66  ';
67  }
68 
69  if(isset($element['attributes']['message']))
70  {
71  $data_inputs = $this->getDataInputAssociationIdentifiers($element);
72  $task_parameters = '';
73  $message_name = $element['attributes']['message'];
74  if(substr($message_name,0, 6) == 'ilias:')
75  {
76  $message_name = substr($message_name,6);
77  }
78  if(count($data_inputs))
79  {
80  $task_parameters = '"'.implode('","', $data_inputs).'"';
81  }
82 
83  $class_object->registerRequire('./Services/WorkflowEngine/classes/activities/class.ilSendMailActivity.php');
84  $code .= '
85  ' . $this->element_varname . '_sendTaskActivity = new ilSendMailActivity(' . $this->element_varname . ');
86  ' . $this->element_varname . '_sendTaskActivity->setMessageName(\'' . $message_name . '\');
87  ' . $this->element_varname . '_sendTaskActivity_params = array(' . $task_parameters . ');
88  ' . $this->element_varname . '_sendTaskActivity->setParameters(' . $this->element_varname . '_sendTaskActivity_params);
89  ' . $this->element_varname . '->addActivity(' . $this->element_varname . '_sendTaskActivity);
90  ';
91  }
92 
93  $code .= $this->handleDataAssociations($element, $class_object, $this->element_varname);
94 
95  return $code;
96  }
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: