我使用 Java API 以编程方式为 VersionOne 资产创建对话。检查 Web UI 上的对话时,我看到提到的资产是按字母顺序排列的。
我想知道是否有办法覆盖提及的默认排列。目标安排将来自父资产 -> 子项。
像这样的东西:
- 默认值:添加重置按钮(任务)、添加提交按钮(任务)、创建 UI(故事)
- 目标:创建 UI(故事)、添加重置按钮(任务)、添加提交按钮(任务)
我尝试过的一些事情:
- 查看表达式和消息元数据。找不到与排序或排序相关的任何内容。
首先添加父资产,然后添加子资产:
// create a new conversation; this will act as the container of the expression (message) IAssetType conversationType = super.connection.metaModel.getAssetType(CONVERSATION); Asset conversationAsset = super.connection.services.createNew(conversationType, Oid.Null); super.connection.services.save(conversationAsset); // create a new expression containing the error message IAssetType expressionType = super.connection.metaModel.getAssetType(EXPRESSION); IAttributeDefinition expressionContentAttr = super.connection.metaModel.getAttributeDefinition(EXPRESSION_CONTENT); IAttributeDefinition expressionBelongsTo = super.connection.metaModel.getAttributeDefinition(EXPRESSION_BELONGS_TO); IAttributeDefinition expressionMentionsAttr = super.connection.metaModel.getAttributeDefinition(EXPRESSION_MENTIONS); Asset expressionAsset = super.connection.services.createNew(expressionType, Oid.Null); // set the message expressionAsset.setAttributeValue(expressionContentAttr, message); // add the message to the conversation expressionAsset.setAttributeValue(expressionBelongsTo, conversationAsset.oid); // set the context of the expression to belong to the VersionOne record Oid oid = Oid.fromToken(entity.oid, super.connection.metaModel); expressionAsset.addAttributeValue(expressionMentionsAttr, oid); // add mentions of other assets to the conversation for (String assetOid : assetOids) { Oid otherOid = Oid.fromToken(assetOid, super.connection.metaModel); expressionAsset.addAttributeValue(expressionMentionsAttr, otherOid); } super.connection.services.save(expressionAsset);