on 2023 Aug 30 10:27 AM
Hi All,
How can we detect that the system is still initializing?
We have some after save listener that we don't want to be executed when the system is initialized.
I'm trying to use this, but it didn't work because it always return true
Registry.getCurrentTenantNoFallback().getJaloConnection().isSystemInitialized()
I'm trying to set session attribute in InitialDataSystemSetup and in the after save listener I would check if that attribute is null or not, and the result is always null.
So, how can we detect that the system is initializing?
Request clarification before answering.
Okay, so I ended up using a property that I set in the backend (not in the local.properties)
In the InitialDataSystemSetup, at the beginning of the createProjectData method, I set the property by executing these code:
Config.setParameter(INIT_SYSTEM, "true");
Then in the AfterSaveListener, I just need to check if that parameter is null or not
if (null == Config.getParameter(INIT_SYSTEM))
If the parameter is null, it indicates that the system is not initializing. It's not perfect, but it does its job.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi adiputera
Given that initialization only should happen once (1x) during the lifecycle of a SAP Commerce project, my recommendation is to add a configuration parameter that is changed when the application is initializing vs. when the application is running.
You would need to customize the custom After Save Event Listener to read the value of the property, and act on that
For setting the property, while initializing (or updating) in CCV2, you can configure through the hcs_admin (e.g. the presence or absence of said property).
If this solution does not work (and you need to use the After Save Event listener) observe the architecture of the Integration API module Webhook integration (which responds to After Save Events). This may give some additional direction on how you can design your solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
19 | |
17 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.