Interface IWorkflowTriggerLocator


  • public interface IWorkflowTriggerLocator
    Handler for locating triggers when a task is executed. Triggers are uniquely identifier by their ID, use the ID if possible. The name is unique at most within a WorkflowTask - occasionally there may be different triggers with the same name. The TriggerKey is guaranteed to be unique within a WorkflowProcess.
    Since:
    8.2.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • byId

        @Nullable
        WorkflowTrigger byId​(long triggerId)
        Finds the trigger by the given ID in the current workflow execution context.
        Parameters:
        triggerId - ID of the trigger.
        Returns:
        The trigger with the given ID, or null when no such trigger exists.
      • byIds

        @Nonnull
        default List<WorkflowTrigger> byIds​(Iterable<Long> triggerIds)
        Finds the triggers by the given ID in the current workflow execution context.
        Parameters:
        triggerIds - IDs of the triggers.
        Returns:
        The triggers with the given IDs, possibly an empty list when no triggers were found.
      • byIds

        @Nonnull
        default List<WorkflowTrigger> byIds​(long... triggerIds)
        Finds the triggers by the given ID in the current workflow execution context.
        Parameters:
        triggerIds - IDs of the triggers.
        Returns:
        The triggers with the given ID, possibly an empty list when no triggers were found.
      • byUuid

        @Nullable
        default WorkflowTrigger byUuid​(TriggerKey triggerKey)
        Finds the trigger by the given UUID in the current workflow execution context.
        Parameters:
        triggerKey - UUID of the trigger to find, and the UUID of the task to which it belongs. Note that triggers in different tasks may have the same UUID.
        Returns:
        The trigger with the given UUID, or null when no such trigger exists.
      • byUuid

        @Nullable
        WorkflowTrigger byUuid​(UUID taskUuid,
                               UUID triggerUuid)
        Finds the trigger by the given UUID in the current workflow execution context.
        Parameters:
        taskUuid - UUID of the task of the trigger to find.
        triggerUuid - UUID of the trigger to find.
        Returns:
        The trigger with the given UUID, or null when no such trigger exists.
      • byUuids

        @Nonnull
        default List<WorkflowTrigger> byUuids​(Iterable<TriggerKey> triggerKeys)
        Finds the triggers by the given UUID in the current workflow execution context.
        Parameters:
        triggerKeys - UUIDs of the triggers to find.
        Returns:
        The triggers with the given UUIDs, possibly an empty list when no triggers were found.
      • byUuids

        @Nonnull
        default List<WorkflowTrigger> byUuids​(TriggerKey... triggerKeys)
        Finds the triggers by the given UUID in the current workflow execution context.
        Parameters:
        triggerKeys - UUIDs of the triggers to find.
        Returns:
        The triggers with the given UUIDs, possibly an empty list when no triggers were found.
      • current

        WorkflowTrigger current()
        Gets the workflow trigger that initiated the current task execution, or null when no trigger is currently being
        Returns:
        The trigger that initiated the current task execution.
      • currentByName

        WorkflowTrigger currentByName​(String name)
        Finds a trigger that is firing currently and possesses the given name. When multiple such triggers exists, the trigger that fired most recently is returned.
        Parameters:
        name - Name of a trigger.
        Returns:
        The most recently fired trigger with the given name, that is still firing.
      • currentByUuid

        WorkflowTrigger currentByUuid​(UUID triggerUuid)
        Finds a trigger that is firing currently and possesses the given UUID. When multiple such triggers exists, the trigger that fired most recently is returned.
        Parameters:
        triggerUuid - UUID of a trigger.
        Returns:
        The most recently fired trigger with the given UUID, that is still firing.
      • currents

        List<WorkflowTrigger> currents()
        Gets a list of all triggers currently firing, ordered by the time their execution was started, in order from the node trigger that fired most recently to the trigger that fired least recently.
        Returns:
        A list of all triggers currently firing.
      • firedByName

        @Nullable
        WorkflowTrigger firedByName​(String triggerName)
        Finds a fired trigger with the given name. If multiple triggers with the same name exist, returns the trigger that most recently fired.
        Parameters:
        triggerName - Name of a trigger.
        Returns:
        The most recently fired trigger with the given name, or null when no such trigger exists.
      • firedByNames

        @Nonnull
        default List<WorkflowTrigger> firedByNames​(Iterable<String> triggerNames)
        Finds fired triggers by the given names in the current workflow execution context. If multiple triggers with the same name exists, returns the trigger that most recently fired.
        Parameters:
        triggerNames - Names of the triggers to find.
        Returns:
        The triggers with the given names, possibly an empty list when no triggers were found.
      • firedByNames

        @Nonnull
        default List<WorkflowTrigger> firedByNames​(String... triggerNames)
        Finds fired triggers by the given names in the current workflow execution context. If multiple triggers with the same name exists, returns the trigger that most recently fired.
        Parameters:
        triggerNames - Names of the triggers to find.
        Returns:
        Fired triggers with the given names, possibly an empty list when no triggers were found.
      • isCurrentlyFiring

        default boolean isCurrentlyFiring​(TriggerKey triggerKey)
        Whether the trigger with the given key initiated the current task execution.
        Parameters:
        triggerKey - The key of a trigger to check.
        Returns:
        Whether the given trigger is currently firing.
      • isCurrentlyFiring

        boolean isCurrentlyFiring​(UUID taskUuid,
                                  UUID triggerUuid)
        Whether the trigger with the given UUID initiated the current task execution.
        Parameters:
        taskUuid - UUID of the trigger's task.
        triggerUuid - UUID of a trigger to check.
        Returns:
        Whether the given trigger is currently firing.
      • isCurrentlyFiring

        default boolean isCurrentlyFiring​(WorkflowTrigger trigger)
        Whether the given trigger initiated the current task execution.
        Parameters:
        trigger - A trigger to check.
        Returns:
        Whether the given trigger is currently firing.
      • props

        Object props​(WorkflowTrigger trigger)
        Retrieves the properties of the given trigger and deserializes them into the trigger's properties model.
        Parameters:
        trigger - Trigger to process.
        Returns:
        The deserialized properties model instance
      • props

        default <T> T props​(WorkflowTrigger trigger,
                            Class<T> expectedType)
        Retrieves the properties of the given trigger and deserializes them into the trigger's properties model.
        Type Parameters:
        T - Type of the expected properties model.
        Parameters:
        trigger - Trigger to process.
        expectedType - Expected type of the properties model.
        Returns:
        The deserialized properties model instance, or null when the properties model is not of the expected type.