How to make collection identifier as dynamic variabe ?

358 views
Skip to first unread message

issin...@gmail.com

unread,
Dec 9, 2016, 4:51:12 AM12/9/16
to Fujitsu RunMyProcess Developer Community
Hi,

I'd like to make as generic as possible my code.

Here's the code we used a lot:
" function update_item() {
RMPApplication.debug ("begin update_item");
var my_pattern = {};
my_pattern.itemid = RMPApplication.get("my_item." + itemid);
var my_object = eval('(' + RMPApplication.get("my_item") + ')');
collectionid.updateCallback(my_pattern, my_object, update_ok, update_ko);
RMPApplication.debug ("end update_item");
} "

Typically, I want to make collectionid (before updateCallback method), as a variable and initialize its value in the header's code with something like:

var locationid = (the identifier of my impacted collection: col_my_collection by exemple)

How to make that ?
Thank your advice

B.Rgds
Thierry

David Courtaigne

unread,
Dec 9, 2016, 4:58:05 AM12/9/16
to suppor...@runmyprocess.com
Hello Thierry,

in order to achieve that, you have to use the eval() function:

eval(collectionid).updateCallback(my_pattern, my_object, update_ok, update_ko);

Kind regards,

David Courtaigne

David Courtaigne


Customer Solutions Engineer
RunMyProcess

 

dcour...@runmyprocess.com

3 rue de Gramont

75002, Paris, France.

+33 (0) 1 75 77 5180
www.runmyprocess.com
    
img-275-180-2
img-275-180-2


--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" 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 https://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/a026c47f-1c05-4979-9949-b52ce7669ada%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

issin...@gmail.com

unread,
Dec 9, 2016, 8:12:41 AM12/9/16
to Fujitsu RunMyProcess Developer Community
On Friday, 9 December 2016 10:58:05 UTC+1, dcourtaigne wrote:
> Hello Thierry,
>
>
> in order to achieve that, you have to use the eval() function:
>
>
> eval(collectionid).updateCallback(my_pattern, my_object, update_ok, update_ko);
>
>
>
> Kind regards,
>
>
> David Courtaigne
>
>
>
> David Courtaigne
>
> Customer Solutions Engineer
> RunMyProcess
>  dcour...@runmyprocess.com
>
> 3 rue de Gramont
> 75002, Paris, France.+33 (0) 1 75 77 5180
> www.runmyprocess.com
>     
>
>
> On Fri, Dec 9, 2016 at 10:51 AM, <issin...@gmail.com> wrote:
> Hi,
>
>
>
> I'd like to make as generic as possible my code.
>
>
>
> Here's the code we used a lot:
>
> " function update_item() {
>
>     RMPApplication.debug ("begin update_item");
>
>     var my_pattern = {};
>
>     my_pattern.itemid = RMPApplication.get("my_item." + itemid);
>
>     var my_object = eval('(' + RMPApplication.get("my_item") + ')');
>
>     collectionid.updateCallback(my_pattern, my_object, update_ok, update_ko);
>
>     RMPApplication.debug ("end update_item");
>
> } "
>
>
>
> Typically, I want to make collectionid (before updateCallback method), as a variable and initialize its value in the header's code with something like:
>
>
>
> var locationid = (the identifier of my impacted collection: col_my_collection by exemple)
>
>
>
> How to make that ?
>
> Thank your advice
>
>
>
> B.Rgds
>
> Thierry
>
>
>
> --
>
> Fujitsu - RunMyProcess
>
> ---
>
> You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
============================================

Thks David,

one word to replace my soluce (6 lines) ;)

Have a nice w-e
Thierry
Reply all
Reply to author
Forward
0 new messages