Skip to content

Commit

Permalink
docs: clarify special case
Browse files Browse the repository at this point in the history
We wanted to make it a bit more clear why we shouldn't subscribe to new
catch events for ACTIVATING element instances.

For completeness, 19212 popped up because we subscribed an activating
element instance to a message boundary event during migration. It was
activating because there was an incident due to input mappings raised on
it. When resolving the incident, the element instance continued
activating and attempts to subscribe to its catch events. This failed
because migration had wrongly already subscribed the element instance to
it.

To further clarify what is done in this if block, I've changed the
method name and gave the method some javadoc.
  • Loading branch information
korthout committed Jun 12, 2024
1 parent d79af2e commit 60ae4d0
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,11 @@ private void tryMigrateElementInstance(
.setTenantId(elementInstance.getValue().getTenantId())));

if (ProcessInstanceIntent.ELEMENT_ACTIVATING != elementInstance.getState()) {
// element in ACTIVATING state should not be subscribed into new subscription during migration
// https://github.com/camunda/camunda/issues/19212
migrateCatchEvent(
// Elements in ACTIVATING state haven't subscribed to events yet. We shouldn't subscribe such
// elements to events during migration either. For elements that have been ACTIVATED, a
// subscription would already exist if needed. So, we want to deal with the expected event
// subscriptions. See: https://github.com/camunda/camunda/issues/19212
handleCatchEvents(
elementInstance,
targetProcessDefinition,
sourceElementIdToTargetElementId,
Expand All @@ -300,7 +302,14 @@ private void tryMigrateElementInstance(
}
}

private void migrateCatchEvent(
/**
* Unsubscribes the element instance from unmapped catch events in the source process, and
* subscribes it to unmapped catch events in the target process.
*
* <p>In the future, this method will also migrate event subscriptions if mappings are provided
* for the associated catch events.
*/
private void handleCatchEvents(
final ElementInstance elementInstance,
final DeployedProcess targetProcessDefinition,
final Map<String, String> sourceElementIdToTargetElementId,
Expand Down

0 comments on commit 60ae4d0

Please sign in to comment.