Search in sources :

Example 1 with InitFactoryAction

use of won.bot.framework.eventbot.action.impl.factory.InitFactoryAction in project webofneeds by researchstudio-sat.

the class FactoryBotInitBehaviour method onActivate.

@Override
protected void onActivate(Optional<Object> message) {
    subscribeWithAutoCleanup(InitializeEvent.class, new ActionOnEventListener(context, new InitFactoryAction(context)));
    subscribeWithAutoCleanup(InitFactoryFinishedEvent.class, new ActionOnFirstEventListener(context, new BaseEventBotAction(context) {

        @Override
        protected void doRun(Event event, EventListener executingListener) throws Exception {
            FactoryBotInitBehaviour.this.deactivate();
        }
    }));
}
Also used : BaseEventBotAction(won.bot.framework.eventbot.action.BaseEventBotAction) InitializeEvent(won.bot.framework.eventbot.event.impl.lifecycle.InitializeEvent) InitFactoryFinishedEvent(won.bot.framework.eventbot.event.impl.factory.InitFactoryFinishedEvent) Event(won.bot.framework.eventbot.event.Event) ActionOnEventListener(won.bot.framework.eventbot.listener.impl.ActionOnEventListener) ActionOnFirstEventListener(won.bot.framework.eventbot.listener.impl.ActionOnFirstEventListener) ActionOnEventListener(won.bot.framework.eventbot.listener.impl.ActionOnEventListener) EventListener(won.bot.framework.eventbot.listener.EventListener) ActionOnFirstEventListener(won.bot.framework.eventbot.listener.impl.ActionOnFirstEventListener) InitFactoryAction(won.bot.framework.eventbot.action.impl.factory.InitFactoryAction)

Aggregations

BaseEventBotAction (won.bot.framework.eventbot.action.BaseEventBotAction)1 InitFactoryAction (won.bot.framework.eventbot.action.impl.factory.InitFactoryAction)1 Event (won.bot.framework.eventbot.event.Event)1 InitFactoryFinishedEvent (won.bot.framework.eventbot.event.impl.factory.InitFactoryFinishedEvent)1 InitializeEvent (won.bot.framework.eventbot.event.impl.lifecycle.InitializeEvent)1 EventListener (won.bot.framework.eventbot.listener.EventListener)1 ActionOnEventListener (won.bot.framework.eventbot.listener.impl.ActionOnEventListener)1 ActionOnFirstEventListener (won.bot.framework.eventbot.listener.impl.ActionOnFirstEventListener)1