Class KymaEventFilterServiceImpl

java.lang.Object
de.hybris.platform.kymaintegrationservices.event.impl.KymaEventFilterServiceImpl
All Implemented Interfaces:
KymaEventFilterService

public class KymaEventFilterServiceImpl extends Object implements KymaEventFilterService
Default implementation of the interface KymaEventFilterService to filter Kyma events based on the result of execution a Groovy script attached to the event configuration.
  • Constructor Details

    • KymaEventFilterServiceImpl

      public KymaEventFilterServiceImpl(@NotNull @NotNull ScriptingLanguagesService scriptingLanguagesService)
  • Method Details

    • filterKymaEvent

      public boolean filterKymaEvent(EventSourceData eventSourceData)
      The filtering logic is implemented in the attached script of the event configuration (e.g., model://kymaOrderFilter). The filter script receives the event through an input argument called event and should return true or false. If the filter script fails to execute successfully, an error message will be logged and returns false.
      Specified by:
      filterKymaEvent in interface KymaEventFilterService
      Parameters:
      eventSourceData - Contains Kyma event and its configuration
      Returns:
      A boolean flag indicates if the event will be sent to Kyma or not. If the flag is true, the event will be sent; otherwise the event will not be sent.