@@ -92,18 +92,32 @@ def get(self, name, default=None):
9292 return self .kwargs .get (name , default )
9393
9494
95+ class OriginTypeSCXML (str ):
96+ """The origintype of the :ref:`Event` as specified by the SCXML namespace."""
97+
98+ def __eq__ (self , other ):
99+ return other == "http://www.w3.org/TR/scxml/#SCXMLEventProcessor" or other == "scxml"
100+
101+
95102class EventDataWrapper :
96103 origin : str = ""
97- origintype : str = "http://www.w3.org/TR/ scxml/#SCXMLEventProcessor"
104+ origintype : str = OriginTypeSCXML ( " scxml" )
98105 """The origintype of the :ref:`Event` as specified by the SCXML namespace."""
106+ invokeid : str = ""
107+ """If this event is generated from an invoked child process, the SCXML Processor MUST set
108+ this field to the invoke id of the invocation that triggered the child process.
109+ Otherwise it MUST leave it blank.
110+ """
99111
100112 def __init__ (self , event_data ):
101113 self .event_data = event_data
114+ self .sendid = event_data .trigger_data .send_id
102115 if event_data .trigger_data .event is None or event_data .trigger_data .event .internal :
103116 if "error.execution" == event_data .trigger_data .event :
104117 self .type = "platform"
105118 else :
106119 self .type = "internal"
120+ self .origintype = ""
107121 else :
108122 self .type = "external"
109123
@@ -365,12 +379,12 @@ def send_action(*args, **kwargs):
365379
366380 internal = target in ("#_internal" , "internal" )
367381
382+ send_id = None
368383 if action .id :
369384 send_id = action .id
370- else :
385+ elif action . idlocation :
371386 send_id = uuid4 ().hex
372- if action .idlocation :
373- setattr (machine .model , action .idlocation , send_id )
387+ setattr (machine .model , action .idlocation , send_id )
374388
375389 delay = ParseTime .parse_delay (action .delay , action .delayexpr , ** kwargs )
376390 names = [
@@ -380,6 +394,8 @@ def send_action(*args, **kwargs):
380394 ]
381395 params_values = {}
382396 for param in chain (names , action .params ):
397+ if param .expr is None :
398+ continue
383399 params_values [param .name ] = _eval (param .expr , ** kwargs )
384400
385401 Event (id = event , name = event , delay = delay , internal = internal , _sm = machine ).put (
0 commit comments