Monday, February 8, 2010

Enovia Matrixone MQL

Enovia Matrixone provides programming interface to access database through:
  • JAVA API
  • MQL
You can use JAVA API when developing JSP pages or JPO. You also write a TCL/MQL script to access database through MQL windows especially when you do mass data loading or updating. MQL/TCL scripts is my favorite scripting language. You can use TCL/MQL to implement trigger program to implement complicated business logic in a very short program.

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
Here is an example - how to obtain all components of an assembly.
  • 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 |
Here is the another example of TCL/MQL scripts
==================================
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.

2 comments:

  1. Merhaba;
    mql den user access lerini topluca yönetme imkanı var mıdır?
    Selamlar..

    ReplyDelete
  2. What is the difference between print bus and temp query bus

    ReplyDelete