Quantcast
Channel: PTC Community : Discussion List - Windchill
Viewing all articles
Browse latest Browse all 5797

How to use modify the value of attribute in a workflow depending on whether the activity is completed or not?

$
0
0

I am creating a workflow with one activity. If that activity is completed, then the value of the IBA (Material_Type) must be changed from whatever the user has entered to value defined here (Copper).

I tried the following codes but still did not get the result. please help me to solve this.

1.

com.ptc.core.lwc.server.PersistableAdapter obj = new com.ptc.core.lwc.server.PersistableAdapter(primaryBusinessObject, null,java.util.Locale.getDefault(), new com.ptc.core.meta.common.UpdateOperationIdentifier());

obj.load("Material_Type");

obj.set("Material_Type", "Copper");

obj.apply();

2.

object = (wt.fc.WTObject)

com.ptc.core.lwc.server.PersistableAdapter obj = new com.ptc.core.lwc.server.PersistableAdapter(object,null,java.util.Locale.getDefault(),new com.ptc.core.meta.common.UpdateOperationIdentifier());

obj.load("Material_Type");

obj.set("Material_Type", "Copper");

obj.apply();

wt.fc.PersistenceHelper.manager.modify(object);

3.

wt.fc.QueryResult qr = wt.part.WTPart(primaryBusinessObject);

while (qr.hasMoreElements())

{

wt.fc.Persistable my_persistable = (wt.fc.Persistable)qr.nextElement();

my_persistable = wt.vc.wip.WorkInProgressHelper.service.checkout( (wt.vc.wip.Workable) my_persistable, wt.vc.wip.WorkInProgressHelper.service.getCheckoutFolder(),"").getWorkingCopy();

 

com.ptc.core.lwc.server.PersistableAdapter obj = new com.ptc.core.lwc.server.PersistableAdapter(my_persistable,null,java.util.Locale.US,new com.ptc.core.meta.common.UpdateOperationIdentifier());

obj.load("Material_Type");

obj.set("Material_Type", "Copper");

obj.apply();

 

wt.fc.PersistenceHelper.manager.modify(my_persistable);

wt.vc.wip.WorkInProgressHelper.service.checkin((wt.vc.wip.Workable) my_persistable,"");

}


Viewing all articles
Browse latest Browse all 5797

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>