private void prepareTrigger(Txn transaction, DocumentImpl doc) throws TriggerException {
final Collection col = doc.getCollection();
final DBBroker broker = context.getBroker();
final DocumentTrigger trigger = new DocumentTriggers(broker, col);
//prepare the trigger
trigger.beforeUpdateDocument(context.getBroker(), transaction, doc);
triggers.put(doc.getDocId(), trigger);
}