What is the best way to manage assets for forms and custom widgets ?



I'm writing this post to discuss asset management on forms, pages, and custom widgets. We are developing an application with a lot of complex custom widgets. These widgets rely on several angular modules and can have up to 15 javascript and css assets (some are developed by our team and some are third party libraries). Bonita offers two options : local files or external url.

Local is not a good solution, because each time we'll make changes on one of the files we will have to reupload it to UIDesigner. The best solution we've found so far is to make the tomcat server serve those assets as static files and reference them in custom widgets and pages with external urls. It works fine but we have to update the url of each assets when we deploy the application to another server so it matches the domain of the new server. For example : http://localhost:8080/assets/myfile.js becomes http://testserver:8080/assets/myfile.js.

How do you manage your assets ? What is the best way to do it ? I want to spend the minimal amount of time managing them during development and migration.

Thank you



Submitted by Sean McP on Mon, 10/05/2015 - 12:21

Does the widget need the whole address for the included Asset?

Does it not work using relative addresses to the Tomcat home directory?

For example instead of

is it possible to put


In theory this should work like scripts in the HTML Head, not tried it but just an idea.


Submitted by Quentin Choulet on Mon, 10/05/2015 - 12:25

Thanks for your reply, unfortunately it doesn't work. The UI-Designer considers the url invalid if it doesn't start with "http://"

Submitted by Sean McP on Mon, 10/05/2015 - 12:50

thinking out the box have you tried creating properties and giving a URL like this:

yes it accepts it ;)

I haven't tried it...

Otherwise we need to ask for it as a feature


Submitted by Quentin Choulet on Mon, 10/05/2015 - 17:54

It doesn't work either. It looks like the brackets are not parsed : Chrome tries to fetch http://%7Bmyproperty%7D/assets/my.js, which fails with err::NAME_NOT_RESOLVED. I tried single brackets and double brackets. I also tried to access the property directly {myproperty} and from the properties object {properties.myproperty}.

Another workaround would be to concat all assets into one file. This way, only one url needs to be changed. However, we still have to makes changes on every widgets when deploying on the test server.

Using relative url to the Tomcat home directory would be perfect. Do you know where I can request a feature ?

Submitted by Sean McP on Tue, 10/06/2015 - 17:35

Add the Requirement to http://community.bonitasoft.com/ideas

and I'll support you, I'm sure several others will too.


1 answer


Anyone who likes this question please support the idea on the Ideas portal, the more supporters the more likely it will be built in to the product