Expandir minha barra de realizações na Comunidade.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.

SOLUCIONADO

AEM cronjob based on details present under content node certain time

Avatar

Level 8

Hello,

 

I have come across where we have cronjob with OSGI configurations written for the cron expression.

https://sling.apache.org/documentation/bundles/scheduler-service-commons-scheduler.html#scheduling-w...

 

Instead of getting the time stamp from OSGI , I would want to get the time stamp stored  under /content/abc node property.

 

How could this be achieved that cronjob can trigger based on the time stamp stored under /content/abc

 

Could some one please provide inputs as how could this be done

 

Regards,

Srinivas

1 Solução aceita

Avatar

Resposta correta de
Community Advisor

@srinivas_chann1 

The following two approaches will help you reach the given ask: 

1.  Create an event lister which will be invoked when the node property changes/updates
Alternatively
2. , create another cron job that reads the values/timestamps given in node properties, and based on those values, invokes another cron job which performs the task. 

Ver solução na publicação original

3 Respostas

Avatar

Resposta correta de
Community Advisor

@srinivas_chann1 

The following two approaches will help you reach the given ask: 

1.  Create an event lister which will be invoked when the node property changes/updates
Alternatively
2. , create another cron job that reads the values/timestamps given in node properties, and based on those values, invokes another cron job which performs the task. 

Avatar

Community Advisor

HI @srinivas_chann1 

If you are looking for how to change osgi configuration based on node update and when service is activated, check the sample logic at below

https://github.com/arunpatidar02/aemaacs-aemlab/blob/master/core/src/main/java/com/community/aemlab/... 

 

You can also set default value in OCD reading from node, make sure the service ranking in a desire order

Arun Patidar

AEM LinksLinkedIn

Avatar

Level 8

Thanks to @arunpatidar  and @Nitin_laad  both the inputs helped to solve this issue