/    Sign up×
Community /Pin to ProfileBookmark

Javascript help within ITIM

hey everyone i am having a hard time figuring this out, just seeing if anyone has any ideas..
the process.auditEvent are just like Print outs..so i can see where the data is getting lost..i am losing the data on the second container search right after the SearchByFilter..i know this cause the length of array RoleResult is 0..I even tried replacing rolefilt with what should i exactly be there and still cant get the requester..What i am trying to do with this code is take a person based on where sits in tree is going to decide who approves him for certain role..so role is not dynamic just where they could be in tree. and i have all that working just some how that second search doenst seem to be working…thanks for your help ahead of time

process.auditEvent(person.get()):

//gets ther user’s organization from self enroling
var thisPerson = person.get();
var locationName = thisPerson.getProperty(“l”);
if (locationName.length < 1)
{
process.setResults(“SF” , “Location attribute was not passed correctly.”);
}

//find user’s organization
var filt = “(erglobalid =” + locationName[0] + “)”;
process.auditEvent(filt);

var locationSearch = new ContainerSearch();
//find user’s organization in the tree
var orgResult = locationSearch.searchByFilter(“OrganizationalUnit”, filt, 2);
var org = orgResult[0];

process.auditEvent(org);
process.auditEvent(orgResult.length);

//find the role appropriate and fwd the request
var rolefilt = “(erparent=erglobalid=” + org.getProperty(“erglobalid”)[0] + “*);
process.auditEvent(rolefilt);

var roleSearch = new ContainerSearch();
var roleResult = rolesearch.searchByFilter(“Role”, rolefilt, 2);

process.auditEvent(roleResult.length);

return new Participant(ParticipanyType.ROLE, roleResult[0]);

also some more help:
filt and rolefilt are filters with how the search is being done..rolefilt for example = “erparent=erglobalid=10732342933*)
searchbyFilter help
[url]http://publib.boulder.ibm.com/tividd/td/ITIM/SC32-1149-02/en_US/HTML/im451_poag38.htm#common_features1014972[/url]

containerSearch.searchByFilter(profileName, filter, scope)

profileName the name of the organizational container profile to use
filter LDAP search filter that defines the criteria for returned containers to meet. the filter must be in the format defined by RFC2254
scope optional search scope. 1 use for one level scope and 2 for sub tree scope..
returns an array of directoryObjects representing the results of the search..
let me know if this will help more

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @frito1981 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...