如何在VersionOne中重新排列表达式中的提及顺序?

时间:2014-07-31 04:36:15

标签: java rest versionone

我使用Java API以编程方式为VersionOne Assets创建对话。在Web UI上检查对话时,我发现提到的资产按字母顺序排列。

我想知道是否有办法覆盖提及的默认安排。目标安排将来自母公司资产 - >儿童。

这样的事情:

  • 默认:添加重置按钮(任务),添加提交按钮(任务),创建UI(故事)
  • 目标:创建UI(故事),添加重置按钮(任务),添加提交按钮(任务)

我尝试过的一些事情:

  1. 查看表达式和消息元数据。无法找到与排序或订购相关的任何内容。
  2. 添加父资产1st,然后是子项:

    // 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);
    

1 个答案:

答案 0 :(得分:1)

如果检查meta,您会看到提及是一个多关系属性。遗憾的是,无法在多关系属性中设置项的顺序。 这是检查meta的查询:

https://www14.v1host.com/v1sdktesting/meta.v1/Expression?xsl=api.xsl

VersionOne UI有一些逻辑,可以在显示之前设置对话提及的顺序。