Restart/refresh engine at runtime
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2013 05:18 AM
Imagine a multi-tenant database (tenant column in each table). For Activiti the process definitions and instances are prefixed with a tenant specific string. Now I want to offer a backup/restore mechanism. Backup is no problem. All relevant data is stored in csv files. Each table results in a csv file.
But what to do after restoring the data from a backup file? Is there a way to tell Activiti to reload/refresh its data from the persistence layer? Or is there some safe way to restart the engine?
–Heiko
But what to do after restoring the data from a backup file? Is there a way to tell Activiti to reload/refresh its data from the persistence layer? Or is there some safe way to restart the engine?
–Heiko
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2013 08:51 AM
You can always call processEngine.shutdown() and create a new process-engine from the factory again, if you want activiti to reboot without rebooting the JVM…
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2013 03:54 AM
Perfect! 🙂
Unfortunately I can't find "shutdown" for a process engine (in 5.13). Did you mean "close"?
And for starting the process engine I use the cdi extension which automatically starts the engine after the application deployment. If I now want to restart the engine I probably have to do similar things. Especially it seems to be necessary to set the newly created process engine via ActivityServices.setProcessEngine!?
So what would be the best way to (re)start the process engine in this scenario?
Maybe like this?
<code>
processEngine.close();
activitiServices.setProcessEngine(processEngineLookup.getProcessEngine());
</code>
Unfortunately I can't find "shutdown" for a process engine (in 5.13). Did you mean "close"?
And for starting the process engine I use the cdi extension which automatically starts the engine after the application deployment. If I now want to restart the engine I probably have to do similar things. Especially it seems to be necessary to set the newly created process engine via ActivityServices.setProcessEngine!?
So what would be the best way to (re)start the process engine in this scenario?
Maybe like this?
<code>
processEngine.close();
activitiServices.setProcessEngine(processEngineLookup.getProcessEngine());
</code>

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2013 03:51 AM

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2013 05:48 AM
Yes it's the close method that Frederik was referring to.
If you use the CDI extension it's a bit harder to do this. You would have to look into the internals of the activiti-cdi what's done at startup.
Best regards,
If you use the CDI extension it's a bit harder to do this. You would have to look into the internals of the activiti-cdi what's done at startup.
Best regards,
