cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Hide Add participant action for CA1 role if user is part of PRA role and PR is in Open state.

SY_10256354
4-Participant

Hide Add participant action for CA1 role if user is part of PRA role and PR is in Open state.

I am using Windchill PDMLink Release 10.2 and Datecode with CPS M030-CPS22

This is simple business requirement, can be tested or implemented on any latest Windchill version.
Step 1: user is part of Problem Report Author(PRA) for PR object
Step2 : If PR state is Open, then only allow PRA user to show add particpant icon for CA1 role in Members table.
Step3: If other then Open state, disable/hide the add participant for CA1 role.

For this i have written a validator is current user is part of PRA role, if so, then check for state of the object.
But stuck at a point, how can i check and hide the add participant action for CA1 role.

Is it possible thru Validator? or DataUtility?

 

For now, wrote a validator code as below:

if (wTObject instanceof PalmaProblemReport) {
WTPrincipal principal = SessionHelper.getPrincipal();
ContainerTeamManaged container = (ContainerTeamManaged) ((PalmaProblemReport) wTObject).getContainer();
 
WTRoleHolder2 t = TeamHelper.service.getTeam((TeamManaged) wTObject);
Vector roles = t.getRoles();
for (Enumeration e = roles.elements(); e.hasMoreElements();) {
Role role = (Role) e.nextElement();
if (role.toString().equalsIgnoreCase(GlobalConstantsIF.ROLE_PROBLEM_AUTHOR_REPORT)) {
Enumeration participants = t.getPrincipalTarget(role);
while (participants.hasMoreElements()) {
WTPrincipalReference participant = (WTPrincipalReference) participants.nextElement();
 
boolean hasAccess = EnterpriseHelper.service.isSiteAdministrator(principal)
|| participant.getPrincipal().equals(principal);
 
if (hasAccess) {
State prState = ((PalmaProblemReport) wTObject).getLifeCycleState();
if (!State.toState("OPEN").equals(prState)
&& /*STUCK HERE :: How to add logic to get the CA1 add participant action*/) {
UIValidationResult palmaResult = UIValidationResult.newInstance(paramUIValidationKey,
UIValidationStatus.DISABLED);
System.out.println("Dissabled");
results.addResult(palmaResult);
}
}
return results;
}
5 REPLIES 5

Hello SY_10256354,

May I suggest you open a new case from PTC Tech Support ?

KR,

Charles.

HelesicPetr
22-Sapphire I
(To:cgautier)

Hi @cgautier 

TC does not provide any complex coding it is out of support, 

You can contact Global support that is payed service.

PS: My experience. or Has PTC changed anything in this? 

PetH

Hi @SY_10256354 

I would solve your issue by just configuration an advanced lifecycle state and permissions by LC.

Set deny Change Permissions and then grant access on it in the lifecycle 

The ACL Change Permission is responsible to allow user change Members on the object

 

The icon does not disappear but user can not change the members

HelesicPetr_0-1718362825776.png

 

PetrH

Hello HelesicPetr,

What does "TC" stand for ?

KR,

Charles.

HelesicPetr
22-Sapphire I
(To:cgautier)

Hi @cgautier 

My bad. It should be TS -Technical Support >D 

PetrH

Announcements


Top Tags