Conditional routing based on a global attribute of Dynamic Document
Hello all,
i have run successfully the code in the case bellow for a Document.
When applying the same code for a different object type, Dynamic Document, it does not record in the variable of the workflow the value of the attribute.
I have tried the following:
try {
wt.epm.EPMDocument doc = (wt.epm.EPMDocument) primaryBusinessObject;
//get the attributes of the document.
wt.iba.value.IBAHolder holder = wt.iba.value.service.IBAValueHelper.service.refreshAttributeContainerWithoutConstraints(doc);
wt.iba.value.DefaultAttributeContainer ac = (wt.iba.value.DefaultAttributeContainer) holder.getAttributeContainer();
if (ac != null) {
wt.iba.value.litevalue.AbstractValueView[] avalues = ac.getAttributeValues();
for (int i=0;i<avalues.length;i++) {
wt.iba.value.litevalue.AbstractValueView val = avalues[i];
System.out.println("checking attribute: <" + val.getDefinition().getName() + "> with value= <" + val.getLocalizedDisplayString() + ">");
if (val.getDefinition().getName().equals("com.bicworld.Type")) {
ditatype= val.getLocalizedDisplayString();
break;
}
}
}
}catch(Exception e) { System.out.println("Caught Exception:" + e.toString()); }
I have also tried to use the Persistable Adapter as per below, but still the same problem.
try {
wt.epm.EPMDocument doc = (wt.epm.EPMDocument) primaryBusinessObject;
com.ptc.core.lwc.server.PersistableAdapter obj = new com.ptc.core.lwc.server.PersistableAdapter(doc,null,null,null);
obj.load("com.bicworld.Type");
ditatype = (String)obj.get("com.bicworld.Type");
}catch(Exception e) { System.out.println("Caught Exception:" + e.toString()); }
Any idea why is that happening?
Thank you in advance

