Hello,
I change document type to a subtype via DQL "change ... object to .. " command.
When I try to see and change the object properties from webtop I see that the object type is old type.
If no one open the properties window for a long time the problem disapered.
I think,
DFC caching document type properties when it is retrived via DFC.
Same problem exist for DFC. If I retrieve the document via IDfSession.getObjectByQualification(), and change the object type. I cannot change the attributes of new subtype and I get the fallowing exception. If I don't retreive the object previously, everything is fine.
Sample Code
try{
String query = "my_doc_type1 where my_new_field = '" + value + "'";
IDfDocument document = (IDfDocument)session.getObjectByQualification(query);
String updateQuery="change my_doc_type1 object to my_doc_type2 where evrak_no = '"+ evrakNo + "'";
IDfQuery query = new DfQuery();
query.setDQL(updateQuery);
IDfCollection collection = query.execute(session, DfQuery.DF_QUERY);
collection.close();
IDFDocument changedDocument = (IDfDocument)session.getObjectByQualification(query);
changedDocument.setString("musavirlik_no", "test value");
}catch (Exception e) {
e.printStackTrace();
}
Exception
Caused by: DfTypedObjectException:: THREAD: main; MSG: [DM_API_E_BADATTRNAME]error: "Bad attribute name 'musavirlik_no' for document/object."; ERRORCODE: 100; NEXT: null
at com.documentum.fc.client.impl.typeddata.LiteType.getAttr(LiteType.java:170)
at com.documentum.fc.client.impl.typeddata.AbstractTypedData.setString(AbstractTypedData.java:290)
at com.documentum.fc.client.DfTypedObject.setStringInternal(DfTypedObject.java:1477)
at com.documentum.fc.client.DfTypedObject.setStringRaw(DfTypedObject.java:1463)
at com.documentum.fc.client.DfTypedObject.doSetString(DfTypedObject.java:1445)
at com.documentum.fc.client.DfTypedObject.setString(DfTypedObject.java:1418)
at com.documentum.fc.client.DfDocument___PROXY.setString(DfDocument___PROXY.java)
at evrak.iski.gov.tr.dfc.lawaction.AddDocumentToCase.save(AddDocumentToCase.java:114)
... 1 more