Handle basket with javascript

579 views
Skip to first unread message

jess...@gmail.com

unread,
Jul 22, 2015, 3:31:57 AM7/22/15
to Fujitsu RunMyProcess Developer Community
Hi,

I'm trying to change configuration basket popup following the steps of user guide: http://docs.runmyprocess.com/Developer_Guide/Web_Interface/User_Experience/Basket

So, I created a new WI with a javascript widget (I've attached a image with configuration), but it's not working.

I need some help, thank and regards

Jessica

basket_code.png

Pankaj Kumar

unread,
Jul 23, 2015, 2:20:22 AM7/23/15
to suppor...@runmyprocess.com, jessi mj
Hi Jessica,

In User Guide, reference code for task basket, in line in line 9

 var pendingData = assignedTo['1'];

Please replace it with

 var pendingData = assignedData['1'];

It should be running fine with this change.

Reference code:-

function notify(data){
    if (!data) return;
    // Filter the data assigned to the connected user.
console.log(JSON.stringify(data))
    var assignedData = data['ASSIGNED_TO'];
    if (!assignedData) return;
    // Filter the data for pending tasks
    var pendingData = assignedData['1'];
    if (!pendingData) return;

    // Filter the data for 123 application
    var applicationData = pendingData['157506'];
alert(JSON.stringify(applicationData))
    if (!applicationData) return;
     if (confirm('Do you want to see tasks list for 123?')){
        // Open the tasks list popup
        RMP_basket.popup(157506, 'ASSIGNED_TO', 1);
    }       
}
RMP_basket.addListener(notify);




Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support


--
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.
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/3602ae2f-b8e6-4e6c-9f41-227f56ff0526%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

jessi mj

unread,
Jul 24, 2015, 5:25:51 AM7/24/15
to Pankaj Kumar, suppor...@runmyprocess.com
Well,

I've done the change and then appeared an error ( I attach it in a image).
There are one thing that I don't understand, in json code there are more } than {, but when I've put more { It does not work and the error is the same.
Both codes are in a JavaScript widget

Thanks and regards,

Jessica
Code_JS.png
Code_JSON.png
Error.png

Pankaj Kumar

unread,
Jul 24, 2015, 5:43:59 AM7/24/15
to jessi mj, suppor...@runmyprocess.com
Hi Jessica,

in attached image, code_js.png, you are using the code

var pendingData = assignedTo['1'];

Kindly replace this code with

var pendingData = assignedData ['1'];

And kindly remove the json from the code as its the structure of the json is shared on the user guide, we receive when the handler function return the tasks data in json format.

Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support

Reply all
Reply to author
Forward
0 new messages