Form select widget value

Bonita BPM Community Edition
Version : 6.3.1

Hello,

Is it possible to set another value than the value which is showed in the select widget.
like:

Bar becomes: Bar

if it is possible how would i look like in the script for available values?
today the script is like this:
[“Bar”, …]
i think it should look like this:
[“foo”=>“Bar”, …]

Hi,
Yes, it is possible.
You can do that by using a HashMap.
For exemple, I create this map :

HashMap<String, String> map = new HashMap<String, String>();
map.put(‘foo’, ‘bar’);
map.put(‘one’,‘un’);
map.put(‘two’,‘deux’);

Then, I my the output of widget, I put the script :

return map.get(field_MyWidget);

If I enter ‘foo’ in the widget, it will return ‘bar’.
If I enter ‘one’, it return ‘un’.
etc …

i found it by my self in the groovy tutorial:
http://groovy.codehaus.org/Tutorial+1+-+Getting+started

Insted of:

[“foo”=>“Bar”, …]

it is:

[“Bar”:“foo”…]
[“what the option show”:“the value you gonna get”…]