How to shutdown process engine when Application Server shuts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2011 02:21 PM
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
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2011 03:59 AM
For example, in a Spring environment:
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean" destroy-method="destroy">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2011 11:17 AM
Also we would like to get a little bit more understanding on how the Job executors work, so that we can explain to customers.
1) Does Activiti create a new thread when the engine starts (i.e. buildProcessEngine)?
2) Does it matter for performance how many jobs we have in the DB running ?( i.e. is it one new thread per scheduled job?) Or there is just one thread that handles everything?
3) What is used for scheduling? A third-party app like Quartz or something built into Activiti?
thanks again,
Rue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2011 03:27 AM
1.Indeed, when "jobExecutorActive" property is set to true, the jobexecutor starts when the process-engine is built.
2. One thread is started that acquires the jobs. These job's are passed on to a thread-pool. The size can be altered using properties on the process-engine configuration. So performance is based on pool-size and your machine

3. Scheduling of the timers is done in the JobExecutor itself. All jobs (including timers) are handled the same, aquired by the thread and handles by the thread-pool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2011 01:10 PM
2) Can you indicate what the properties I need to set are? Note that I am building the process engine in code. So I would need the API calls.
3) What mechanism is used for scheduling/ Your own code? Or a third party product like Quartz?
thanks, in advance,
Rue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2011 01:34 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2011 04:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2016 02:43 AM
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean" destroy-method="destroy">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
testing: deploy in to server and run activity then shutdown server will this able to safe destroy?
please give me more details info along with examples on implementation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2016 06:22 AM
I'm not sure if I'm understanding what your asking here .. are you asking whether it's safe to use it like that? If so, yes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2016 05:05 AM
1) how to do implementation and testing? if any snippets or examples would help me to understand in detail.
2) how do we confirm it safe shutdown when the process is running state? should process completes its task or not?
I did below steps please correct me if i am wrong:
———————————————-
started Actviti flow then stop the server when actviti process completes few tasks and yet to do more tasks.
I noticed that activiti process stops immediately and show the status as IN PROGRESS for the current tasks.
I wanted to know whether it stops activiti engine after it updates status as COMPLETED?
please share more information on how activiti engine behaves when server shutdown.
Thanks
Anand
