Is it possible to read an attached file from a javascript?
Hi,
I'd like to create a calculated value script attribute customization. This script needs to read a file (a txt configuration file). Is it possible to attach this file to the process (in the process links) and read it from javascript?
Which url I can use to access it?
Thanks,
Michele.
|
Accepted answer
Ralph Schoon (63.5k●3●36●46)
| answered Apr 16 '15, 8:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
JavaScript provides a way to configure the attribute customization. This data is provided from the process configuration source by the framework. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Configuring_additional_script_pa
This should be used to configure the scripts, as it is the built in fastest method to do so. Since JavaScript is run on the Client as well as on the server, you would need to use some mechanism based on html to access external data. It would likely have to be published by some Web Server similar to how the http filtered value provider uses such data. Doing excessive customization using JavaScript, especially with accessing remote data, can crate performance issues and ruin it for the users. Michele Pegoraro selected this answer as the correct answer
Comments
Michele Pegoraro
commented Apr 16 '15, 11:07 a.m.
The problem is that this configuration is too big to being included in process configuration (it is like a catalog) and we don't have external web server to publish it. I was supposing that having process attachments they could be accessed in some way, like a public url (as, I imagine, the icons)
Ralph Schoon
commented Apr 16 '15, 11:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The icons are packaged in the Java Bundles.
1
Ralph Schoon
commented Apr 16 '15, 11:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Should I add that, if the file is that big, it is probably a bad idea to try to load it every time the script is run?
Michele Pegoraro
commented Apr 21 '15, 5:23 a.m.
Yes, you're definitely right. The best thing would be to create a provider service as you suggest but unfortunately we cannot do it. We'll resolve reading the file with a server side advisor, which is not what the user wants but it will be sufficient.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.