Skip to content

Commit

Permalink
Meta-event "step started" has a time attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreDecan committed Aug 20, 2018
1 parent ad1c721 commit 2403e1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Unreleased

- (Added) Some documentation about running multiple statecharts.
- (Added) An ``unbind`` method for an ``Interpreter``.
- (Changed) Meta-Event *step started* has a ``time`` attribute.
- (Fixed) Hook-errors reported by ``sismic-bdd`` CLI are a little bit more verbose (`#81 <https://github.com/AlexandreDecan/sismic/issues/81>`__).
- (Fixed) Optional transition for ``testing.transition_is_processed``, as previously promised by its documentation but not implemented.

Expand Down
4 changes: 2 additions & 2 deletions sismic/interpreter/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def bind_property_statechart(self, statechart_or_interpreter: Union[Statechart,
Bind a property statechart to the current interpreter.
A property statechart receives meta-events from the current interpreter depending on what happens:
- *step started*: when a macro step starts.
- *step started*: when a macro step starts. The current time of the step is available through the ``time`` attribute.
- *step ended*: when a macro step ends.
- *event consumed*: when an event is consumed. The consumed event is exposed through the ``event`` attribute.
- *event sent*: when an event is sent. The sent event is exposed through the ``event`` attribute.
Expand Down Expand Up @@ -241,7 +241,7 @@ def execute_once(self) -> Optional[MacroStep]:
return None

# Notify properties
self._notify_properties('step started')
self._notify_properties('step started', time=self._time)

# Consume event if it triggered a transition
if computed_steps[0].event is not None:
Expand Down

0 comments on commit 2403e1a

Please sign in to comment.