symphony.bdk.core.activity.api.AbstractActivity#
- class symphony.bdk.core.activity.api.AbstractActivity#
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
ActivityContextbefore actually processing the matches method.matches(context)Matches the
ActivityContextto decide whether anAbstractActivitycan 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
ActivityContextbefore actually processing the matches method.- Parameters
context – an instance of
ActivityContext
- abstract matches(context: symphony.bdk.core.activity.api.C) bool#
Matches the
ActivityContextto decide whether anAbstractActivitycan 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