Agile PLM API 创建项目之间的关系:参数无效

问题描述

我正在使用 Agile PLM API 开发 Scala 应用程序。 到目前为止一切正常,添加附件、添加 BOM 项目、创建项目等等。

但是在关系表中创建关系时,我总是收到这个错误:

com.agile.api.APIException: Invalid parameter.
  at com.agile.api.pc.Session.createError(Session.java:2039)
  at com.agile.api.pc.APIObject.createError(APIObject.java:76)
  at com.agile.api.pc.TableRelationships.convertCreateParamMapToVOCells(TableRelationships.java:92)
  at com.agile.api.pc.TablePC.doCreateServerRowWithParam(TablePC.java:58)
  at com.agile.api.pc.Table.createTableRow(Table.java:267)
  at com.agile.api.pc.Table.createRow(Table.java:231)

Agile API 需要一个以属性和值作为参数的哈希图来创建关系。所以这是我的代码:

val cells: java.utils.Map[_,_] = Map(
    Attrs.Items.Relationships.CriteriaMet -> null,Attrs.Items.Relationships.TypeImage -> 666,// id of item type as Integer
    Attrs.Items.Relationships.Name -> "foo",// name as String
    Attrs.Items.Relationships.Description -> "bar",// the description as String
    Attrs.Items.Relationships.CurrentStatus -> "Production",// lifecyclephase 'Production' as a String
    Attrs.Items.Relationships.Rule -> null,Attrs.Items.Relationships.Type -> 600 // id of item type as Integer
) 

relationshipTable.createRow(cells)

relationTable 实例是 ITable 类型,这种 Map 用于添加 BOM 项和附件,所以我认为这不是这里的问题。

我只是手动查询现有关系的单元格,并将它们的键与我在此映射中使用的常量进行比较,它们是相同的。我真的不知道无效参数是什么。是否缺少一个属性?参数类型是否错误?没有迹象表明出了什么问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)