Script Activity Error

125 views
Skip to first unread message

michael...@zodiac.com

unread,
Jul 29, 2014, 7:45:50 PM7/29/14
to suppor...@runmyprocess.com
Hello -

I am using a Script Activity in which I intend to do some process computations in JavaScript.

I created, tested and uploaded a script then started a process. But the process gets stuck on the script activity and reports this error:
The request could not be understood by the server due to malformed syntax

I did test the script in a JS test window and the script is relatively benign.

How can I get more information on what it is considering "malformed syntax"?

Michael

PS This is the entire script:
var item = JSON.parse(RMPApplication.get("item"));
var eco = item.eco;
var config = item.config;
var engCenters = "";
var numEngCenters = 0;
for (var ix=0; ix<eco.product_types.length; ix++) {
engCenter = config.productTypes[eco.product_types[ix]].engCenter;
if (engCenters.indexOf(engCenter+"|") == -1)
engCenters += engCenter+"|";
}
RMPApplication.set("numEngCenters",(engCenters.split('|')-1));

Sweta Suman

unread,
Jul 30, 2014, 12:08:30 AM7/30/14
to suppor...@runmyprocess.com
Hi Michael,
You may have missed the "quotes" in  last statement of JS.

var item = JSON.parse(RMPApplication.get("item"));
    var eco = item.eco;
    var config = item.config;
    var engCenters = "";
    var numEngCenters = 0;
    for (var ix=0; ix<eco.product_types.length; ix++) {
        engCenter = config.productTypes[eco.product_types[ix]].engCenter;
        if (engCenters.indexOf(engCenter+"|") == -1)
                engCenters += engCenter+"|";
    }
    RMPApplication.set("numEngCenters","(engCenters.split('|')-1)");
If you are still facing problem,please feel free to ask.

Thanks and Regards,
Sweta



--
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/65f6a942-be2a-4179-ba9b-55add2c18a44%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

Gareth Thiveux

unread,
Jul 30, 2014, 5:57:06 AM7/30/14
to suppor...@runmyprocess.com
Hi Michael,

RMPApplication.get() and RMPApplication.set() functions only make sense in the web interface context.
Here is the code you should use instead :

 var item = JSON.parse(item);
    var eco = item.eco;
    var config = item.config;
    var engCenters = "";
    var numEngCenters = 0;
    for (var ix=0; ix<eco.product_types.length; ix++) {
        engCenter = config.productTypes[eco.product_types[ix]].engCenter;
        if (engCenters.indexOf(engCenter+"|") == -1)
                engCenters += engCenter+"|";
    }
setVariable("numEngCenters",(engCenters.split('|')-1));


Regards,

Customer Solutions Engineer
 Fujitsu RunMyProcess
3 rue de Gramont, 75002 Paris - France

     


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.


Wagner, Michael

unread,
Jul 30, 2014, 11:05:00 AM7/30/14
to suppor...@runmyprocess.com
Thank you Gareth and Sweta!

Sorry about all my questions!  Someday I will get used to the RMP world...

Michael



You received this message because you are subscribed to a topic in the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/a/runmyprocess.com/d/topic/supportforum/b6K-DkY6x-Q/unsubscribe.
To unsubscribe from this group and all its topics, 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/.



--

MICHAEL WAGNER
PLM Systems Engineer
Zodiac Pool Systems, Inc.
2620 Commerce Way, Vista, CA 92081
michael...@zodiac.com
Ph 760-599-9600 x3087
Cell 760-473-8785

Reply all
Reply to author
Forward
0 new messages