Class AdHocConversationMigrationValidator

java.lang.Object
org.cibseven.connect.ai.agent.agentic.AdHocConversationMigrationValidator
All Implemented Interfaces:
MigratingActivityInstanceValidator

public class AdHocConversationMigrationValidator extends Object implements MigratingActivityInstanceValidator
Explains why an instance carrying a conversation holder (CIB7-2137) cannot be migrated, the same way AdHocSubProcessInstanceValidator explains an active ad hoc scope (CIB7-1857).

A perActivity scope's holder is built to outlive the scope: that is the entire point, a feedback loop's entries sharing one conversation. It survives exactly as long as the execution enclosing the scope does, which migration has no defined handling for -- the holder has no activity, so it is not a node of the ActivityInstance tree migration walks, and its local variables are never claimed by anything migration does visit. Left unchecked, that surfaces many steps later and far from the cause, as the engine's generic Process instance contains not migrated variables failure naming only variable ids.

This runs for every migrating instance, including the process instance's own root scope, where a holder sits when its scope is modelled directly in the process: unlike AdHocSubProcessInstanceValidator, there is no reason to exempt the root here, since the holder being checked is never itself the ad hoc scope.

Refusal is a temporary MVP restriction pending CIB7-2167's generic engine SPI for activity-less dependent state. The engine must not know about AI-specific state. A root holder blocks all migration for the rest of the process instance's lifetime, even after its agentic scope was left for good.