@PostDeploy warranty for successfully deployed engines don't work

The documentation of @PostDeploy ensures:

The method will be invoked after the process application has been successfully deployed, meaning that
If the process application defines one or more ProcessEngines, all process engines have been successfully started and can be looked up.
If the process application defines one or more ProcessArchvies (deployments), all deployments have completed successfully.

but that’s not true for JBoss-Msc-Managed ProcessEngines.(tested on JBoss EAP6.1.1 with Camunda 7.4)
Because the org.camunda.bpm.container.impl.jboss.service.MscManagedProcessEngineController#start
starts the service asynchronously.

Thus sometimes our integration tests (arquillian based) fails because of the engines are not running and can’t be looked up (BpmPlatform.getProcessEngineService().getProcessEngine) in our process application client.

Currently i don’t have a workaround ready. Any hints how i can circumvent this?

Hi Nias,

Where do you configure the additional process engines (standalone.xml / processes.xml) and do you specify the process engine where the process application should be deployed in processes.xml?
What kind of process application do you use? ServletProcessApplication or EJBProcessApplication?

Cheers,
Christian

The additional process engine was configured from processes.xml.

<?xml version="1.0" encoding="UTF-8"?> default org.camunda.bpm.container.impl.jboss.config.ManagedJtaProcessEngineConfiguration java:jboss/datasources/apo2-integration-test full

I’m using an EJBProcessApplication with a @Singleton/@Startup EJB like:

{at}Singleton
{at}Startup
{at}ConcurrencyManagement(ConcurrencyManagementType.BEAN)
{at}TransactionAttribute(TransactionAttributeType.REQUIRED)
{at}ProcessApplication
{at}Local(ProcessApplicationInterface.class)
public class Apo2ProcessApplication extends EjbProcessApplication {


{at}PostDeploy
public void registerProcessApplication(ProcessEngine processEngine, ProcessApplicationInfo processApplicationInfo) {

ProcessEngine additionalEngine = BpmPlatform.getProcessEngineService().getProcessEngine(…);

}
}

<?xml version="1.0" encoding="UTF-8"?>
<process-application xmlns="http://www.camunda.org/schema/1.0/ProcessApplication">

	<process-engine name="IntegrationTests">
		<job-acquisition>default</job-acquisition>
		<configuration>org.camunda.bpm.container.impl.jboss.config.ManagedJtaProcessEngineConfiguration</configuration>
		<datasource>java:jboss/datasources/apo2-integration-test</datasource>
		<properties>
			<property name="history">full</property>
		</properties>
	</process-engine>

</process-application>