Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.
Knowledge Partner
Knowledge Partner
276 views

add an array of roles


Hi,

working on a workflow we have three diffrent types of roles that can be
added.
my thought was to add all of them to an array and loop through it to
add all the roles.

this is the code to create the add-array:
var user=form.getAllValues("loginname")[0][0];

if (user !='')
{
var addrole = new Array();
addrole[0]=form.getValues("department");
addrole[1]=form.getValues("employeetype");

var selectedroles=form.getValues("roles");

for(i=0;i<selectedroles.length;i++){
addrole[i+2]=selectedroles;
}
field.setValues(addrole);
field.select(addrole);
var add2=form.getValues("addroles");
form.alert("after select: " +add2[0]);
form.alert("lengtht: " +add2.length);


}

in a mapping rule I then have this code:
function roles()
{
var role = flowdata.get('start/request_form/addroles');
return role[flowdata.get('rolenr')];
}
roles();

I have some counters as well to make it work, that part works.
the problem is the add part in the role request.

I have this in the "Roles" line:
flowdata.get('roledn')

the error I get is that Role DN is invalid.
I suspect I get a string instead of an array somehow and that explains
me gettin a c instead of cn=.......
But how do I make it work?

The fist code part is in a dn picklist field and the post mapping is
set and shows it being a dn.

Thanks


--
-----------------------------------
joakim . ganse_@_ accept-it . se
------------------------------------------------------------------------
joakim_ganse's Profile: http://forums.novell.com/member.php?userid=6236
View this thread: http://forums.novell.com/showthread.php?t=452118

Labels (1)
0 Likes
2 Replies
afolli Absent Member.
Absent Member.

Re: add an array of roles


Hi,
in a mapping rule you should make use of ArrayLists instead of
arrays. That way, you must probably use role.get(i) instead of role.

I hope this helps. Best regards,

Alessandro


--
afolli
------------------------------------------------------------------------
afolli's Profile: http://forums.novell.com/member.php?userid=6964
View this thread: http://forums.novell.com/showthread.php?t=452118

0 Likes
Knowledge Partner
Knowledge Partner

Re: add an array of roles


Thank you.

It works perfect.
Just getting the real meaning of the array vs ArrayList and how to use
them.


--
-----------------------------------
joakim . ganse_@_ accept-it . se
------------------------------------------------------------------------
joakim_ganse's Profile: http://forums.novell.com/member.php?userid=6236
View this thread: http://forums.novell.com/showthread.php?t=452118

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.