Interface ISpecificTriggerListener<TData>

    • Method Detail

      • getFilterCriteriaForEvent

        default de.xima.cmn.criteria.FilterCriterion getFilterCriteriaForEvent​(ITriggerFilterCriteriaForEventParams params)
        Description copied from interface: ITriggerHandler
        Called once with the event data when an event is fired. Each handler may add filter criteria to locate the triggers that match the event data.

        This method must return a non-null value to indicate that the event applies to this type of trigger at all. When this returns null, no triggers of this handler type are considered. The filter criterion returned by this method is used for a query for WorkflowTrigger entities, i.e. all attribute names must be relative to that entity.

        For example, to limit the result to triggers which have a search term with the key customKey set to valueForCustomKey, use:

         return params.searchTermExists("customKey", valueForCustomKey);
         
        To create a complex filter, use or / and etc. If you cannot use a database filter to check whether a trigger applies, use always to fetch all triggers for this handler type, and implement isAppliesToEvent to filter the applicable triggers via Java code.

        Basic restrictions such as the trigger type, the form record and project are applied automatically by the system and do not need to be included in the returned filter.

        See the class level documentation ITriggerHandler for more details.

        Specified by:
        getFilterCriteriaForEvent in interface ITriggerHandler<TData>
        Parameters:
        params - Parameters with the event data of the event that occurred.
        Returns:
        A filter criterion to restrict the list of matching triggers for this handler type. When null is returned, no triggers of this handler type are considered.
      • isAppliesToEvent

        default boolean isAppliesToEvent​(ITriggerAppliesToEventParams<TData> params)
        Description copied from interface: ITriggerHandler
        Called once the database query for matching triggers completes successfully. May be used to restrict the list of candidate triggers returned by the database query for matching triggers. This is useful, for example, when the check cannot be expressed as a database query. The tasks of triggers for which this method returns false are not executed.

        See the class level documentation ITriggerHandler for more details.

        Specified by:
        isAppliesToEvent in interface ITriggerHandler<TData>
        Parameters:
        params - The parameters with the event that occurred and a trigger returned by the database query for matching triggers.
        Returns:
        Whether the given trigger applies to the the given event. If not, the task for that trigger is not executed.