[ANSWER] Change process .properties without rebuilding process
Hello,
I have 2 environments (i.e. DEV and QA) and have created process, which works with DataBase. I would like to have DB connection parameters in properties file. After reading through forum I have found, that it is possible to store some parameters in properties file.
I've created 2 files with 3 lines in it (one for each environment) jdbc.url=... jdbc.user=... jdbc.password=... zipped this file and renamed zip to jar. Then I added my jar to Bonita Then I've added this jar to my process After publishing my process I can see my jar on server under %BONITA_HOME%\workspace\tomcat\bonita\server\tenants\1\work\processes\6370516458436187330\classpath\ where "6370516458436187330" is unique ID for process as I understand.
I have published my process to both DEV and QA with .properties file set for DEV DataBase.
Now I want to change connection on QA environment to QA DataBase. I have changed .properties, recreated my jar and copied it to %BONITA_HOME%\workspace\tomcat\bonita\server\tenants\1\work\processes\
Is there some way to change properties for process "online"? Without rebuilding process. Because for one process it is not a problem to rebuild, but if I have it over9000... Probably Bonita cashing this properties somewhere, but I have no idea where to search...
Thanks in advance, AK
P.S. Bonita version - 6.5.1 Java - 7 Tomcat - 1.8
Hi Sean, thanks for your reply.
On basis of your post I have created small part of code, which works smoothly for me
File propertyFile = new File(catalinaBase, "webapps/bonita/properties/bonita-coinfide.properties");
InputStream inputStream = new FileInputStream(propertyFile);
Properties properties = new Properties();
properties.load(inputStream);
return properties;
I guess this can be closed now
Rather than doing it in a jar, do it in a properties file...
Have a look here at my post related to LDAP (have a look for "All I can say is WOW, what a wonderful piece of community spirit." to find the post).
Here I use a properties file (either encrypted or not) and just read the data...
regards Seán