Arrays and percentage compute in a process

108 views
Skip to first unread message

Newbie01

unread,
Jan 28, 2014, 5:22:39 PM1/28/14
to suppor...@runmyprocess.com
Hi
I'm trying to create an array and a percentage compute in a process.

Here's what I'm trying:

Input variables
- A Value
- An array list

Example:

-----Inputs:-----
Value: 100
Array list( Name:Beck Money:$30 ; Name:María Money:$70)

-----Outputs:----
Name | Money | percentage
Beck | 30 | 0.3
Maria| 70 | 0.7

---------

I'm trying to use JavaScript, but maybe you know a simpler way to do it.
(Of course I'm not asking for a full code , just ideas to solve this in a better way)

Thanks a lot!







maybeg...@gmail.com

unread,
Jan 28, 2014, 5:26:16 PM1/28/14
to suppor...@runmyprocess.com, maybeg...@gmail.com
I forgot an important thing, it's a dynamic array.

Pray Desai

unread,
Jan 28, 2014, 6:44:11 PM1/28/14
to
Javascript is used on the web interface. If you need to compute process variables, then use Freemarker script. 

For this particular use, I would prefer to compute percentage on web interface using javascript.
If you are using an array widget on web interface with "name" and "money" columns, then you can create an additional column with type of widget "javascript" and configure widget for this column to write a script that can "listen to variables" (money,value)
and use their value to calculate the percentage compuation.You can change the visiblity of this column to invisible if needed.
"value" can be a variable for number input widget where you can set default value to 100 or ask the user to input.

JS to calculate percentage :
[[money]]/[[value]]; 


If you need to compute this as a process variable in the process then you need to write a freemarker script that iterates through the arraylist and calculates the percentage compuation. 

Freemarker script to calculate percentage :
${money?number/value?number};

Thanks,
Pray Desai
Solutions Architect, Global Software Center
 Fujitsu RunMyProcess      
 









--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/ee5425fb-e15d-476c-bae8-210f775b93c8%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages