[ANSWER] Change process .properties without rebuilding process

1
0
-1

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 Manage jars Then I've added this jar to my process Process config 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\\classpath\ (without rebuilding process in Bonita) and restarted tomcat. Nothing changed. I still can see my dev setting then I running process on QA, but .jar file is new with QA setting.

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

3 answers

1
0
-1

Closed as above,

I've found that in certain circumstances, still under investigation, that catalina base is not populated...

That's why mines a little more complex. The other nice thing is that I can also wither encrypted or non-encrypted text. So for example the line for password... :)

regards

1
0
-1

Hi Sean, thanks for your reply.

On basis of your post I have created small part of code, which works smoothly for me

File catalinaBase = new File(System.getProperty("catalina.base")).getAbsoluteFile();
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

1
0
-1

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

Notifications