Description

What is the problem?
The ContextRefreshedEvent is being processed in SpringProcessApplication whenever a context in the application context's hierarchy refreshed, due to Springs event propagation. The event causes deployment of process application, which can be too early, if the event corresponds to a child context instead of application context.

Side effect: If the @PostDeploy hook publishes some event (as it is done by sprint-boot-starter's process application) and there are EventListener}}s defined on that event on the application context (as we recommend it for spring-boot-starters {{PostDeployEvent), these listeners are not fired as expected, because the application context may not be initialized when the child context refreshes.

What would be the expected behavior:
The ContextRefreshedEvent should not be processed in case of child context, so that the parent context is in correct state, when the process application is being deployed