Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Using an EventHandler to modify page properties on activation, which version gets published - the modified or the unmodified?

daniel_s
Level 1
Level 1

Hi all,

I have built an event handler, which listens to replication events (@Property(name = "event.topics", value = { ReplicationAction.EVENT_TOPIC })) and modifies/adds a property to the page content within its handleEvent method.

What I have seen is that the new property is not transferred to the publish system on the first activation of the page. When I activate again, then the property is of course already set and it is transferred to the publish system.

My question is: Is that behaviour defined, so that I can depend on it? Or is it somehow related to timing, which version of the page is transferred to the publish system?

And: would using the JobProcessor change the behaviour?

Thanks a lot for your input!

Regards,
Daniel

PS: I am still using CQ 5.4 (an update is planned, would that change the behaviour?)

1 Accepted Solution
Sham_HC
Correct answer by
Level 10
Level 10

You are listening to replucation event & durbo is already created & you might not see the latest property changes if you do any.  What is your exact use case.

View solution in original post

2 Replies
Sham_HC
Correct answer by
Level 10
Level 10

You are listening to replucation event & durbo is already created & you might not see the latest property changes if you do any.  What is your exact use case.

daniel_s
Level 1
Level 1

Thanks for your quick answer!

Actually... we have a process on the publish system which sends an email if a page is activated for the first time. But it must not send mails when the page is activated again. So I need something to distinguish, on the publish system, if this was the first activation or another activation.

It seems to work if I create an event handler for replication events which sets a property to the page. The mail sending process can check to the property, and as soon as is is there, it would not send the mail.

You wrote "durbo is already created & you might not see the latest property changes" which is exactly what I want. Is it safe to change the word "might" into "will"?