Pre processing of document events

I know we can listen to document events like is described here: Respond to Workflow Events

If i would listen to a delete event I can do some post processing. But I’m not able to do some pre-processing. So before the document actually gets deleted. Is there a way to do that? And is it possible to also abort the delete operation?

There is one I can think of, relatively less hacky:

  • The document workflow is controlled through the SCXML statemachine internally, and the scxml definition uses various atomic action tags such as version, copy*, …, archiveDocument actions configured with their FCQNs in the repository. [1]
  • Document deletion is done through the archiveDocument action org.onehippo.repository.documentworkflow.action.ArchiveDocumentAction in the end, which creates an real workhorse, org.onehippo.repository.documentworkflow.task.ArchiveDocumentTask.
  • So, if the action class and task class are overriden with the FQCN configuration change in the repository, you can probably add any custom logic there, and if the task throws a WorkflowException, I think it will abort the operation, too.

Regards,

Woonsan

[1] SCXML Workflow Engine - Bloomreach Experience Manager (PaaS/Self-Hosted) - The Fast and Flexible Headless CMS

2 Likes