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

Class ilStartEventElement. More...

+ Inheritance diagram for ilStartEventElement:
+ Collaboration diagram for ilStartEventElement:

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

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

/

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

Member Function Documentation

◆ getPHP()

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

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

References $code, ilBPMN2ParserUtils\extractILIASEventDefinitionFromProcess(), ilBPMN2ParserUtils\extractTimeDateEventDefinitionFromElement(), ilBaseElement\handleDataAssociations(), ilWorkflowScaffold\registerRequire(), ilWorkflowScaffold\registerStartEventRef(), ilWorkflowScaffold\registerStartSignalRef(), ilWorkflowScaffold\registerStartTimerRef(), and ilBPMN2ParserUtils\xsIDToPHPVarname().

24  {
25  $code = "";
26  $element_id = ilBPMN2ParserUtils::xsIDToPHPVarname($element['attributes']['id']);
27  $this->element_varname = '$_v_'.$element_id; // TODO: xsd:ID allows hyphens and periods. Deal with it!
28 
29  $event_definition = null;
30  if(count(@$element['children']))
31  {
32  foreach ($element['children'] as $child)
33  {
34  if($child['name'] == 'messageEventDefinition')
35  {
36  $class_object->registerStartEventRef($child['attributes']['messageRef']);
38  $child['attributes']['messageRef'], 'message', $this->bpmn2_array);
39  }
40  if($child['name'] == 'signalEventDefinition')
41  {
42  $class_object->registerStartSignalRef($child['attributes']['signalRef']);
44  $child['attributes']['signalRef'], 'signal', $this->bpmn2_array);
45  }
46  if($child['name'] == 'timerEventDefinition')
47  {
48  $class_object->registerStartTimerRef($child['attributes']['id']);
50  $child['attributes']['id'], 'startEvent', $this->bpmn2_array);
51  //$event_definition = $class_object->getTimeDateEventDefinition($child['attributes']['id']);
52  }
53  }
54  }
55  $class_object->registerRequire('./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php');
56  $code .= '
57  ' . $this->element_varname . ' = new ilBasicNode($this);
58  $this->addNode(' . $this->element_varname . ');
59  ' . $this->element_varname . '->setName(\'' . $this->element_varname . '\');
60  ';
61 
62  if(is_array($event_definition))
63  {
64  $class_object->registerRequire('./Services/WorkflowEngine/classes/detectors/class.ilEventDetector.php');
65  $code .= '
66  ' . $this->element_varname . '_detector = new ilEventDetector(' . $this->element_varname . ');
67  ' . $this->element_varname . '_detector->setName(\'' . $this->element_varname . '_detector\');
68  ' . $this->element_varname . '_detector->setEvent( "'.$event_definition['type'].'", "'.$event_definition['content'].'");
69  ' . $this->element_varname . '_detector->setEventSubject( "'.$event_definition['subject_type'].'", "'.$event_definition['subject_id'].'");
70  ' . $this->element_varname . '_detector->setEventContext( "'.$event_definition['context_type'].'", "'.$event_definition['context_id'].'");
71  ';
72  if(isset($event_definition['listening_start']) || isset($event_definition['listening_end']))
73  {
74  $code .= $this->element_varname . '_detector->setListeningTimeframe(' .(int) $event_definition['listening_start'] .
75  ', ' . (int) $event_definition['listening_end'] . ');';
76  }
77  else if(isset($event_definition['listening_relative']) && isset($event_definition['listening_interval']))
78  {
79  $code .= $this->element_varname . '_detector->setTimerRelative(true);';
80  $code .= $this->element_varname . '_detector->setTimerLimit(' .(int) $event_definition['listening_interval'] . ');';
81  }
82  }
83  else
84  {
85  $code .= '
86  $this->setStartNode(' . $this->element_varname . ');
87  ';
88  }
89 
90  $code .= $this->handleDataAssociations($element, $class_object, $this->element_varname);
91 
92  return $code;
93  }
static extractILIASEventDefinitionFromProcess($start_event_ref, $type, $bpmn2_array)
handleDataAssociations($element, $class_object, $element_varname)
registerStartTimerRef($start_event_ref)
$code
Definition: example_050.php:99
registerStartSignalRef($start_event_ref)
registerStartEventRef($start_event_ref)
static extractTimeDateEventDefinitionFromElement($start_event_ref, $type, $bpmn2_array)
PhpIncludeInspection
Class ilRuntime.
+ Here is the call graph for this function:

Field Documentation

◆ $element_varname

ilStartEventElement::$element_varname

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


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