windchill 通过代码设置分类属性

    public static WTPart classifyWTPart(WTPart part,String bindingAttributeName,String classificationNode)
            throws WTException, WTPropertyVetoException {
        Debug.P("---isCheckOut-----"+ WorkInProgressHelper.isCheckedOut(part)+
                "---isWorkCopy------"+WorkInProgressHelper.isWorkingCopy(part));
        WTPart part_work = (WTPart)WorkInProgressHelper.service.checkout(part,
                WorkInProgressHelper.service.getCheckoutFolder(), null).getWorkingCopy();
        PersistableAdapter obj = new PersistableAdapter(part_work,null, SessionHelper.getLocale(),new UpdateOperationIdentifier());
        obj.load(bindingAttributeName);
        obj.set(bindingAttributeName, classificationNode);
        obj.apply();
        PersistenceHelper.manager.save(part_work);
        return (WTPart)WorkInProgressHelper.service.checkin(part_work, null);
    }
上一篇:使用 Kotlin API 实践 WorkManager,掌握这个提升路径


下一篇:添加关联查询数据没有的数据,更新关联表