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

We are happy to announce the new Windchill Customization board! Learn more.

Regulate Setup Participants

klozier
8-Gravel

Regulate Setup Participants

I am working with a Setup Participants task. I have three roles that the assignee will need to select a principle to act. The Resource Pool points to a group for each role. Two of the roles use the same resource pool.


I am looking to check three conditions on the transition:


1. That each role has a principle assigned


2.That only one principal has been selected for each role.


3. That the selected participant for the two roles that share a common resource pool do not have the same principle selected.


I have seen some code in other posts that are close to item 1 but not the others. All help is appreciated as I am new to code writting and workflow design.


Thanks,


-Kelly Lozier


BMPC-KAPL

1 REPLY 1
RandyJones
19-Tanzanite
(To:klozier)

On 02/07/13 17:58, Kelly Lozier wrote:
>
> I am working with a Setup Participants task. I have three roles that the assignee will need to
> select a principle to act. The Resource Pool points to a group for each role. Two of the roles
> use the same resource pool.
>
> I am looking to check three conditions on the transition:
>
> 1. That each role has a principle assigned
>
> 2. That only one principal has been selected for each role.
>
> 3. That the selected participant for the two roles that share a common resource pool do not have
> the same principle selected.
>
> I have seen some code in other posts that are close to item 1 but not the others. All help is
> appreciated as I am new to code writting and workflow design.
>
> Thanks,
>
> -Kelly Lozier
>
> BMPC-KAPL
>
>
> ----------------------------------------------------------------------------------------------------
>

You can't this with code in the transition. According to PTC the Team is not updated until the
complete transition is finished. I have the following code in a conditional after the "Setup
Participants" task. It checks to make sure that one and only one participant has been selected. In
other words I believe it is doing what you are asking for in 1 and 2 and probably with a little
tweaking could accomplish 3.

=============================================================================================================================
//This expression will check to make sure one and only one participant has been selected.
String sig = "Conditional to find number of approvers selected";
System.out.println("Here at " + sig);
result = "Send To Engineering";

//get the principals selected for the VARIANCE APPROVERS role
java.util.Enumeration
principals=((wt.team.Team)((wt.workflow.engine.WfProcess)self.getObject()).getTeamId().getObject()).getPrincipalTarget(wt.project.Role.toRole("VARIANCE
APPROVERS"));

//find out how many principals have been selected
int i = 0;
while(principals.hasMoreElements())
{
System.out.println(sig + " here at principals loop");
wt.org.WTPrincipal wtprincipal =
((wt.org.WTPrincipalReference)principals.nextElement()).getPrincipal();
System.out.println(sig + " principal = " + wtprincipal.getPrincipalDisplayIdentifier());
i++;
}
System.out.println(sig + " num selected = " + i);
if(i != 1) result = "Rework Approvers";
=============================================================================================================================


--
------------------------------------------------------------------------
Randy Jones
Systems Administrator
Great Plains Mfg., Inc.
1525 E North St
PO Box 5060
Salina, KS USA 67401
email: -
Phone: 785-823-3276
Fax: 785-667-2695
------------------------------------------------------------------------

Top Tags