symphony.bdk.core.activity.api.AbstractActivity#
- class symphony.bdk.core.activity.api.AbstractActivity(*args, **kwds)#
Bases:
abc.ABC
,Generic
[symphony.bdk.core.activity.api.C
]Base abstract class for activities provided by the BDK. Provides a generic flow to process an incoming chat event.
- __init__()#
Methods
__init__
()before_matcher
(context)This callback can be used to prepare
ActivityContext
before actually processing the matches method.matches
(context)Matches the
ActivityContext
to decide whether anAbstractActivity
can be executed or not.on_activity
(context)Contains the activity business logic.
- before_matcher(context: symphony.bdk.core.activity.api.C)#
This callback can be used to prepare
ActivityContext
before actually processing the matches method.- Parameters
context – an instance of
ActivityContext
- abstract matches(context: symphony.bdk.core.activity.api.C) bool #
Matches the
ActivityContext
to decide whether anAbstractActivity
can be executed or not.- Parameters
context – an instance of
ActivityContext
- Returns
True if activity has to be triggered, False otherwise.
- abstract async on_activity(context: symphony.bdk.core.activity.api.C)#
Contains the activity business logic. Executed only if the matches method returned a true value.
- Parameters
context – an instance of
ActivityContext