Pb with UserMembership getgroupParentPath

1
0
-1

Hi guys,

software used: 6.3.2 developer license.

Context: building a customer ActorFilter.

I get the list of group for the processiInitiator and want to navigate up its group hierarchy.

long processInitiator = getAPIAccessor().getProcessAPI().getProcessInstance(processInstanceId).getStartedBy(); for (final UserMembership group : getAPIAccessor().getIdentityAPI().getUserMemberships(userId,0,100,UserMembershipCriterion.GROUP_NAME_ASC)) { LOGGER.info("INFO: group Membership: group.getGroupName():: " + group.getGroupName()); LOGGER.info("NFO: group Membership: goup path :: group.getGroupParentPath() :: " + group.getGroupParentPath()); }

The method getGroupParentPath is always returning null, I was expecting it would return me the path to the parent group of the current group.

Can someone help?

Thanks in advance

Johann

Comments

Submitted by haris.subasic on Fri, 07/25/2014 - 16:20

Sorry if you did already - but did you test it with a user that belongs to a group that has a parent group? Does group.getGroupName() give you expected value in the log?

Submitted by yannick.lombardi on Fri, 07/25/2014 - 16:26

Hi,

You name your variable processInitiator and after you use userId. Is it the same id with different name ?

Did you create this script in a Human task or a Script Task ?

Submitted by j.kerdal on Fri, 07/25/2014 - 16:31

Hi sorry for the mistake in cut and past when opening the discussion, you can consider userid is properly populated. I get the right groupid but can't get its parent path. yes the group has a parent.

i am coding an Actor Filter which is associated with a humantask.

Cheers

johann

Submitted by haris.subasic on Fri, 07/25/2014 - 17:28

You are right, it returns null, it seems to be an issue that you should report (or open a case on the customer portal, if you are a customer).

2 answers

1
0
-1

Hi,

Here is the solution I have implemented: UserMembership group =getAPIAccessor().getIdentityAPI().getUserMemberships(userId,0,100,UserMembershipCriterion.GROUP_NAME_ASC) ; Group r_group = getAPIAccessor().getIdentityAPI().getGroup(group.getGroupId()) ; String path = r_group.getParentPath() ;

It is working fine.

Thanks haris & yannick(56?), your feedback was much appreciated

Johann

1
0
-1

ok,

thanks a lot for the feedback, I will track it.

Would you have an idea to circumvent this problem? How can I get the parent group?

Thanks

Johann

Comments

Submitted by haris.subasic on Mon, 07/28/2014 - 10:04

A quick idea would be do a substring of the user's group and to remove one level (if his group is mainorg/parent/hisgroup that you remove last slash and everything behind to get mainorg/parent)

Notifications