MarkLogic 9 Product Documentation
cpf.checkTransition

cpf.checkTransition(
   docid as String,
   transition as element(*, p.transition)?
) as Boolean

Summary

Verify that the current transition is the correct one for the document. If a document is touched from multiple threads certain race conditions may apply that will cause the lookup of the transition to end up out of sync with the transition action when it is actually executed. In this case the action should do nothing; not even call cpf:success or cpf:failure. Some other CPF thread has already done the work on this document.

Parameters
docid The URI of the document.
transition The pipeline transition being executed.

Example

const cpf = require('/MarkLogic/cpf/cpf');

  declareUpdate();
  cpf.checkTransition('/myDocs/example.xml', cpf.transition );
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy