# Cancel publication event and show error

**URL:** <https://community.bloomreach.com/t/cancel-publication-event-and-show-error/2201>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [October 30, 2020, 3:10pm UTC](https://community.bloomreach.com/t/cancel-publication-event-and-show-error/2201 "2020-10-30T15:10:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![max-f](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@max-f](https://community.bloomreach.com/u/max-f)\
**Post date:** [October 30, 2020, 3:10pm UTC](https://community.bloomreach.com/t/cancel-publication-event-and-show-error/2201/1 "2020-10-30T15:10:00Z")

</div>

Hi,

we have the requirement that a translated document should not be publishable if the main document is not yet published.  
If an editor tries to publish e.g. an English document while the “main” German one with the same `hippotranslation:id` is not live, the publication should be cancelled and the editor is shown an error.

We already use the detection of a publication event in our project on various places as described in the [docs](https://documentation.bloomreach.com/14/library/concepts/workflow/workflow-events.html). However, I do not know of a way to cancel the event subsequently (may be even too late here?) and show an error message to the user.

I also thought of a custom validator but only know how to use them to prevent saving - which should be possible here.

Do you have any ideas?

Best regards,  
Max

---

<div class="post-metadata">

**Author:** ![bcanvural](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/bcanvural/32/235_2.png) [@bcanvural](https://community.bloomreach.com/u/bcanvural)\
**Post date:** [November 2, 2020, 3:57pm UTC](https://community.bloomreach.com/t/cancel-publication-event-and-show-error/2201/2 "2020-11-02T15:57:18Z")

</div>

Hey Max,

Indeed, it’s too late at the point of publication event. You’d have to hook into the SCXML workflow engine [https://documentation.bloomreach.com/14/library/concepts/workflow/scxml-workflow-engine.html](https://documentation.bloomreach.com/14/library/concepts/workflow/scxml-workflow-engine.html) and somehow make a document not “publishable” if your condition is not met.
