AnsweredAssumed Answered

How to shutdown process engine when Application Server shuts

Question asked by ruedesilva on Aug 31, 2011
Latest reply on Jun 6, 2016 by anand0210
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

Outcomes