Tuesday, February 9, 2010
How to run mql command in Java
public Boolean isAssembly(Context context, String objectId) throws Exception {
String mql = "expand bus "+objectId+" from rel EBOM select bus id dump ";
MQLCommand cmd = new MQLCommand();
cmd.open(context);
cmd.executeCommand(context,mql);
String sResult = cmd.getResult().trim();
cmd.close(context);
if (sResult.length()>0) {
return true;
} else {
return false;
}
}
How to remove signature when demoting a business object
tcl;
eval {
set err [catch {
set sObjectId [mql get env OBJECTID];
mql push context user "superuser" password "superpassword";
mql trigger off;
mql unsign bus $sObjectId signature all;
mql trigger on;
mql pop context;
} msg]
if {$err} {
puts $msg
}
exit 0 ;
}
Monday, February 8, 2010
Enovia Matrixone MQL
- JAVA API
- MQL
MQL and TCL are integrated together. You need to know the basic syntax of TCL. Here the link to access the TCL online documentation.
http://www.tcl.tk/doc/
MQL stands for Matrix Query Language. It is something like SQL. by you MQl, You can query database, update database. Here is the most comon-used MQl Commands:
- temp query businessobject - query database
- print business object - print business objects
- expand business object - expand business object by type and relationship
- modify business object - change attributes of business object
- new business object - create a new business object
- business object execute method - execute a method of a business object
- method 1: print bus Part 100 1 select from[EBOM].businessobject.id dump ]
- method 2: expand bus Part 100 1 from rel [EBOM] select bus id dump |
==================================
tcl;
set lCurrentBOM ""
set lMMComponents [split [mql expand bus $sObjectId to rel "EBOM" from rel "EBOM" dump |] "\n"];
foreach elem $lMMComponents {
set elem [split $elem |]
set sCompNum [lindex $elem 4]
if {[lsearch $lCurrentBOM $sCompNum] == "-1"} {
lappend lCurrentBOM $sCompNum
}
}
puts $lCurrentBOM
============================
The above scripts will find all component number and add it to a list named lCurrentBOM.
Sunday, February 7, 2010
ECO Auto Creation when the ECO is approved
- First of all, I disabled the OOTB auto ECO creation popup. It is useless. The reason is simple. The last person who approves the ECR will see the popup. Unfortunately, that person is not the resposnbile design engineer and should create ECO and take ownership.
- I developed an trigger to create ECO automatically when the ECR is approved. I connected the ECO to the ECR at the same time and all affected items are revised. I also send email to the responsible design engineer to notify him/her the ECO is created.
- Finally , to make ECR/ECO process simple, I disabled the ECO creation command. For the new part and new spec release, we require engineer to create ECR first.
Now, then ECR/ECO become one change process. One ECR, One ECO. The change request and change implementation becomes a seamless process!
Enovia Engineering Central ECR Creation Enhancment
- ECR - Engineering Change Request
- ECO - Engineering Change Order
ECR is used to tell your team members why you want to make a change and which items are affected. ECO is used to implment an ECR. The concept of the ECR/ECO process is good, but it is not user friendly. The out-of-box features need to tons of clicks to complete the ECR/ECO process and it also makes our engineers feel un-confortable to use the tool and always make mistakes. Keep in mind, product engineer are not computer guru and they focus on how to make a good product instead of focus on how to use the PDM system!
Therefore, it is very necessary to customize the Enovia eMatrix Engineering Central to make a user-friendly ECR/ECO process.
First of all, We need to have a new ECR Creation Form. The ECR Creation Form implements the following features:
- Fill in the ECR Form (same as the OOTB ECR form)
- List all affected components.
- Do a WHERE-USED Report, and automatically find all affected assemblies.
- Find all possible revisable specifications at the the same time.
- Allow user to enter the specification number
- Allow user to create suppporting document at the same time.
- According to above information, create an ECR and link all affected items to the ECR automatically.
- List those product lines an engineering working on. Don't list all possible product lines.
Here is the screenshot of the ECR Creation form. The new ECR creation will help product engineer to create and prepare an ECR within one screen and implmented the foundation of change management - when initiating a change, product engineer need to know the impact of the change! All PLM systems in the market today missed this fundamental thought and they throw the ball to the product engineer - "It is your resposiblity to do a where-used report and figure out by youself". I personally completely disagree about this.
If you need to know about how to implement this or how to query database on the fly, please feel free to contact with me.
Product Structure Viewer for Enovia eMatrix Engineering Central
- A Part object can be a Component or an assembly. If a part is an assembly, it has a list of components or assemblies
- A specification document is used to describe characteristic of a Part. Typically, a speification document is the following types of document:
- 3D Model
- 2D Drawing Print
- Material Property Specification
- Control and Test Specification
- Engineering Application Speification
- PPAP Document
- Customer Approved Specification
- Supplier Approved Specification.
- Other importation documents
- Bill of Material is a list a components or sub-assemblies which are used to assemble a product.
Enovia eMatrix Engineering Central is able to manage Parts, Specifications and Bill of Material very well. Like most other PLM Tools, Enovia eMatrix Engineering Central doesn't offer a tool to access those information at screen.
I have developed a tool which is called Prodocut Structure Viewer. The Product Structure Viewer provide the following features:
- Display Bill of Material, Specifications, files on one page.
- Generate alerts for the followings
- When the revision of Part and Specification is not the latest revision.
- When the state of Part and Specification is not released.
- Others business rule related to the specification
- Display the alerts when pointing to the alerts icon.
- Reduce a lots of number of clicks
- Able to tell which parts and specification are changed.
There are lots of other features such as:
- WHERE-USED - When pointing to the Part number of document number, the Product Strucuture Viewer will display where that part is used or where the is document is used. You don't have to open the select part and do a where used report.
- Download files or view files by using autovue. The Product Structure Viewer will display all files checked in the specification object. When pointing to file icon, it will display the file name. When clicking the file icon it will download the file to your local drive or launch the Autovue viewer to view the file online depends on the format of the file.
- Display the Bill of Materials at the same time.
If you want to know how to implemnt this, please feel free to contact with me.