Thursday, June 18, 2009

MQL Statements for Server Administrators

Given below are the some mql statments that can used to understand the status of the enovia server.

  • This command will be helpful in understanding which users are currently using the enovia database. This command will tell you the user and machine and the process that is being used to connect to the enovia data base.
MQL Stmt
sessions;
  • The output of this command will be in the following format
  • USERNAME MACHINENAME PROGRAMNAME


  • This next command will be helpful in understand the memory status of the enovia server at any given point in time.
MQL Stmt
monitor memory;
  • The output of this command will be in the following format.
Used heap 32822573 bytes, free heap 441200 bytes.

Matrix Memory Manager:

31703941 bytes of memory allocated in 2783 blocks, highwater= 31885325 bytes
27754496 bytes of memory reserved in 1694 blocks
JVM total memory: 63778816
JVM max memory: 66650112
JVM free memory: 36291952
JVM memory in use: 27486864
JVM available processors: 2

MQL Enchancements

  • Modify bus statement has some enhancements, One the of the enhancements is given below. I think this one will be helpful in data migration scripts mostly, but i am sure we will find other uses for this too.MQL Stmt
modify bus current "";
  • Triggers do not fire.
  • History records are not added.
  • No signature affected.

  • MQL Statement "temp query bus" has and new clause with new operators. i think this will be help full for us when we want to show list of objects in particular order(Sorting)
MQL Stmt
temp query bus orderby -type orderby name order +attribute[Color];
  • - for descending + for ascending.

  • Finally an MQL Statment to query connections. I think this MQL statement has been awaited for a long time. Using this mql statement we can query for the connection objects and the attributes in the connections much easier.

MQL Stmt
query connection to "Project Space" "TestProj" 21240970107702 select id;
query connection [type PATTERN];
  • There are many more different options that can be used with this statement. For more information: "help connection" on mql prompt.

Tuesday, June 9, 2009

Using "const" for reserved words in SEARCHES

Reserved words such as keywords and select expressions must be afforded special consideration in exact equal (==) Matrix expressions. For example, the following statement might be written to find business objects where the value of the attribute ‘Regression’ is ‘first’.
where 'attribute[Regression]==first';

But because ‘first’ is a select keyword that returns the first revision of a business object and is evaluated as such, the result of the evaluation — rather than the literal word ‘first’— is compared with the attribute.

For this type of situation, use const to indicate that whatever follows should not be evaluated.

For example: where 'attribute[Regression]==const"first"';

Const has three possible forms: all uppercase, all lowercase, and initial letter capitalized followed by all lowercase. No space can appear after the word const. It must be followed by a quote (double or single, depending on the syntax of the rest of the statement). Almost any character can appear within the quotes, with the exception of backslash and pound sign. The characters between the initial and closing quotes remain unevaluated.

If your implementations are using JSP/Tcl to compose a where clause dynamically (that is, using a variable to construct the where clause), the const syntax must be used because the value you pass in could be a ENOVIA Collaboration Platform keyword. If this happens, the where clause will not return an error, but you will get unexpected results.
Here are some examples of queries that will NOT return correctly without using const:

attribute[Some Attribute]==‘first’
attribute[Some Attribute]==‘FIRST’
attribute[Some Attribute]=="Current"
attribute[Some Attribute]=="owner"
description=="Current"
description=="policy"

However, the following will return correctly:

attribute[Some Attribute]==‘my first order’
attribute[Some Attribute]~=‘*first*’