cancel
Showing results for 
Search instead for 
Did you mean: 

How to shutdown process engine when Application Server shuts

ruedesilva
Champ in-the-making
Champ in-the-making
Hi,

We have Activiti running in Weblogic and it starts when Weblogic server is started with code similar to below in a Weblogic startup class:

Context jndi = InitialContextHelper.getInitialContext(InitialContextHelper.TYPE_DATASOURCE);
            DataSource ds = (DataSource) jndi.lookup(DATASOURCE_JNDI.BILLPLEX_DATASOURCE_JNDI.jndi());
           
            ProcessEngineConfiguration pec = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();
            pec.setDataSource(ds);
            pec.setTransactionsExternallyManaged(true);
            pec.setDatabaseSchemaUpdate("true");
            bpmEngine = pec.buildProcessEngine();

Now the Job Executor is also running and everything works fine. However is there away to safely shutdown Activiti when the server shuts down? i.e. We do not want to shutdown Weblogic when a job executor is running for example. Is there a way to signal Activiti to close/shutdown safely and then proceed with the server shut down only after Activiti is shutdown?

thanks,
Rue
11 REPLIES 11

jbarrez
Star Contributor
Star Contributor
This is all in the docs … but okay: Activiti uses database transactions. When your server shuts down, that transaction is either committed or not. In the latter case, it's rolled back and your activiti data is back to the previous stable state.

anand0210
Champ in-the-making
Champ in-the-making
Thanks