package com.agile.test;
/**
* Created by IntelliJ IDEA.
* User:
* Date: Aug 19, 2008
* Time: 12:45:44 PM
* To change this template use File | Settings | File Templates.
*/
import com.agile.px.*;
import com.agile.api.*;
import java.util.List;
public class HWPX implements ICustomAction{
public ActionResult doAction(IAgileSession agileSession,
INode node,
IDataObject affectedObject) {
try {
IItem part = null;
if(affectedObject!=null) {
part = (IItem)agileSession.getObject(IItem.OBJECT_TYPE,affectedObject.getObjectId());
}
int size = 0;
if(part!=null) {
size = countBom(part);
return new ActionResult(ActionResult.STRING, String.valueOf(size));
}
return new ActionResult(ActionResult.STRING, "hello world!!!");
} catch (APIException e) {
return new ActionResult(ActionResult.STRING, "Exception");
}
}
private int countBom(IItem part) throws APIException{
ITable bomTable = part.getTable(ItemConstants.TABLE_BOM);
int size = 1;
ITwoWayIterator iter = bomTable.getTableIterator();
while(iter.hasNext()) {
IRow subRow = (IRow)iter.next();
IItem subPart = (IItem)subRow.getReferent();
size = size + countBom(subPart);
}
return size;
}
}
分享到:
相关推荐
ORACLE-Agile-PLM方案介绍.ppt
Oracle Agile PLM解决方案.pptx
Oracle Agile PLM技术架构方案.pdf
基于Oracle后台数据库的Agile PLM系统安装手册
Oracle Agile PLM技术架构方案.docx
Agile-PLM系统简介.pdf
“Lean-Agile Acceptance Test-Driven Development tells a tale about three fictive project stakeholders as they use agile techniques to plan and execute their project.
oracle.agile.plm管理员指南(简体中文9.2)
The Oracle Technology Network (OTN) Web site http://www.oracle.com/technetwork/documentation/agile-085940.html contains the latest versions of the Agile PLM PDF files. You can view or download these ...
Oracle Agile PLM高科技电子行业方案介绍;甲骨文公司的产品生命周期管理软件,在高科技电子行业有一定的优势,优点是实施快速
Oracle Agile PLM Analytics Introduce 2011 OOW
Pragmatic - Agile Web Development with Rails 2ndPragmatic - Agile Web Development with Rails 2ndPragmatic - Agile Web Development with Rails 2ndPragmatic - Agile Web Development with Rails 2...
agile plm property admin password
Wi-Fi-Agile-Multiband-Technical-Specification-v1.4
Agile PLM 在芯片行业使用,Agile PLM在离散行业使用
从零开始图文并茂的Oracle Agile PLM安装手册
2007-ZENIC-Agile-Beam Phased Array Radar for Weather Observations
PLM是一种应用于在单一地点的企业内部、分散在多个地点的企业内部,以及在产品研发领域具有协作关系的企业之间的,支持产品全生命周期的信息的创建、管理、分发和应用的一系列应用解决方案,它...Agile PLM_sdk9221手冊