Interface WidgetTemplateRulesEngine

  • All Known Implementing Classes:
    DefaultWidgetTemplateRulesEngine

    public interface WidgetTemplateRulesEngine
    Manages instances of a template widget. Uses template rules to make decision to which instance(s) an incoming socket event is to be sent.
    • Method Detail

      • forwardSocketEvent

        RuleEngineResult forwardSocketEvent​(Widget targetWidget,
                                            java.lang.String targetSocketId,
                                            WidgetInstance sourceInstance,
                                            java.lang.String sourceSocketId)
        Selects target widget instance(s) for the incoming event. It might create new instance as well if rules are set up that way.
        Parameters:
        targetWidget - target widget for the incoming event
        targetSocketId - socket ID of the target widget the even is sent to
        sourceInstance - source of the event
        sourceSocketId - socket ID of the source widget the event is sent from
        Returns:
        list of widget instances the event should be sent to. Could be empty list if the event is not applicable to any of the target widget instances according to rules.
      • handleOutcomingEvent

        RuleEngineResult handleOutcomingEvent​(WidgetInstance sourceInstance,
                                              java.lang.String sourceSocketId)
        Executes additional logic on an outgoing event according to rules - e.g. closes the source instance.
        Parameters:
        sourceInstance - source widget of the outgoing event
        sourceSocketId - the socket ID the event is sent from
        Returns: