gpt4 book ai didi

filenet-p8 - 文件网更改文档类

转载 作者:行者123 更新时间:2023-12-03 01:12:43 26 4
gpt4 key购买 nike

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

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

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

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 服务器检索对象。

关于filenet-p8 - 文件网更改文档类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46717206/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com