Update user with metadata (extension) using java sdk will not work

139 views
Skip to first unread message

mfalk...@runmyprocess.com

unread,
Aug 9, 2018, 2:57:49 AM8/9/18
to Fujitsu RunMyProcess Developer Community
Hi,


+++++++++++++++++++++++
function updateAUser(p_user){//user object
p_user.name = id_name.getValue();
p_user.language = id_user_language.getSelectedValue();

var json = JSON.parse(p_user.extension.${P_mode});
json.mobile=id_phone.getValue();
for (i = 0; i < id_student.getRowsCount(); i++) {
json.student[i].firstname=id_student.id_firstname[i].getValue();
json.student[i].lastname=id_student.id_lastname[i].getValue();
json.student[i].grade=id_student.id_grade[i].getSelectedValue();
}
p_user.extension.${P_mode}= json;
p_user.update({
onSuccess : function(){
alert('user '+p_user.id+' updated!');
}
});
};
updateAUser(user);
+++++++++++++++++++++++++++++++
the user was already loaded during init of WI.

I want to save the metadata changes to the current user. The result was ok, but the changes are not saved.
Did i miss something?

Regrads Michael

Pankaj Kumar

unread,
Aug 9, 2018, 4:46:57 AM8/9/18
to Fujitsu RunMyProcess Developer Community
Hi Michael,

Are you getting any error while updating the use object, as if result was ok, you should be able to see the changes in user, also please check in metadata configuration.

also please share the JSON object that you have created for the metadata and network screen-print (please see attached scree-print) of the status of the service in order to assist you more on this

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+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/08b8f1e8-11c8-4bb6-87c8-36d71e6627f9%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

13125.PNG

mfalk...@runmyprocess.com

unread,
Aug 9, 2018, 6:58:22 AM8/9/18
to Fujitsu RunMyProcess Developer Community, mfalk...@runmyprocess.com
Hi,
thx for the fast reply.
I think that's exact my problem.
The JSOn content is not written, or better would not be updated withinj my user object.

the return is 200 ok
I could change something like the name, but the metadata chenges are not updtated. Could you provide a javascript ciode snippet ?


Kind regards

mfalk...@runmyprocess.com

unread,
Aug 9, 2018, 7:10:01 AM8/9/18
to Fujitsu RunMyProcess Developer Community, mfalk...@runmyprocess.com
Hi,
The problem is always in front of the screen.
I have found my problem.

function updateAUser(p_user){//user object
p_user.name = id_name.getValue();
p_user.language = id_user_language.getSelectedValue();

var json = JSON.parse(p_user.extension.${P_mode});
json.mobile=id_phone.getValue();
for (i = 0; i < id_student.getRowsCount(); i++) {
json.student[i].firstname=id_student.id_firstname[i].getValue();
json.student[i].lastname=id_student.id_lastname[i].getValue();
json.student[i].grade=id_student.id_grade[i].getSelectedValue();
}

p_user.extension.${P_mode}= JSON.stringify(json); //!!!!!!



p_user.update({
onSuccess : function(){
alert('user '+p_user.id+' updated!');
}
});
};
updateAUser(user);


Your hint about the XML will lead me to the question, did i need objects or strings.. now the problem was solved.

Thx

Reply all
Reply to author
Forward
0 new messages