Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hello All,
I am looking a solution inside workflow for getting the iba vaues of wtpart to wtdocument.
An example, i have a document and this document connected to wtpart by described by document.
I have an iba at wtpart called "MATERIAL" and i have an iba also for wtdocument called "MALZEME".
So i try to set MALZEME on wtdocument by getting to value of MATERIAL on the wtpart.
Ho we can establish this programatically inside workflow.
Thank you for your assistance.
Solved! Go to Solution.
Merhaba Serkan abi,
Beside Workflow I think that it will better to implement a Data Utility that will look for the part related to a document and get its attribute value and set it for the docme,nt
You can use the below code as exemple it retrieves the related doc of a given WTPart .
I would also suggest to use an Alias attribute to get the value on the wtdocument on the fly ,however they are not persisted in the DB :
describedBy@wt.part.WTPartDescribeLink~describes^wt.part.WTPart~<Part_Attribute>
iyi şanslar,
Fadel
Merhaba Serkan abi,
Beside Workflow I think that it will better to implement a Data Utility that will look for the part related to a document and get its attribute value and set it for the docme,nt
You can use the below code as exemple it retrieves the related doc of a given WTPart .
I would also suggest to use an Alias attribute to get the value on the wtdocument on the fly ,however they are not persisted in the DB :
describedBy@wt.part.WTPartDescribeLink~describes^wt.part.WTPart~<Part_Attribute>
iyi şanslar,
Fadel
Merhaba Fadel,
Teşekkür ederim cevabın için.
Sorry for the late response.
Your are right, i though to use alias attribute but at the end we will insert attributes into to excel and alias attibutes is not supported to map inside excel.
As for your suggestion i will try and give you feedback in short.
Görüşmek üzere.
Serkan Acaroglu
Hello Fadel,
Following code works well. It reads value of iba "PROJE_ACIKLAMASI" from wtpart and assigns value to workflow variable "attributeValue".
Then it loads document attribute "IBAName"and sets value according to workflow variable.
wt.doc.WTDocument doc = (wt.doc.WTDocument)primaryBusinessObject;
//Checkout and getting Working copy of object
wt.folder.Folder checkoutFolder = wt.vc.wip.WorkInProgressHelper.service.getCheckoutFolder();
wt.vc.wip.CheckoutLink col = wt.vc.wip.WorkInProgressHelper.service.checkout(doc,checkoutFolder,"");
doc = (wt.doc.WTDocument)col.getWorkingCopy();
wt.fc.QueryResult qr = wt.fc.PersistenceHelper.manager.navigate(doc, wt.part.WTPartDescribeLink.DESCRIBES_ROLE, wt.part.WTPartDescribeLink.class,false);
while (qr.hasMoreElements()){
wt.part.WTPartDescribeLink link = (wt.part.WTPartDescribeLink)qr.nextElement();
System.out.println("Found link ..........." + link);
wt.part.WTPart part = link.getDescribes();
System.out.println("Describes WTPart ...."+ part.getNumber());
com.ptc.core.lwc.server.PersistableAdapter part1 = new com.ptc.core.lwc.server.PersistableAdapter(part,null,null,null);
part1.load("PROJE_ACIKLAMASI");
attributeValue = (java.lang.String) part1.get("PROJE_ACIKLAMASI");
System.out.println("Partın parametre degeri : " + attributeValue);
}
com.ptc.core.lwc.server.PersistableAdapter obj = new com.ptc.core.lwc.server.PersistableAdapter (doc,null, java.util.Locale.US, new com.ptc.core.meta.common.UpdateOperationIdentifier());
obj.load("IBAName");
obj.set("IBAName", String.valueOf(attributeValue));
wt.fc.Persistable p = (wt.doc.WTDocument)obj.apply();
wt.fc.PersistenceHelper.manager.modify(p);
doc = (wt.doc.WTDocument)wt.vc.wip.WorkInProgressHelper.service.checkin(doc,"workflow ile checkout / checkin yapıldı");
System.out.println("Döküman Parametre degeri : " + obj.get("IBAName") );