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.

How to send diffrent task based on the usage attribute value

Serkan_ACAROGLU
10-Marble

How to send diffrent task based on the usage attribute value

Hello All,


I have a workflow that reads usage table attribute called "Responsible"( see attachment ). There is expression inside workflow and it start activity according to attribute value that defined for each part in the uses table of assembly.

 

 

What i want in the code is to start relevant activities for each part based on their attribute values in uses table. If "Responsible" value is "A" then Activity A should start. If "Responsible" is "B" Activity B should start also in parallel and so on.
In the below code, it is starting activity based on the last part's attribute value. It doesnt matter each part attribute values. ( I think it overrides result inside the for loop ).

As you see in the attachment below code starts only "Activity E", not others. I expect start also "activity A and C as i defined attribute values for parts as A and C.

 

 

wt.part.WTPart part = null;
part = (wt.part.WTPart)primaryBusinessObject;

wt.fc.QueryResult qr2 = null;

qr2 = wt.fc.PersistenceHelper.manager.navigate(part, wt.part.WTPartUsageLink.USES_ROLE, wt.part.WTPartUsageLink.class, false);


wt.part.WTPartUsageLink relation;

for (int i = 0; i < qr2.size(); i++) {
relation = (wt.part.WTPartUsageLink) qr2.nextElement();
wt.part.WTPartMaster pM = (wt.part.WTPartMaster)relation.getRoleBObject();
System.out.println(">>>>>>>>>>>> Name: " + pM.getName() + " number is: " + " PartUsagelink OID : " + relation.getIdentity());

wt.part.WTPartUsageLink part1 = null;

part1 = (wt.part.WTPartUsageLink) wt.fc.PersistenceHelper.manager.refresh(relation);

com.ptc.core.lwc.server.PersistableAdapter obj = null;

obj = new com.ptc.core.lwc.server.PersistableAdapter(part1,null,wt.session.SessionHelper.getLocale(),new com.ptc.core.meta.common.SearchOperationIdentifier());

obj.load("Responsible");

System.out.println("MyPartusageLink IBA named usageSTR value :::: " +obj.get("Responsible") );

if (obj.get("Responsible") != null) {
result = String.valueOf(obj.get("Responsible"));
}

}

 

 

Thank you in advance for any comment.

0 REPLIES 0
Top Tags