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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Translate the entire conversation x

How to assign a workflow task to dynamically generated WTUser variable

SriTalatam
7-Bedrock

How to assign a workflow task to dynamically generated WTUser variable

Windchill 12.0.2.13

Tried approach:

1. I have a custom workflow in which, through an expression, I obtain the attribute(of primary business object) that holds user value. For this user, the reporting manager(type: WTUser) is retrieved from the AD. 

2. A workflow variable 'supervisor' of type WTUser is created and the WTUser value obtained in step-1 is assigned.

3. In the workflow activity(Participants tab --> Variables section), the 'supervisor' variable is defined as 'Assignee'. 

Expectation: Task, if generated successfully, should be assigned to the 'supervisor' user. 

However, on the task page, the variable appears as a dropdown and the task is assigned to the admin.

 

Workflow expression robot to assign Supervisor value:

try {
wt.doc.WTDocument doc = (wt.doc.WTDocument) primaryBusinessObject;
ext.tools.iba.IBAUtility flsIBinst = new ext.tools.iba.IBAUtility ();
String attUserValue = (String)flsIBinst .getAttributeValue(doc,"flsUserId");
ext.util.ADUtil ADUtilinst = new ext.util.ADUtil();
ADUtilinst.initialize();
Supervisor = ADUtilinst.getUsersManager(attUserValue);
} catch (Exception wfe) {
wfe.printStackTrace();
}

 

Appreciate any insights! Thanks

ACCEPTED SOLUTION

Accepted Solutions

Thanks to my colleague, the solution here is to update the variable properties with:

1. Disabling visible property.

2. Declare the same variable in both 'Initialize From' and 'Copy Into'. 

This ensured to assign the WTUser value generated through expression, to the approval task. 

View solution in original post

1 REPLY 1

Thanks to my colleague, the solution here is to update the variable properties with:

1. Disabling visible property.

2. Declare the same variable in both 'Initialize From' and 'Copy Into'. 

This ensured to assign the WTUser value generated through expression, to the approval task. 

Announcements
Top Tags