Class DocumentEventTriggerSupport
java.lang.Object
com.flowable.platform.engine.impl.documentevent.runtime.DocumentEventTriggerSupport
Helpers shared by every Document Event trigger behaviour for surfacing the matched
CoreContentItem into the running scope. Two public entry points:
injectContentItem(VariableScope, DocumentEventDeclaration, CoreContentItem)reads the item from the triggerEventInstance(or accepts a pre-captured one) and writes it under the configuredvariableNameas a transient or persistent variable, walking up the scope chain so downstream activities can read it.appendContentItemToList(VariableContainer, DocumentEventDeclaration, CoreContentItem)appends the matched item to thelistVariableNamelist variable, creating it at the process / case root when absent. Refuses to corrupt a colliding non-list or wrong-element-type variable by throwingFlowableIllegalArgumentException.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendContentItemToList(org.flowable.common.engine.api.variable.VariableContainer container, DocumentEventDeclaration declaration, CoreContentItem contentItem) Append the content item to a list variable of content items.static voidinjectContentItem(org.flowable.variable.api.delegate.VariableScope variableScope, DocumentEventDeclaration declaration, CoreContentItem contentItem) Set the content item variable on the variable scope.static CoreContentItemreadContentItem(Object eventInstanceObject) Pull theCoreContentItempayload off the EventInstance.
-
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 whenvariableNameis 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 whenlistVariableNameis not configured or the content item is null.Throws
FlowableIllegalArgumentExceptionwhen the configured variable name is bound to a value that is not aList<CoreContentItem>— either a non-list value entirely, or a list whose first element is not aCoreContentItem. 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
Pull theCoreContentItempayload off the EventInstance. The listener emits it under theDocumentEventConstants.PAYLOAD_CONTENT_ITEMpayload field name as a non-correlation parameter.
-