Class DocumentEventTriggerSupport

java.lang.Object
com.flowable.platform.engine.impl.documentevent.runtime.DocumentEventTriggerSupport

public final class DocumentEventTriggerSupport extends Object
Helpers shared by every Document Event trigger behaviour for surfacing the matched CoreContentItem into the running scope. Two public entry points:
  • Method Details

    • injectContentItem

      public static void injectContentItem(org.flowable.variable.api.delegate.VariableScope variableScope, DocumentEventDeclaration declaration, CoreContentItem contentItem)
      Set the content item variable on the variable scope. No-op when variableName is not configured or the content item is null.
    • appendContentItemToList

      public static void appendContentItemToList(org.flowable.common.engine.api.variable.VariableContainer container, DocumentEventDeclaration declaration, CoreContentItem contentItem)
      Append the content item to a list variable of content items. If the list variable does not exist, it will be created. No-op when listVariableName is not configured or the content item is null.

      Throws FlowableIllegalArgumentException when the configured variable name is bound to a value that is not a List<CoreContentItem> — either a non-list value entirely, or a list whose first element is not a CoreContentItem. The first-element check is a fast-path approximation: we trust that a list populated by this method is homogeneous, so the first item is enough to detect a collision with an unrelated user-set variable.

    • readContentItem

      public static CoreContentItem readContentItem(Object eventInstanceObject)
      Pull the CoreContentItem payload off the EventInstance. The listener emits it under the DocumentEventConstants.PAYLOAD_CONTENT_ITEM payload field name as a non-correlation parameter.