Parameters in JS and HTML widgets

257 views
Skip to first unread message

javier.c...@gmail.com

unread,
May 23, 2014, 7:31:45 AM5/23/14
to suppor...@runmyprocess.com
I would like to retrieve a calculated variable (Array) javascript
For Internal Variable:
Mode = RMPApplication.getVariable ("P_mode");
A Simple Variable
Reference = RMPApplication.getVariable ("reference_id");

But if variable is an Array (Object) recovered from a collection

variablearray{
"date":["-","-"],
"mail":["mail 1","mail2"],
"approval":["Name1","Name2"]
}
I've tried:

Var objeto = RMPApplication.getVariable ("variablearray");
Var objeto = RMPApplication.getVariable ("variablearray.mail");
Var objeto = RMPApplication.getVariable ("variablearray.mail[0]");

but I have not gotten back to me the content, just returns null

Regrads

Javier

Bilal Ajaj

unread,
May 23, 2014, 7:48:19 AM5/23/14
to javier.c...@gmail.com, suppor...@runmyprocess.com
Hello,

To do this, you should be using "JSON.parse". Here is an example : 

var variablearray = '{"date" : ["1","2"], "mail":["mail1", "mail2"]}';
var variablearray_table = JSON.parse(variablearray);
var objeto = variablearray_table.mail[0];

Hope this will help you.

Best regards,




--
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...@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/1ee0531d-a3d2-46e9-b02e-9bd7d6eaf6d2%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.



--

Bilal AJAJ

Customer Solutions Engineer

     
Fujitsu RunMyProcess user? Please add a review on GoogleApps Marketplace

Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
Be environmentally friendly: do not print this email unless it is entirely necessary.

javier.c...@gmail.com

unread,
May 23, 2014, 8:04:23 AM5/23/14
to suppor...@runmyprocess.com, javier.c...@gmail.com
Hi bajaj, Thanks for you aportation but this is for a normal array. But I need read a RMPArray, this array is created in a process. I need execute RMPApplication and get the Calculated Variable

Example the reference_id is a simple calculated variable and I can recuperate this var with this example:Reference = RMPApplication.getVariable ("reference_id");
But if I would like recuperate the array return null

Regrads

calculate_vars.png

Bilal Ajaj

unread,
May 23, 2014, 8:15:26 AM5/23/14
to suppor...@runmyprocess.com, javier.c...@gmail.com
The best way to do this is to create a widget array and put the variable name of this widget the same as the one created in your process (in your example : array_approval_gates_1)

Don't forget to make your widget available on your second screen in order to get your variable.

Best regards.


--
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...@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/.

Bilal Ajaj

unread,
May 23, 2014, 8:29:59 AM5/23/14
to suppor...@runmyprocess.com, Javier Salinas
Javier,

Here is a more detailed explanation:

In order to pass a variable from a process to an interface, you should put a widget in the interface having the same variable name as the one in your process.

If your variable is an rmp formatted array and you want to display it, you can use a widget array. You should configure the columns to display everything.

If your variable is not meant to be displayed, you can use a text input widget that you configure as invisible and then you can use RMPApplication.get("array_approval_gates_1") where array_approval_gates_1 is the variable of your text input. It will be easier and faster for you doing it this way. 

Best regards.

javier.c...@gmail.com

unread,
May 23, 2014, 8:33:43 AM5/23/14
to suppor...@runmyprocess.com, javier.c...@gmail.com
What you comment me is to create an array with the same structure and automatically fill in?

My idea is to have 6 arrays array_approval_gates_1 variables with the same structure, array_approval_gates_2 ... all filled with a collection of approvers, halfway through informing them a date (new data) is added to read array and print in 1 array only thing that will change depending on the state 1, 2, (it will fill)

javier.c...@gmail.com

unread,
May 23, 2014, 8:38:02 AM5/23/14
to suppor...@runmyprocess.com, javier.c...@gmail.com
Make an Array Widget is a good option.

you say that with RMPApplication.get("array_approval_gates_1") i can put the value in a text input widget, but this return null. and array_approval_gates_1.mail or array_approval_gates_1.mail[0] all return null.

I can not pick up the whole array or array value?

Thanks

Bilal Ajaj

unread,
May 23, 2014, 9:08:45 AM5/23/14
to suppor...@runmyprocess.com, Javier Salinas
Javier,

Here is some screenshots of how you can do it.

First create your process this way
Inline image 6
Then create your widgets

Array widget
Inline image 1

Text input widget
Inline image 2

Notice that the variable name in both cases is the one put in the process (this is very important)

This way, the variable is put automatically in the interface
Array widget
Inline image 5


Text input widget
Inline image 4

In both cases, you can have access to your datas.

Best regards.


--
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...@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/.

javier.c...@gmail.com

unread,
May 27, 2014, 5:16:25 AM5/27/14
to suppor...@runmyprocess.com, javier.c...@gmail.com
Thanks, not what I wanted at first but I will.
Thanks for the help

Bilal Ajaj

unread,
May 27, 2014, 5:42:45 AM5/27/14
to suppor...@runmyprocess.com, Javier Salinas
You're welcome.

If you have other questions, please feel free to contact us back.
Reply all
Reply to author
Forward
0 new messages