RTC Script - How to do a calculted Script using enumerations
![](http://jazz.net/_images/myphoto/110ee3f07b99ddc5a77ecadac1af8978.jpg)
Good morning all,
I'm new to Java script but I have done some basic standard script stuff. I've seen the labs etc, but I never have time to investigate these or seem to have the time to invest in Java script... so any help tips etc would be great.
I have an Enumeration Setup:
Impact: None / Low / Medium / High (using Literals com.ibm.ImpactLiteral1 - com.ibm.ImpactLiteral4 (for example)
The Values I want to use within the Script are as follows: None = 0 / Low = 3 / Medium = 6 / High = 9.
I have then setup two attributes mapped to the new Enumeration:
Names and ID's are:
Impact1 = com.ibm.Impact_cost
Impact2 = com.ibm.Impact_time
I want to create a script that adds up the Enumeration values for Impact1 and Impact2
ImpactTotal = Integar (calculated from com.ibm.Impact_cost + com.ibm.Impact_time)
So if Impact1 is Low and Impact 2 is High = Impact Total is 9
My Questions
1.How to put in the Var for the Emuneration literal and the Actual Value required (0 - 9)
2. How to do the calculations based on the ID as I'm going to be adding more ... so want the script to be extendable for any new attributes that starts "com.ibm.impact_"
I've only been able to create a simple add script (using getValue) but have to put in the values (0, 3, 6, 9) not "Low / Medim / High"
I would really appreciate any suggestions to help - if you need clarification then please ask.
Thanks
Matt Muller
One answer
![](http://jazz.net/_images/myphoto/110ee3f07b99ddc5a77ecadac1af8978.jpg)