Filenet 更改文档 Class

Filenet Change Document Class

我正在尝试更改给定文档的 class,下面是我使用的代码

Document p8Document = Factory.Document.getInstance(p8ObjectStore,
                oldDocumentClassName, new Id(documentId));
p8Document.changeClass(newDocClassName);
        p8Document.save(RefreshMode.REFRESH);

执行代码后,我可以看到文档 class 已成功更改。现在的问题是,如果我再次 运行 相同 guid 的代码,下面的行会再次使用旧文档 class 名称获取文档。

Document p8Document = Factory.Document.getInstance(p8ObjectStore,
                    oldDocumentClassName, new Id(documentId));

通过使用 getInstance,您无需请求服务器验证对象是否存在。请改用 fetchInstance

来自 Instantiating Objects

The getInstance methods are used to instantiate an object that references a server object that is assumed to already exist. The existence of the object is not verified on the Content Engine server, and no round trip to the server is made until you perform a function on the object

getInstance 是一种可以设置对象同时避免访问 CE 服务器的方法。

The fetchInstance methods instantiate an object by first making a round-trip to the Content Engine server and retrieving ("fetching") property values.

fetchInstance 实际上将从 CE 服务器检索对象。