collective.multiworkflow.subscribers.reindex

collective.multiworkflow.subscribers.reindex#

Event subscribers keeping the workflow_states index fresh.

collective.multiworkflow.subscribers.reindex.reindex_workflow_states(obj: Any, event: Any) → None[source]#

Keep the index fresh for workflows with a state variable of their own.

Right after this event, WorkflowTool._invokeWithNotification reindexes every index named after one of the chain's workflow variables. When some workflow in the chain drives WORKFLOW_STATES that already covers this index, and reindexing anyway would recompute the object's entire metadata record a second time — ZCatalog rebuilds every column on a partial reindex, not just the ones named in idxs.

So the handler only acts when nothing else will: for a chain whose workflows all keep bespoke state variables, which is what any workflow written before this index existed does.

Parameters:
  • obj -- the object that transitioned.

  • event -- the IAfterTransitionEvent being handled; unused.