MQL 105
MQL 105
Version 10.5
© Copyright 1994–2004 by MatrixOne Inc.
All rights reserved.
PROPRIETARY RIGHTS NOTICE: This documentation is proprietary property of MatrixOne, Inc. In accordance with
the terms and conditions of the Software License Agreement between the Customer and MatrixOne, the Customer is
allowed to print as many copies as necessary of documentation copyrighted by MatrixOne relating to the Matrix software
being used. This documentation shall be treated as confidential information and should be used only by employees or
contractors with the Customer in accordance with the Agreement.
MatrixOne®, Matrix®, and Adaplet® are registered trademarks of MatrixOne, Inc.
AEF, Application Exchange Framework, MatrixOne Document Central, MatrixOne Engineering Central, MatrixOne
Program Central, MatrixOne Sourcing Central, MatrixOne Supplier Central, MatrixOne Team Central, IconMail,
ImageIcon, Primary Browser, Star Browser, and State Browser are trademarks of MatrixOne Inc. Oracle® is a registered
trademark of Oracle Corporation, Redwood City, California. DB2, AIX, and WebSphere are registered trademarks of
IBM Corporation. WebLogic is a registered trademark of BEA Systems, Inc. Solaris, Sun ONE, UltraSPARC, Java,
JavaServer Pages, JDBC, and J2EE are registered trademarks of Sun Microsystems, Inc. Windows 98, Windows NT,
Windows 2000, and Windows XP, and Internet Explorer are registered trademarks of Microsoft Corp. HP and HP-UX are
registered trademarks of HP. All other product names and services identified throughout this book are recognized as
trademarks, registered trademarks, or service marks of their respective companies.
This product includes software developed by the Apache Software Foundation. (http://www.apache.org/)
This product includes software developed by the OpenLDAP™ Project for use in the openLDAP Toolkit. (http://
www.openldap.org/)
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://
www.openssl.org/)
This product includes cryptographic software written by Eric Young. ([email protected])
This product includes GifEncoder and ImageEncoder software written by Jef Poskanzer ([email protected]). Copyright
©1996,1998. All rights reserved.
The documentation that accompanies MatrixOne applications describes the applications as they are delivered by
MatrixOne. This documentation includes readme files, online help, user guides, and administrator guides. If changes are
made to an application or to the underlying framework, MatrixOne cannot ensure the accuracy of this documentation.
These changes include but are not limited to: changing onscreen text, adding or removing fields on a page, making
changes to the administrative objects in the schema, adding new JSPs or changing existing JSPs, changing trigger
programs, changing the installation or login process, or changing the values in any properties file. For instructions on
customizing the provided documentation, see the Application Exchange Framework Guide.
MatrixOne Inc.
210 Littleton Road
Westford, MA 01886, USA
Telephone: 978-589 4000
Fax: 978-589-5700
Email: [email protected]
Web Address:http://www.matrixone.com
DM-MX-06-10-50
Table of Contents
Version 10 iii
Recordseparator Clause .................................................................................68
Examples ........................................................................................................68
Tcl Format Select Output .......................................................................................69
iv MQL Guide
Kinds of Vaults .....................................................................................................125
Business Object Vaults .................................................................................125
Administration Vault ......................................................................................125
Defining a Vault ...................................................................................................126
Description Clause ........................................................................................126
Icon Clause ...................................................................................................127
Vault Types ...................................................................................................127
Tablespace Clause .......................................................................................128
Indexspace Clause .......................................................................................128
Server Clause ...............................................................................................128
Interface Clause ............................................................................................128
File Clause ....................................................................................................128
Map Clause ...................................................................................................129
Hidden Clause ..............................................................................................129
Property Clause ............................................................................................129
Modifying a Vault Definition .................................................................................130
Modifying a Vault Definition ..........................................................................130
Clearing and Maintaining Vaults ..........................................................................131
Clearing Vaults..............................................................................................131
Indexing Vaults .............................................................................................131
Fixing Fragmented Vaults .............................................................................132
Updating Sets With Change Vault ................................................................132
Printing a Vault Definition..............................................................................133
Deleting a Vault ...................................................................................................134
Version 10 v
Modifying a File Store ...................................................................................152
Multiple directories in hashed captured stores..............................................153
Maintaining a File Store .......................................................................................155
Tidy Store Statement ....................................................................................155
Inventory Store Statement ............................................................................155
Rehash Store Statement...............................................................................156
Validate Store Command ..............................................................................157
Monitoring Disk Space ..................................................................................157
Deleting a Store ...................................................................................................159
Purging Files .................................................................................................159
vi MQL Guide
Working with Servers ...........................................................................................187
Defining a Server ..........................................................................................187
Description Clause ........................................................................................188
Icon Clause ...................................................................................................188
User Clause ..................................................................................................188
Password Clause ..........................................................................................188
Connect Clause ............................................................................................188
Timezone Clause ..........................................................................................188
Hidden Clause ..............................................................................................190
Property Clause ............................................................................................190
Modifying a Server Definition ...............................................................................192
Modifying a Server Definition ........................................................................192
Disabling or Deleting a Server .............................................................................193
Disabling a Server.........................................................................................193
Deleting a Server ..........................................................................................193
Distributing Data Across Servers .........................................................................194
Setting Up a Distributed Database................................................................194
Considerations .....................................................................................................196
Network Stability ...........................................................................................196
Locating the Master Vault .............................................................................196
Renaming Servers ........................................................................................196
Distribution Problems ....................................................................................196
Importing Servers..........................................................................................197
Should I Use a Link or a Copy? ....................................................................197
Using Schema Names .........................................................................................199
Requirements................................................................................................199
Use Case ......................................................................................................199
Version 10 vii
Export statement ...........................................................................................216
ADMIN_TYPE Clause ...................................................................................216
OPTION_ITEMs ............................................................................................217
XML Clause...................................................................................................218
Into File/Onto File ..........................................................................................218
Exclude Clause .............................................................................................218
Log FILENAME Clause .................................................................................218
Exception FILENAME Clause .......................................................................219
Exporting Business Objects .................................................................................220
Export Bus Statement ...................................................................................220
OPTION_ITEMs ............................................................................................221
Exporting Workflows ............................................................................................223
Export Workflow Statement...........................................................................223
Exporting Objects to XML ....................................................................................224
XML Export Requirements and Options........................................................224
XML Clause...................................................................................................225
XML Statement .............................................................................................225
XML Output ...................................................................................................225
Importing Administrative Objects .........................................................................229
Import Statement...........................................................................................229
List Clause ....................................................................................................230
Admin and ADMIN_TYPE Clauses ...............................................................230
OPTION_ITEMs ............................................................................................231
Use FILE_TYPE Clauses..............................................................................232
Importing Servers ..........................................................................................233
Importing Workspaces ..................................................................................233
Importing Properties ......................................................................................234
Importing Business Objects .................................................................................236
Import Bus Statement ...................................................................................236
List Clause ....................................................................................................237
OPTION_ITEMs ............................................................................................237
Use FILE_TYPE Clauses..............................................................................239
Importing Workflows ............................................................................................241
Import Workflow Statement...........................................................................241
Extracting from Export Files.................................................................................242
OPTION_ITEMs ............................................................................................242
Examples ......................................................................................................242
Migrating Databases ............................................................................................243
Migrating Files ...............................................................................................243
Comparing Schema .............................................................................................245
Scenario ........................................................................................................245
Creating a Baseline .......................................................................................245
Comparing a Schema with the Baseline .......................................................246
Reading the Report .......................................................................................248
Examples ......................................................................................................252
Version 10 ix
Icon Clause ...................................................................................................327
Rule Clause...................................................................................................328
Range Clause ...............................................................................................328
Trigger Clause...............................................................................................332
Multiline Clause .............................................................................................333
Hidden Clause..............................................................................................333
Property Clause ............................................................................................333
Checking an Attribute...........................................................................................334
Copying and/or Modifying an Attribute Definition .................................................335
Copying (Cloning) an Attribute Definition ......................................................335
Modifying an Attribute Definition ...................................................................335
Deleting an Attribute ............................................................................................337
x MQL Guide
Modifying a Relationship Definition ...............................................................370
Connection End Modifications ......................................................................371
Deleting a Relationship ........................................................................................374
Working with Relationship Instances ...................................................................375
Modifying Relationships ................................................................................375
Connection IDs .............................................................................................375
Modifying Attributes of a Connection ............................................................376
Freezing Connections ...................................................................................376
Thawing Connections ...................................................................................376
Deleting Connections ....................................................................................376
Printing Connections .....................................................................................376
Version 10 xi
How Many States are Required? ..................................................................401
Who Will Have Object Access?.....................................................................401
Is the Object Versionable or Revisionable? ..................................................402
How Do You Change From One State to the Next? .....................................402
Defining an Object Policy .....................................................................................404
Description Clause ........................................................................................404
Icon Clause ...................................................................................................405
Type Clause ..................................................................................................405
Format Clause...............................................................................................406
Defaultformat Clause ....................................................................................407
Sequence Clause ..........................................................................................407
Enforce Clause..............................................................................................409
State Clause..................................................................................................410
Store Clause .................................................................................................421
Hidden Clause...............................................................................................422
Property Clause ............................................................................................422
Copying and/or Modifying a Policy Definition.......................................................423
Copying (Cloning) a Policy Definition ............................................................423
Modifying a Policy Definition .........................................................................423
Modifying Policy States .................................................................................425
Modifying Signature Requirements ...............................................................427
Deleting a Policy ..................................................................................................429
Version 10 xiii
Hidden Clause...............................................................................................501
Icon Clause ...................................................................................................501
Property Clause ............................................................................................501
Trigger Clause...............................................................................................502
Copying and/or Modifying a Process Definition ...................................................503
Copying (Cloning) a Process Definition ........................................................503
Modifying a Process Definition......................................................................503
Reassigning an Activity to a Group ......................................................................506
Using Links ..........................................................................................................507
Connect Clause.............................................................................................507
Disconnect Clause ........................................................................................507
Transition Conditions ....................................................................................507
Deleting a Process ...............................................................................................509
Validating a Process ............................................................................................510
Version 10 xv
Description Clause ........................................................................................573
File Clause ....................................................................................................573
Mime Clause .................................................................................................574
Icon Clause ...................................................................................................574
Hidden Clause...............................................................................................574
Property Clause ............................................................................................574
Copying (Cloning) a Resource Definition .............................................................575
Modifying a Resource Definition ..........................................................................576
Deleting a Resource ............................................................................................577
Supporting Alternate Languages and Display Formats .......................................578
Version 10 xvii
Chapter 32. Working With Context ........................................................................... 629
Context Defined ...................................................................................................630
Setting Context ....................................................................................................631
Setting Context With Passwords...................................................................631
Setting Context Without Passwords..............................................................632
Setting Context With Disabled Passwords....................................................633
Setting Context Temporarily..........................................................................633
Version 10 xix
Reject Businessobject Statement .................................................................711
Unsign Signature...........................................................................................712
Disable Businessobject Statement................................................................712
Enable Businessobject Statement ................................................................712
Override Businessobject Statement ..............................................................713
Promote Businessobject Statement ..............................................................714
Demote Businessobject Statement ...............................................................714
xx MQL Guide
Maximum, Minimum, Average ......................................................................747
Median ..........................................................................................................747
Standard Deviation .......................................................................................747
Correlation ....................................................................................................748
Deleting a Set ......................................................................................................749
Version 10 xxi
Copying (Cloning) a Filter Definition .............................................................801
Modifying a Filter...........................................................................................801
Deleting a Filter ....................................................................................................803
Version 10 xxiii
xxiv MQL Guide
Part I:
General Functions
1
Introduction to MQL
MQL Defined.................................................................................................... 35
Three Modes: Interactive, Script, and Tcl..................................................... 36
Interactive mode ............................................................................................... 36
Script Mode Advantages................................................................................... 36
Using MQL........................................................................................................ 37
Command Line Editing ..................................................................................... 37
Tcl/Tk Mode ...................................................................................................... 39
Tcl Versions ...................................................................................................... 42
MQL and Tcl ..................................................................................................... 43
Accessing MQL............................................................................................... 44
MQL Command Options ................................................................................... 45
-b Option ........................................................................................................... 45
-c Option ......................................................................................................................................45
-d Option ......................................................................................................................................46
-k Option ......................................................................................................................................46
-t Option .......................................................................................................................................46
-v Option ......................................................................................................................................46
-stdout:FILENAME ...................................................................................................................46
-stdin:FILENAME ......................................................................................................................46
-stderr:FILENAME ....................................................................................................................47
Statements and Scripts.................................................................................. 48
MQL Statements ............................................................................................. 49
Entering (Writing) MQL Statements.................................................................. 49
Reviewing Statements ...................................................................................... 50
Important Matrix Statements............................................................................. 51
Building an MQL Script .................................................................................. 54
Running Scripts and Using Basic MQL Statements ......................................... 54
Using Comments .............................................................................................. 55
Building an Initial Matrix Database ................................................................... 55
Modifying an Existing Database ....................................................................... 57
General Syntax................................................................................................ 58
Add Statement .................................................................................................. 58
Copy Statement ................................................................................................ 58
Modify Statement.............................................................................................. 59
List Statement................................................................................................... 59
List Admintype Statement................................................................................. 60
Print Statement ................................................................................................. 62
Delete Statement .............................................................................................. 63
Help Statement ................................................................................................. 63
Version 10 33
Icon Clause .......................................................................................................64
In Vault Clause ..................................................................................................64
Evaluating Expressions..................................................................................65
Business Object Collection Clause ...................................................................65
Dump Clause ....................................................................................................68
Recordseparator Clause ...................................................................................68
Examples ..........................................................................................................68
Tcl Format Select Output ...............................................................................69
34 MQL Guide
MQL Defined
MQL is the Matrix Query Language. Similar to SQL, MQL consists of a set of statements
that help the administrator set up and test a Matrix database quickly and efficiently.
MQL is primarily a tool for building the Matrix database. You can also use MQL to add
information to the existing database, and extract information.
Version 10 35
Three Modes: Interactive, Script, and Tcl
MQL acts an interpreter for Matrix and can be used in one of three modes:
• Interactive Mode
• Script Mode
• Tool Command Language (Tcl) Mode
Interactive mode When you are using MQL in the interactive mode, you type in one MQL statement at a
time. As each statement is entered, Matrix processes it. This is similar to entering system
commands at your terminal.
MQL is not intended to be an end-user presentation/viewing tool, and as a consequence
there are cases where some non-ASCII character sets (eg.some Japanese characters) will
have characters that do not display properly in certain cases, such as when a history record
is printed to the consol in interactive mode. This is due to low-level handling of the byte
code when attempting to display. However, the data is intact when retrieved in any
programmatic way, such as:
• Retrieving data into a tcl variable: set var sOut [mql print bus T N R select history]
• Retrieving data from a java program via adk calls.
• Writing data into a file: print bus T N R select history output d:/temp/
TNR_History.txt;
The interactive mode is useful if you have only a few commands to enter or want
extensive freedom and flexibility when entering commands. However, interactive mode is
very inefficient if you are building large databases or want to input large amounts of
information. For this reason, Matrix enables you to use MQL in a script mode.
When working in the script (or batch) mode, you use a text editor to build a set of MQL
statements. These statements are contained in an external file, called a script, that can be
sent to the Matrix command interface. A script passes a batch of MQL statements to the
Matrix command interface for processing. The interface then reads the script, line by line,
and processes the statements just as it would in the interactive mode.
Script Mode Working in script mode has many advantages, particularly when you are first building a
Advantages database. Some examples of advantages are:
• You have a written record of all your definitions and assignments. This enables you to
review what you have done and make changes easily while you are testing the
database. When you are first building the database, you may experiment with
different definitions to see which one works best for your application. A written
record saves time and aggravation since you do not have to print definitions when
there is a question.
• You can use text editor features to duplicate and modify similar definitions and
assignments. Rather than entering every statement, you can copy and modify only the
values that must change. This enables you to build large and complicated databases
quickly.
36 MQL Guide
• Testing and debugging the database is simplified. MQL databases can be wiped clean
so that you can resubmit and reprocess scripts. This means that you can maintain
large sections of the MQL statements while easily changing other sections. Rather
than entering statements to modify the database, you can simply edit the script. If you
are dissatisfied with any portion of the built database, you can change that portion of
the script without eliminating the work you did on other portions. (If you were
working interactively, you would have to track what had and had not changed.) Since
the script contains the entire database definition and its assignments, there is no
question as to what was or was not entered.
Using MQL Many MQL statements define structures and objects. When you are first setting up the
Matrix database, you will include these statements in an initial database building script or
collection of scripts.
We recommend that you use MQL scripts as long as you are in the building process.
Later, you may decide to add information and files into Matrix. The process of adding
information may require additional MQL statements. Rather than entering them
interactively, you can create a new script to handle the new modifications.
Using MQL interactively is most practical when you have only a few modifications to
make or tests to perform.
After the database is built, you will most likely maintain it through the Business Modeler
interface. This interface helps you see what you are changing.
When you work with the database interactively, you do not have a written record to help
you retrace what you did. In the interactive mode, the MQL statements are performed
immediately and not recorded. You are left with only the result of the statement. If you are
inserting a large amount of information, it may be cumbersome to track all entries and
modifications. Also, if you decide that it is better to start over again, it would mean losing
everything that was done up to that point.
Command Line Command line editing is available in interactive MQL. MQL maintains a history list of
Editing commands and allow for editing of these commands using the arrow keys and some
control characters.
To edit, use the arrow keys and move your cursor to the point where a change is required.
Insert and delete characters and/or words, as needed.
Version 10 37
Using Control Characters
All editing commands are control characters which are entered by holding the Ctrl or Esc
key while typing another key, as listed in the following table. All editing commands
operate from any place on the line, not just at the beginning of the line.
38 MQL Guide
The MQL Prompts
Interactive MQL has two prompts. The primary prompt is, by default:
MQL<%d>
where %d is replaced with the command number. The secondary prompt is, by default:
>
The secondary prompt is used when a new line has been entered without terminating the
command.
You can change the primary and secondary prompts with the MQL command:
prompt [[PROMPT_1] [PROMPT_2]]
Tcl/Tk Mode With Tcl (tool command language) embedded in MQL, common programming features
such as variables, flow control, condition testing, and procedures are available for use with
Matrix. The Tk toolkit is also included. Tcl and Tk are widely available and documented.
The information in this section is simply an overview of functionality. For more detailed
procedures, consult the references listed in the section For More Information.
Tcl Overview
Tcl is a universal scripting language that offers a component approach to application
development. Its interpreter is a library of C procedures that have been incorporated into
MQL. MQL/Tcl offers the following benefits to Matrix users:
• Rapid development—Compared with toolkits where you program in C (such as the
Motif toolkit), there is less to learn in order to use Tcl and less code to write. In
addition, Tcl is an interpreted language with which you can generate and execute new
scripts on the fly without recompiling or restarting the application. This enables you
to test and fix problems rapidly.
• Platform independence—Tcl was designed to work in a heterogeneous
environment. This means that a Tcl script that was developed under Windows can be
executed on a UNIX platform. After a developer has completed design and testing, a
program object can be created using the code providing Matrix users with immediate
access to the new application. This also solves the problem of a need to distribute new
applications.
• Integration support—Because a Tcl application can include many different library
packages, each of which provides a set of Tcl commands, an MQL/Tcl script can be
used as a communication mechanism to allow different applications to work with
Matrix.
• User convenience—The tcl command has been added to MQL, enabling users to
switch to Tcl mode. In addition, MQL commands can be executed while in Tcl mode
by preceding the correct MQL syntax with mql.
Tcl Functionality
More specifically, Tcl enhances MQL by adding the following functionality:
• Simple text language with enhanced script capabilities such as condition clauses
Version 10 39
• Library package for embedding other application programs
• Simple syntax (similar to sh, C, and Lisp):
Command Output
set a 47 47
• Substitutions:
Command Output
set b $a 47
• Quoting:
Command Output
set b “a is $a” 47
• Procedures
• Access to files, subprocesses
• Exception trapping
Using Tcl
To enter Tcl mode, enter the following in MQL:
tcl;
In Tcl mode, the default Tcl prompt is % and MQL will accept only Tcl commands.
Native MQL commands are accessed from Tcl by prefixing the command with the
keyword mql. For example:
% mql print context;
40 MQL Guide
Otherwise, Tcl command syntax must be followed. It differs from MQL in several ways:
For a description of common Tcl syntax errors, see Tcl Syntax Troubleshooting.
Command line editing is not currently available.
The Tcl command, exit, returns you to native MQL. Like the MQL quit command,
exit can be followed by an integer value which is passed and interpreted as the return
code of the program.
Extra Spaces
One of the most common errors is caused by extra spaces included in a line of Tcl. A
developer may easily miss excess whitespace, but the Tcl compiler examines whitespace
closely. A very obvious occurrence happens during editing, perhaps when two lines are
joined together, and something is deleted. An extra space before the carriage return may
end up on the line of code. This is an error Tcl will catch every time, but it won't report
anything back to the user. A tip to discover this is to write the program to a text file and to
search for all occurrences of a blank space. The syntax for this is:
grep -n "{ $" *.<text_file_name_suffix>
The second common error occurs with extra spaces in an attribute name in an MQL select
statement. For example:
set sClass [ mql print businessobject $sOid select attribute\[Classification \]
dump $cDelimiter ]
Version 10 41
In using the Classification attribute, the developer has unintentionally left an extra space
before the "\" character. The correct form of this query looks like this:
set sClass [ mql print businessobject $sOid select attribute\[Classification\]
dump $cDelimiter ]
To check for this type of problem, the solution is similar to the previous example. First
write all the programs to text files, then search the files for spaces prior to a backslash.
The syntax for searching this is:
grep -n "attribute\\\\\[" *.tcl | grep " \\\\\]"
Matching Braces
Another common error results when the Tcl compiler determines that the number of
begin/end braces does not match. The typical cause for this error is commented-out code
containing braces, which the Tcl compiler includes in its brace count, leading to
unexpected results. For example, the code sequence below looks like it should run
correctly. However, the Tcl compiler will determine that the brace count does not match,
causing problems.
# foreach sUser $lUserList {
foreach sUser $lEmployeeList {
puts $sUser
}
The correct solution is to either comment-out the entire block of code, or to delete it, so
the compiler will generate a correct brace match, for example:
# foreach sUser $lUser {
# puts $sUser
# }
Tcl Versions To determine what version of Tcl you are using, switch to tcl mode then use the info
tclversion or info patchlevel commands:
MQL<1>tcl;
% info tclversion
8.0
Or
% info patchlevel
42 MQL Guide
8.0
The Tk library must be loaded in order to retrieve the Tk version. On Windows, a
command similar to the following should be used:
% load tk42
% info loaded
{tk42 Tk}
MQL and Tcl When Tcl passes an MQL command to MQL, it first breaks the command into separate
arguments. It breaks the command at every space, so you have to be careful to use double
quotes ("") or braces ({}) to enclose any clause which is to be passed along to Matrix as a
single argument.
Parsing of Tcl statements containing backslashes within an MQL program object is
different than when those same statements are run from MQL command prompt.
For example, create a text file with the command lines:
tcl;
set a "one\\two\\three"
puts "a contains $a"
puts "b will use slashes instead of backslashes"
regsub -all {\\} $a {/} b
puts "now b contains $b"
Run this file from MQL (or alternatively type each line in MQL command window). The
final line of output will be:
now b contains one/two/three
This is consistent with how the same lines of code behave in native Tcl.
However if you use this same code as a Matrix MQL program object, to get the same
output you need to use triple rather than double backslashes so your code becomes:
tcl;
set a "one\\\two\\\three"
puts "a contains $a"
puts "b will use slashes instead of backslashes"
regsub -all {\\\} $a {/} b
puts "now b contains $b"
Version 10 43
Accessing MQL
There are several ways to access the MQL from your operating system.
Brackets [ ] indicate optional information. Do not include the brackets when you enter the
command. Braces { } may also appear in a command syntax indicating that the items in
the braces may appear one or more times.
.
mql invokes the MQL interpreter
When your system processes the mql command, the Matrix command interface starts up
in one of two modes: interactive or script. The mode it uses is determined by the presence
of the hyphen and file name(s):
• Interactive mode is used when the command includes the hyphen and/or does not
include a file name(s). For example, to run MQL interactively, enter either:
mql -
Or:
mql
In both of these commands, no files are specified so the interpreter starts up in an
interactive mode to await input from the assigned input device (usually your
terminal).
• Script mode is used if one or more files are listed. Specifying a file indicates that
Matrix should process the script of MQL statements and then return control to the
operating system.
For example, to process two script files, enter a command similar to the following.
mql TestDefinitions.mql TestObjects.mql
This command invokes the MQL interpreter, processes the MQL statements within
the TestDefinitions.mql script, and then processes the statements within the
TestObjects.mql script.
44 MQL Guide
MQL Command In addition to the hyphen and file name qualifiers, several MQL command options are
Options available:
-b Option By default, Matrix reads matrix-r as the bootstrap file. The -b modifier indicates that an
alternate bootstrap file should be used. The bootfile is expected to be in your
MATRIXHOME directory. For example, suppose you have two databases that you
frequently access, a test system (Mx_qtest) and a production system (Mx_production).
You could create two shortcuts on your Windows Start menu. The shortcut for the test
database could be called QAmatrix and contain the following:
c:\matrix\bin\winnt\mql.exe -b Mx_qtest
The shortcut for the production database could be called PRDmatrix and contain the
following:
c:\matrix\bin\winnt\mql.exe -b Mx_production
Generally, there is no need to duplicate or move Matrix .ini files. However, if multiple
files will be opened for view or edit from a database that is not using the standard matrix-r
file, errors will occur.
-c Option The -c option enables you to enter MQL statements from the system command line.
This option specifies that Matrix should process the MQL statements enclosed within the
double quotes.
Version 10 45
For example, the following command assigns new telephone and facsimile numbers to a
defined user (Joe) from the system command line:
mql -c “modify person Joe phone 598-4354 FAX 598-4355;”
You can include more than one MQL statement in the command string. In the syntax
COMMAND; {COMMAND;} you can include as many statements as you want, providing
each statement ends with a semicolon and space and all the MQL statements are enclosed
within the quotes.
-d Option The -d option suppresses MQL window, but not the title information. See also -t
Option.
-k Option An abort-on-error is the default when Matrix reads MQL statements from a script or file.
Matrix aborts when an error is encountered and returns you to your operating system.
However, you may not want a script to terminate when an error is found during
processing. The -k option specifies that Matrix should continue on to the next MQL
statement if an error is detected in an MQL statement. In this case, an error message is
printed when the error is encountered and the script continues to run.
-t Option The -t option suppresses the printing of the opening MQL title. This title identifies the
product name, copyright information, and version number. When you use MQL
frequently, the -t option saves time since the information is not displayed. This also
suppresses the display of the MQL window. See also -d Option.
-v Option The -v option specifies that Matrix should work in verbose mode. In this mode, Matrix
will print all messages generated during startup and the processing of statements. If you do
not need this level of detail, you still receive error messages and other important MQL
messages without the -v option.
-stdout:FILENAME By default, MQL output is displayed in the MQL window. On the PC, use the -stdout
option to redirect the MQL command output to a file. FILENAME is the name of the file
which will contain the MQL output.
Matrix on UNIX uses the UNIX standard file descriptors. You can use the standard UNIX
redirection techniques to redirect MQL output to files.
-stdin:FILENAME On the PC, use the -stdin option to read MQL input from a file. FILENAME is the
name of the file from which the data is read.
Matrix on UNIX uses the UNIX standard file descriptors.
46 MQL Guide
-stderr:FILENAME By default, MQL error messages are displayed in the MQL window. On the PC, use the
-stderr option to redirect MQL error messages to a file. FILENAME is the name of
the file that will contain the error messages.
Matrix on UNIX uses the UNIX standard file descriptors. You can use the standard UNIX
redirection techniques to redirect MQL output to files.
Version 10 47
Statements and Scripts
An MQL command is called a statement. All statements perform an action within Matrix.
For example, actions might define new structures within the database, manipulate the
existing structures, or insert or modify data associated with the database structures.
An MQL script is an external file that contains MQL statements (see the example below).
You can create this file using any text editor. After you insert all the desired MQL
statements, you can batch process the statements by specifying the name of the script file
in the mql command.
###########################################################
# Script file: SampleScript.mql
# These MQL statements define a vault and create an object.
###########################################################
verbose on;
#
# Set context to Matrix System Administrator’s and define a new vault.
#
set context dba;
add vault "Electrical Parts";
output "Electrical Parts vault has been added"
#
# Set context to that of person Steve in vault "Electrical Subassemblies"
#
set context vault "Electrical Subassemblies" user Steve;
#
# Add a business object of type Drawing with name C234 A3
# and revision 0 and check in the file drawing.cad
#
output "now adding a business object for Steve";
add businessobject Drawing "C234 A3" 0
policy Drawing
description "Drawing of motor for Vehicle V7";
checkin businessobject Drawing "C234 A3" 0 drawing.cad;
#
quit;
48 MQL Guide
MQL Statements
An MQL statement consists of a keyword and, optionally, clauses and values. MQL
statements follow their own set of rules and conventions, as in any other programming or
system language. In the following sections, you will learn about the conventions used in
this book for entering, as well as reviewing, displayed MQL statements.
Entering (Writing) You must follow a fixed set of syntax rules in order for Matrix to interpret the statement
MQL Statements correctly. If you do not, Matrix may simply wait until the required information is provided
or display an error message.
When in interactive mode, each statement is prompted by:
mql<#>
The syntax rules are summarized in the following table. If you have a question about the
interpretation of a statement, see the chapter on working with that MQL category (refer to
the table of contents).
Version 10 49
Writing and Entering Matrix Statements
Clauses Statements may or may not contain clauses.
All clauses begin with a keyword.
All clauses are separated with a space, tab, or a carriage return.
The following example is a statement with two clauses separated by both
carriage returns and indented spaces.
add attribute “Ship’s Size”
description “Ship size in metric tons”
type integer;
Values Multiple values are separated within clauses by a comma (,). Values may be
single or, if the keyword accepts a list of values, they can be specified either
separately or in a list. For example:
attribute Size, Length
Or:
attribute Size
attribute Length
Comments All comments begin with a pound sign (#) and end with a carriage return. For
example:
# list users defined within the database
All comments are ignored by Matrix and are used for your information only.
In the chapters that follow, you will learn more about the keywords, clauses, and values
that make up MQL statements.
Reviewing When statements are displayed on your screen, the statements are displayed in diagrams
Statements which obey a set of syntax rules. These rules are summarized in the following table:
50 MQL Guide
Reviewing Displayed Matrix Statements
keywords All keywords are shown in lowercase. These words are required by MQL to correctly process the
statement or clause. Though they are displayed in all lowercase in the syntax diagram, you can enter them
in Matrix as a mixture of uppercase and lowercase characters.
All keywords can be abbreviated providing they remain distinctive. For example, you can use bus for
businessobject.
Values User-defined values are shown in uppercase. The words in the syntax diagram identify the type of value
expected. When entering a value, it must obey these rules:
1. You can enter values in uppercase or lowercase. However, values are case-sensitive. Once you
enter the case, later references must match the case you used.
For example, if you defined the value as Size, the following values would not match: SIZE,
size, sIZE.
2. You must enclose a value in double (" ") or single (' ') quotes if it includes spaces, tabs,
carriage returns (new lines), commas, semicolons (;), or pound signs (#).
A space is included in the following examples, so the values are enclosed in quotes:
"Project Size"
'Contract Terms'
3. If you need to use an apostrophe within a value, enclose the value in quotes. For example:
"Project’s Size"
4. If you need to use quotes within a value, enclose the value in single quotes. For example:
'Contract "A" Terms'
[option] Optional items are contained within square brackets [ ]. You are not required to enter the clause or value
if you do not need it.
Do not include the brackets when you are entering an option.
{option} All items contained within braces { } can appear zero or more times.
Do not include the braces when you are entering an option.
|option1| All items shown stacked between vertical lines are options of which you must choose one.
|option2|
|option3|
Important Matrix When you first use MQL, there are two important MQL statements you should know: Quit
Statements and Help.
Quit
The quit statement exits the Matrix command interface and returns control to the operating
system. To terminate your MQL session, simply enter:
quit;mql<#>
As you can see, this statement follows the MQL rules of syntax. The keyword quit is
followed by a semicolon.
Version 10 51
When writing the code for program objects, it is sometimes necessary for the program to
return an integer value to the system that ran the program. For this reason, the quit
statement can be followed by an integer, as follows:
quit [INTEGER];
Help
The help statement is available for various MQL statement categories. If you do not know
which category you want or you want to get a listing of the entire contents of the help file,
enter:
help all;
The help all statement prints the entire help file on your output device.
Eventually, you will probably want help only on a selected MQL category:
association attribute businessobject
wizard workflow
52 MQL Guide
When you enter this statement, Matrix displays a list of all the statements associated with
the category along with the valid syntax. For example, assume you entered the following
statement:
help context;
print context;
This information indicates that there are two statements associated with the context
category: the set context and print context statements.
The first statement has three clauses associated with it: the person, password, and
vault clauses. The square brackets ([ ]) on either side of PASSWORD_VALUE mean
that it is optional. If a clause is used, you must obey the syntax of the clause. In the
person clause, the syntax indicates that a value for PERSON_NAME is required. Words
shown in all uppercase indicate user-defined values. (Refer to Entering (Writing) MQL
Statements for a complete description of syntax rules.)
Version 10 53
Building an MQL Script
Scripts are useful when you are performing many changes to the Matrix database. This is
certainly true in the initial building process and it can be true when you are adding a
number of old files or blocks of users into an existing database. MQL scripts provide a
written record that you can review. Using a text editor makes it easy to duplicate similar
blocks of definitions or modifications.
Running Scripts When you are building a script, there are several MQL statements that help run other
and Using Basic scripts and let you monitor the processing of the script MQL statements.
MQL Statements
For example, if you are processing large blocks of statements, you may want to
precede or end each block with an Output statement. This enables you to monitor
the progress of the script.
password PASSWORD; The Password statement enables you to change the current context password.
The Password statement enables you to change your own password (which can
also be done with the Context statement).
run FILE_NAME [continue]; The Run statement enables you to run a script file. This is useful if you are
working in interactive mode and want to run a script.
The continue keyword allows the script to run without stopping when an error
occurs. This is essentially the same as running MQL with the -k option, but it is
available at run time, making it usable by programs.
shell COMMAND; The Shell statement enables you to execute a command in the operating system.
For example, you can perform an action such as automatically sending an
announcement to a manager after a set of changes are made.
The Output statement (see above) sends a message to your output device; but, it
cannot send a message to a different device. You can do so with the Shell
statement.
verbose [on|off]; The Verbose statement enables you to increase or decrease the amount of message
detail generated by the MQL interpreter as the script is processed. This is similar
to the -v Option.
When set to ON, more detail is provided. When set to OFF, only errors and
important system messages are displayed.
version; The Version statement enables you to see which version of MQL you are using.
For example, this is useful if you want a record of the version used to process a
script.
54 MQL Guide
Using Comments Comments visually divide scripts into manageable sections and remind you of why
structures and objects were defined and modified. Comments, which are preceded in the
script by a pound sign (#), are ignored by MQL:
# script comments
Building an Initial Building a Matrix database usually involves writing two scripts. One script will contain all
Matrix Database the definitions used by the database. The second script creates business objects, associates
files with the objects, and defines relationships between objects.
By separating these two steps, it is easier to test the database. You cannot create business
objects or manipulate them until the definitions are in place. By first creating and testing
all the definitions, you can see if the database is ready to add objects. You may want to
alter the definitions based on test objects and then use the altered definitions for
processing the bulk of the object-related data.
To assist you in building and testing new vaults, Matrix provides the Clear Vault
statement. This statement ensures that the vault does not contain any business objects. It
can be run by a person with System Administrator privileges.
clear vault VAULT_NAME;
The clear vault or clear all statements should NEVER be used while users are
on-line.
Version 10 55
Creating Definitions in a Specific Order
When creating the script of definitions for the initial database, the order in which you
make the definitions is significant. Some statements are dependent on previous
definitions. For example, you cannot assign a person to a group if that group does not
already exist. For this reason, it is recommended that you write your definition statements
in the following order:
Definition Order
1 Roles You can define roles, groups, and persons either way
Groups depending on your application. Since associations are
Persons combinations of groups and roles, they must be created
Associations after groups and roles are defined.
Or:
Persons
Groups
Roles
Associations
2 Attributes Order is important for this set of definitions. For example,
Types types use attributes, so attributes must be defined before
Relationships types.
Formats
Stores
Policies
3 Vaults Vaults can be defined at any time although they are most
commonly defined last.
4 Reports If reports or forms are required, they are usually defined
Forms after the database is built and tested. These definitions
require workable values for reporting. If there are no
values to report, it is difficult to define and test.
56 MQL Guide
Modifying an After you define the initial Matrix database, you may want to modify it to add additional
Existing Database users and business objects. If the number of users or the amount of information is large,
you should consider writing a MQL script. This enables you to use a text editor for editing
convenience and provides a written record of all of the MQL statements that were
processed.
Often when you are adding new business objects, you will define new vaults to contain
them. This modular approach makes it easier to build and test. While some new
definitions may be required, it is possible that you will use many of the existing
definitions. This usually means that the bulk of the modification script will involve
defining objects, manipulating them, and assigning relationships. These actions are done
within the context of the vault in which the objects are placed.
To assist you in building and testing new vaults, Matrix provides the Clear Vault
statement. This statement ensures that the vault does not contain any business objects. See
Clearing the Database for details.
When writing your script for modifying an existing database, remember to include
comments, occasional output statements, and a Quit statement at the end (unless you’ll
want to use the interactive MQL interpreter after script completion).
Version 10 57
General Syntax
The remainder of this chapter presents the syntax for statements that are common to many
MQL features (items such as Vault, Person, Group, etc.).
Add Statement The Add statement will create an instance of an item. The Add statement generally has
many clauses and, in some cases, subclauses specific to each item. Syntax:
add ITEM ITEM_NAME [ADD_ITEM {ADD_ITEM}];
* slightly different syntax depending on the item. Refer to the specific item chapter for
details.
ITEM_NAME is a unique name for that kind of item.
ADD_ITEMs are applicable fields for each item with defined values. Refer to the specific
item chapters for more information.
Copy Statement The Copy statement will clone a definition, rename it, and make the specified
modifications. Syntax:
copy ITEM SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
58 MQL Guide
* slightly different syntax:
copy bus NAME to NEWNAME [Rev] [Vault]
Modify Statement The Modify statement will make the specified changes to an existing definition.
modify ITEM NAME [MOD_ITEM {MOD_ITEM}];
* slightly different syntax depending on the item. Refer to the specific item chapter for
details.
NAME is a unique name for that kind of item.
MOD_ITEMs are applicable fields for each item with new values. Refer to the specific
item chapters for more information.
List Statement The List statement is used to display all instances of an item that are currently defined. It is
useful for confirming the existence or exact name of an item since Matrix is
case-sensitive.
list ITEM;
Version 10 59
form page report system workflow
table toolset
List Admintype The List statement is used to display all instances of an administrative type that are
Statement currently defined. The List Admintype statement allows wildcards, lists and select clauses.
The full syntax of the List Admintype command is:
list ADMINTYPE [modified after DATE | NAME_PATTERN] [SELECT]
[DUMP [RECORDSEP]] [tcl] [output FILENAME];
DATE must be in the format specified in .ini file. You cannot include a
NAME_PATTERN when using modified after clause.
NAME_PATTERN can be a single name or a comma-delimited list of expressions that can
include wildcard characters. You cannot include a modified after DATE clause when
using NAME_PATTERN.
SELECT specifies a subset of the list contents.
DUMP allows you to insert formatting data into the printed information.
RECORD_SEP specifies a separator character for the output in the case of multiple
objects.
tcl returns the results in Tcl list format.
FILENAME identifies a file where the print output is to be stored.
Each of these clauses is explained in detail in the sections that follow.
Name Pattern
NAME_PATTERN can be a comma-delimited list of expressions that can include the
wildcard characters ‘*’ or ‘?’, where * matches any string of characters, and ? matches any
single character. For example, if this command:
list person a*
produces this list: abadi,abami,adadi,adami,adams,apkarian,ata
60 MQL Guide
then:
Command Produces:
list person a?ami adami,abami
list person ada?i adami,adadi
list person a*i adami,adadi,abami,abadi,atai
list person ad*,a*n adami,adams,apkarian,adadi
Select Clause
The Select clause of the List Admintype statement lets you specify a subset of the list
content. For example, this command:
list attribute modified after DATE;
uses the modified selectable clause for the attribute admin type. The result would be a
list of all attributes modified after the date specified. The DATE must follow the format
specified in the initialization file.
For a list of all the selectable fields for each type of administrative object, see the Select
Expressions appendix in the Matrix Navigator Guide.
Dump Clause
You can specify a general output format with the Dump clause. The Dump clause
specifies that you do not want to print the leading field names. You can also specify which
character you want to use to separate the field names in the output:
dump [”SEPARATOR_STR”]
SEPARATOR_STR is a character or character string that you want to appear between the
field values. It can be a tab, comma, semicolon, carriage return, etc. If you do not specify a
separator string value, the default value of a comma is used. If tabs or carriage returns are
used, they must be enclosed in double quotes (“ ”).
When using the Dump clause, all the field values are printed on a single line unless a
carriage return is the separator string.
For example, assume you entered the following statement:
list type Sales* select name description format dump;
Version 10 61
Record_Sep Clause
The Record_Sep clause of the List Admintype statement allows you to define which
character or character string you want to appear between the dumped output of each object
when the List command requests information about multiple objects.
recordseparator [”SEPARATOR_STR”]
Tcl Clause
Use the Tcl clause after the dump clause, if used, and before the output clause to return the
results in Tcl list format. This facilitates the parsing of output from MQL select commands
within Tcl code since the built-in list handling features of Tcl are used directly on the
results. For more information, see Tcl Format Select Output.
Output Clause
The Output clause of the List Admintype statement provides the full file specification and
path to be used for storing the output of the List statement. For example, to store
information in an external file called sales.txt, you might write a statement similar to:
list type Sales* select name description format dump
output c:\mydocs\sales.txt.
Print Statement The Print statement prints the item definition to the screen allowing you to view it. When
a Print statement is entered, MQL displays the various clauses that make up the definition.
print ITEM NAME;
62 MQL Guide
cue menu report tip
Delete Statement The Delete statement enables you to delete an item when it is no longer needed in the
Matrix environment. Because deleting certain items can affect other elements of Matrix,
use it carefully. See the Delete section of each item chapter for a discussion of the impact
of the deletion.
delete ITEM NAME;
format person
Help Statement The Help statement is always available while you are in the MQL interactive mode. Help
statements produce a summary of all statements applicable to the item with the
appropriate syntax.
help ITEM;
Version 10 63
Icon Clause The Icon clause often is available in a statement. It associates a special image with an
item. For example, you may want to use a company logo for a Vault that contains objects
related to doing business with that company. You could use a project logo for a project
oriented Vault, or an object icon (such as a tax form) for the Vault containing those type of
objects.
The GIF file needs to be accessible only during the definition using the Vault clause. Once
an accessible file in the correct image type is used in the Vault clause, Matrix will read the
image and store it with the vault definition in the database. The physical icon files do not
have to be accessible for every Matrix session. (If the file is not accessible during
definition, Matrix will be unable to display the image.)
To write an Icon clause, you need the full directory path to the icon you are assigning. For
example, the following statement assigns a calendar icon to the 1999 Records Vault:
add vault “1999 Records”
icon $MATRIXHOME/pixmaps/app/calendar1999.gif;
You can set Matrix Navigator to view images with the View menu options or
Session>Preferences options.
The Icon clause of a definition statement is optional unless there is a need to distinguish
icons. If you do not specify an icon, a default is used (such as type.gif for type
definitions). When the default icon is desired, it should not be explicitly defined since
doing so would affect performance. For example, if the default for Type A is used and
Type B specifies the use of type.gif, two copies of the same file (type.gif) are read
and processed each time these types are displayed. If only the default is used, the same
information is processed once and displayed for all type icons.
Icons can be checked out of the objects that contain them. For syntax, see Retrieving the
Image in Chapter 35 and the Icon section of Working With Users in Chapter 11.
In Vault Clause When specifying business objects in MQL statements, the in vault clause is generally
available. This clause improves the performance of such transactions as modify, delete,
and connect, since it is no longer necessary to search all vaults to find the object to act
upon. This is particularly true in a distributed or loosely-coupled database.
64 MQL Guide
Evaluating Expressions
EXPRESSION is an expression.
ON_ITEM can be any of the following:
relationship ID
businessobject TYPE NAME REV
BUS_OBJ_COLLECTION_SPEC [{and | or | less} BUS_OBJ_COLLECTION_SPEC] ...
The dump and recordseparator clauses can occur anywhere in the command, but
the EXPRESSIONs must be given before any ON_ITEMs.
This command outputs the result of evaluating each expression for each ON_ITEM one
after the other.
• The dump separator character (a comma, by default) separates each value for a single
ON_ITEM.
• The recordseparator character (a new line, by default) separates the results of one
ON_ITEM from the next.
Note that ‘+’ and ‘-’ cannot be used for the words ‘or’ and ‘less.’
Version 10 65
temp query [TEMP_QUERY_ITEM {TEMP_QUERY_ITEM }]
expand [EXPAND_ITEM {EXPAND_ITEM}]
[( {( }]BUS_OBJ_COLLECTION_SPEC [ ){ )}]
OBJECTID is the OID or Type Name Revision of the business object. It can also include
the in VAULTNAME clause, to narrow down the search.
The values of TEMP_QUERY_ITEM have the same meaning in this context as they have
for the temp query command, as described in Defining a Saved Query in Chapter 39.
EXPAND_ITEM is one of:
from
to
type PATTERN {,PATTERN}
relationship PATTERN {,PATTERN}
select businessobject
select relationship
where WHERE_CLAUSE
activefilters
reversefilters
filter PATTERN
view NAME
recurse
recurse to N
recurse to all
The values of EXPAND_ITEM have the same meaning in this context as they have for the
expand bus command, as described in Displaying and Searching Business Object
Connections in Chapter 36. (In the case of “select,” it indicates whether a subsequent
‘where clause’ applies to business objects or to relationships. In expand bus it has an
additional meaning that is not applicable here.)
For example, the output from evaluating two expressions, E1 and E2, on two sets, A and
B, with values V1A, V2A, V1B, and V2B would look like the following (using default
separators):
V1A,V2A
V1B,V2B
66 MQL Guide
Business Object Collection Specs can be linked with binary operators, which follow
simple, intuitive rules:
• and—an object is in both collections
• or—an object is in one or the other collection
• less—an object is in the result if it is in the left-hand collection but not the right-hand
one.
If there is more than one binary operator in a BUS_OBJECT_COLLECTION_SPEC,
parentheses must be used to disambiguate the clause. (There is no implied order of
operations.) You must include a space before and after each parenthesis. In addition, the
number of left and right parentheses must match each other. For example:
( set A + set B ) - set C
would probably evaluate differently than:
set A + ( set B - set C )
Examples
This list of examples shows the power of the BUS_OBJECT_COLLECTION_SPEC
concept.
The following statement returns the number of objects in the set Projects:
eval expression "count TRUE" on set Projects;
The same thing could be written as follows (note the spaces around the parentheses):
eval expression "count TRUE" on ( set Projects );
The following statement returns the number of objects returned by a query named “ask1”
that are not Project 1029 0:
eval expression "count TRUE" on query ask 1 less temp set Project 1029 0;
The following statement returns the number of Jim’s open Projects that originated before
the beginning of this year:
eval expression "count TRUE" on temp query bus Project * * owner Jim where "originated
< ’1/1/99’ and current == open";
The following statement returns the number of open, new Projects that do not belong to
Jim:
eval expression "count TRUE" on ( set openprojects AND set newprojects ) less temp
query bus Project * * owner Jim;
The following statement returns the number of Projects that are either owned by Jim or
included in the set “Q4 Projects”;
eval expression "count TRUE" on ( temp query bus Projects * * owner Jim ) OR set "Q4
Projects";
Version 10 67
Dump Clause You can specify a general output format for listing the information for output. The syntax
is:
dump "SEPARATOR_STR"
Recordseparator The Recordseparator clause of the Evaluate Expression statement allows you to define
Clause which character or character string you want to appear between the output of each
ON_ITEM.
recordseparator “SEPARATOR_STR”
Examples The following example combines several of the capabilities available for expressions. It
shows how to obtain the average and total number of days spent to move a feature from
Open to Test for v7.0 and v7.1 through one MQL command. We divide by (3600 * 24)
(the number of seconds in a day) because we want the number of days and the difference
of two dates is given in seconds
evaluate expression "(average (state[Test].actual - state[Open].actual) )/ (3600 * 24)"
"( sum (state[Test].actual - state[Open].actual) ) / (3600 * 24)"
on expand Product XYZ v7.0 to relationship Committed, Candidate, Proposed type Feature
where "current == Test or current == Closed"
on expand Product XYZ v7.1 to relationship Committed, Candidate, Proposed type Feature
where "current == Test or current == Closed"
dump "|";
The next example calculates the number of Features connected to v7.2 that have been
promoted to Test in the past week (and have not been demoted).
evaluate expression "count (( MX_CURRENT_TIME - state[Test].actual ) / (3600 * 24) < 7)"
on expand XYZ 7.2 to relationship Committed, Candidate, Proposed type Feature
where "current == Test or current == Closed"
dump "|";
68 MQL Guide
Tcl Format Select Output
MQL print, list, expand, and temp query commands that include selects accept
an optional tcl clause to signal that results should be returned in Tcl list format. This
facilitates the parsing of output from MQL select commands within Tcl code since the
built-in list handling features of Tcl are used directly on the results.
Additionally, logic has been added that guarantees an entry in the results list for every
given legal select item. This “padding” ensures that when the Tcl clause is included, the
results list can be parsed properly. If illegal select items are given, there are no
corresponding entries in the results list. Commands that don’t include the Tcl clause
output as before; that is without this “padding.”
Since the Tcl list structure is already curly brace delimited, any given separator characters
(specified with the dump or recordseparator clauses) are ignored when generating
Tcl output. However, for readability, newlines are used as record separators between
objects. For instance, in an expand bus command that includes selects and the Tcl
clause, all selected items for one object are included on one line, and a new line is started
for each connected object. Newlines are considered simple whitespace by Tcl, and so
cause no parsing problems.
To avoid issues with Tcl list operations, the three special characters ‘{’, ‘}’, and ‘\’ are
escaped by the ‘\’ character wherever they occur in text appearing between curly braces.
Output Format
The output from each Tcl select command is consistent with the expected MQL output,
except that is uses Tcl list format. The results for each object are wrapped in a list, even
Version 10 69
when one object is returned, as is the case with the print command. Within each object
record is a header section followed by a sequence of select result items, like so:
{ object1-header-data select-result-items }
{ object2-header-data select-result-items }
:
Header Data
The format of the header data depends on the actual command.
• Print, List, and Temporary Query Commands
business object:{business object} {TYPE} {NAME} {REV}
connection object:{connection} {ID}
administration:{TYPE} {NAME}
set: no set header - each member uses:{member business object} {TYPE}
{NAME} {REV}
• Expand Command
{LEVEL} {REL_NAME} {FROM/TO} {TYPE} {NAME} {REV}
Some commands (like “expand”) require a RECORDSEP to be included after the “dump”
keyword. When used with the Tcl clause, this character is still required, but it is ignored.
Output Examples
1. Simple print business object with Tcl clause.
MQL<2>print bus Assembly SA-300356 0 select id owner
locker tcl;
{business object} {Assembly} {SA-300356} {0} {{id} {{id}
{20083.46775.20193.6352}}} {{owner} {{owner} {Joe
Product-Manager}}} {{locker} {{locker} {bucknam}}}
It may appear that there is some redundancy in the output in the select-result-items
section. The first occurrence of an item (for example owner, above) matches the given
select item and is followed by name/value pairs that resulted from the select item. Often
the name field is redundant. However, when the select item results in many returned items
(for example attribute.value or from.id) the name field gives added details. Refer to
example 3 below.
70 MQL Guide
{{20083.46775.20193.6352}} {{Joe Product-Manager}}
{{bucknam}}
3. Print a business object with a select that returns multiple items:
MQL<4>print bus Assembly SA-300356 0 select from.id tcl;
{business object} {Assembly} {SA-300356} {0} {{from.id}
{{from[Documentation].id} {20083.46775.30402.24363}}
{{from[Analysis].id} {20083.46775.30631.62767}} {{
from[Analysis].id} {20083.46775.30631.41948}}
{{from[Plan].id} {20083.46775.30632.60059}}
{{from[Required Tools].id} {20083.46775.30639.24886}}
{{from[BOM-As Designed].id} {20083.46775.30663.9546}}
{{from[BOM-As Designed].id} {20083.46775.6577.56182}}}
4. Same print of multiple items with the dump clause, eliminating headers:
MQL<5>print bus Assembly SA-300356 0 select from.id dump tcl;
{{20083.46775.30402.24363} {20083.46775.30631.62767}
{20083.46775.30631.41948} {20083.46775.30632.60059}
{20083.46775.30639.24886} {20083.46775.30663.9546}
{20083.46775.6577.56182}}
5. Temporary query with simple select in Tcl list output (with newline between object
records):
MQL<6>temp query bus Assembly SA* 0 limit 5 select id
locker tcl;
{businessobject} {Assembly} {SA-300.125} {0} {{id} {{id}
{20083.46775.31292.44899}}} {{locker} {{locker} {}}}
{businessobject} {Assembly} {SA-300127} {0} {{id} {{id}
{20083.46775.20133.58276}}} {{locker} {{locker}
{bucknam}}}
{businessobject} {Assembly} {SA-300195} {0} {{id} {{id}
{20083.46775.20117.54372}}} {{locker} {{locker}
{bucknam}}}
{businessobject} {Assembly} {SA-300315} {0} {{id} {{id}
{20083.46775.20173.48444}}} {{locker} {{locker} {}}}
{businessobject} {Assembly} {SA-300356} {0} {{id} {{id}
{20083.46775.20193.6352}}} {{locker} {{locker}
{bucknam}}}
6. Same temp query with dump clause:
MQL<7>temp query bus Assembly SA* 0 limit 5 select id
locker dump tcl;
{Assembly} {SA-300.125} {0} {{20083.46775.31292.44899}}
{{}}
{Assembly} {SA-300127} {0} {{20083.46775.20133.58276}}
{{bucknam}}
{Assembly} {SA-300195} {0} {{20083.46775.20117.54372}}
{{bucknam}}
{Assembly} {SA-300315} {0} {{20083.46775.20173.48444}}
{{}}
Version 10 71
{Assembly} {SA-300356} {0} {{20083.46775.20193.6352}}
{{bucknam}}
7. Temp query selecting attributes and their values:
MQL<8>temp query bus * * * limit 1 select current revision
attribute.value tcl;
{businessobject} {NC Program} {GH02456} {A} {{current}
{{current} {Planned}}} {{revision} {{revision} {A}}}
{{attribute.value} {{attribute[MachineType].value}
{Machine Center}} {{attribute[Process Type].value}
{Unknown}} {{attribute[Written By].value} {}}
{{attribute[File Suffix].value} {.TAP}}}
8. Same temp query with dump clause:
MQL<9>temp query bus * * * limit 1 select current revision
attribute.value dump tcl;
{NC Program} {GH02456} {A} {{Planned}} {{A}} {{Machine
Center} {Unknown} {}{.TAP}}
9. Expand set with newlines for each object:
MQL<10>expand set "A1 - To Do" limit 5 select bus id tcl;
{1} {Documentation} {to} {Drawing} {SA-300356} {A} {{id}
{{id} {20083.46775.30402.28967}}}
{1} {Analysis} {to} {Cost Analysis} {DA-3001356-1} {A}
{{id} {{id} {20083.46775.65320.27011}}}
{1} {Analysis} {to} {Design Analysis} {DA-3001356-1} {C}
{{id} {{id} {20083.46775.26552.19182}}}
{1} {Plan} {to} {Assembly Process Plan} {SA-300356} {0}
{{id} {{id} {20083.46775.62627.22040}}}
{1} {Required Tools} {to} {Setup Instructions}
{SA-300356} {A} {{id} {{id} {20083.46775.17589.27146}}}
10. Same expand set with dump clause:
MQL<11>expand set "A1 - To Do" limit 5 select bus id dump
: tcl;
{1} {Documentation} {to} {Drawing} {SA-300356} {A}
{{20083.46775.30402.28967}}
{1} {Analysis} {to} {Cost Analysis} {DA-3001356-1} {A}
{{20083.46775.65320.27011}}
{1} {Analysis} {to} {Design Analysis} {DA-3001356-1} {C}
{{20083.46775.26552.19182}}
{1} {Plan} {to} {Assembly Process Plan} {SA-300356} {0}
{{20083.46775.62627.22040}}
{1} {Required Tools} {to} {Setup Instructions}
{SA-300356} {A} {{20083.46775.17589.27146}}
11. Expand bus with dump clause but no RECORDSEP:
MQL<12>expand bus Vehicle M60000 0 from recurse to 1 select rel id dump tcl;
1tclDOCUMENTATIONtcltotclManualtclM60001tcl0tcl974.54590.
24670.436
72 MQL Guide
1tclDesigned Part QuantitytcltotclFront
AxletclM66000tcl0tcl974.54590.42602.58431
12. A typical Tcl program might look like:
set output [mql expand set "A1 - To Do" select bus id dump
: tcl]
set count [llength $output]
foreach row $output {
set level [lindex $row 0]
set relation [lindex $row 1]
set tofrom [lindex $row 2]
set busobj [lrange $row 3 5]
set busid [join [lindex $row 6]]
puts “\[level: $level\] relationship\[$relation\]
$tofrom $busid”
}
With results similar to:
[level: 1] relationship[Documentation] to
20083.46775.30402.28967
[level: 1] relationship[Analysis] to
20083.46775.65320.27011
[level: 1] relationship[Analysis] to
20083.46775.26552.19182
[level: 1] relationship[Plan] to 20083.46775.62627.22040
[level: 1] relationship[Required Tools] to
20083.46775.17589.27146
[level: 1] relationship[BOM-As Designed] to
20083.46775.30337.38798
[level: 1] relationship[BOM-As Designed] to
20083.46775.29481.42882
[level: 1] relationship[Product Spec to BOM] from
20083.46775.32142.28396
:
Version 10 73
74 MQL Guide
2
Working With Transactions
Implicit and Explicit Transactions................................................................. 76
Implicit Transactions ......................................................................................... 76
Explicit Transaction Control .............................................................................. 76
Working With Threads.................................................................................... 79
Start Thread Command .................................................................................... 79
Resume Thread Command .............................................................................. 79
Print Thread Command .................................................................................... 79
Kill Thread Command ....................................................................................... 79
Version 10 75
Implicit and Explicit Transactions
A transaction involves accessing the database or producing a change in the database. All
MQL statements involve transactions.
Implicit When you enter an MQL statement, the transaction is started and, if the statement is valid,
Transactions the transaction is committed (completed). For example, assume you enter the following
MQL statement:
add person Debbie;
As soon as you enter the statement, Matrix starts the transaction to define a person named
Debbie. If that person is already defined, the statement is invalid and the transaction
aborts—the statement is not processed and the database remains unchanged. If the person
is not already defined, Matrix is committed to (the completion of) the transaction of
adding a new person. Once a transaction is committed, the statement is fully processed
and it cannot be undone. In this case, Debbie would be added to the database.
Ordinarily, starting, committing, and aborting transactions is handled implicitly with every
MQL statement. Each statement has two implied boundaries: the starting keyword at the
beginning of the statement and the semicolon or double carriage return at the end. When
you enter an MQL statement, a transaction is implicitly started at the keyword and is either
committed or aborted depending on whether the content of the statement is valid.
This implicit transaction control can also be performed explicitly.
Explicit Several MQL statements enable you to explicitly start, abort, and commit transactions:
Transaction abort transaction [NAME];
Control
commit transaction;
print transaction;
start transaction [read];
set transaction wait|nowait|savepoint [NAME];
These statements enable you to extend the transaction boundaries to include more than
one MQL statement. If you are starting a transaction, use the read option if you are only
reading. Without any argument, the start transaction command allows reading
and modifying the database.
76 MQL Guide
will lose all your changes. Also, the longer you wait before committing changes, the more
likely you are to encounter an error message, particularly if you are entering the
statements interactively when typing errors are common.
Let’s look at an example in which you want to create a set of business objects and then
associate a collection of files with those objects. You might successfully create the objects
and then discover that you cannot place the files in them. With normal script or interactive
MQL processing, the objects are created even though the checkin fails. By altering the
transaction boundaries, you can tie the successful processing of the files to the creation of
the business objects to contain them. For example:
start transaction update;
add businessobject Drawing “C234 A3” 0
policy Drawing
description “Drawing of motor for Vehicle V7”;
checkin businessobject Drawing “C234 A3” 0 V7-234.MTR;
add businessobject Drawing ”C234a A3” 0
policy Drawing
description “Drawing of alt. motor for Vehicle V7”;
checkin businessobject Drawing ”C234a A3” 0 V7-234a.MTR;
commit transaction;
This transaction is started and the current state of the database is saved. The add
businessobject statements create business objects, and the checkin
businessobject statements add the files.
When the commit transaction statement is processed, MQL examines all the
statements that it processed since the start transaction statement. If no error
messages are detected, all changes made by the statements are permanently made to the
database.
If ANY errors are detected, NONE of the changes are committed. Instead, Matrix returns
the database to the recorded state it was in at the start of the transaction. This essentially
gives you an all or nothing situation in the processing of MQL statements. However,
savepoints can be set in the transaction to be used in conjunction with the abort
transaction statement, which can save some of the work already done.
The set transaction savepoint [NAME] statement allows you to set a point
within a transaction that will be used for any required rollbacks. If you specify the NAME
in an abort transaction command, the transaction is rolled back to the state where
the savepoint was created. If no name is specified, the entire transaction is rolled back. Of
course the transaction must still be committed before the statements between the start
transaction and the savepoint are processed.
Since DB2 does not support nested transaction savepoints, nested savepoints cannot be
used in MQL transactions on DB2. An attempt to nest savepoints will result in a DB2
error stating that nested savepoints are unsupported.
The wait and nowait arguments are used to tell the system if you want to queue up for
locked objects or not. When nowait is used, an error is generated if a requested object is
in use. The default is to wait; the wait keyword is a toggle.
The Oracle SQL nowait function is not supported in DB2. Therefore in DB2, the
nowait argument is ignored.
Version 10 77
One advantage to using the transaction commands to process statement blocks involves
the processing time. Statements processed within extended transaction boundaries are
processed more quickly than the normal statement transactions.
If you choose to process blocks of MQL statements within explicit transaction boundaries,
you need to carefully consider the size and scope of the statements within that transaction.
When you access anything with an MQL statement, that resource is locked until the
transaction is completed. Therefore, the more statements you include within the
transaction boundaries, the more resources that will be locked. Since a locked resource
cannot be accessed by any other user, this can create problems if the resource is locked at
a time when heavy use is normal. The use of large transactions may also require you to
adjust the size of your Oracle rollback segments. See your Oracle documentation for more
details.
You should immediately attend to an explicit transaction that either has errored or is
awaiting a commit or abort command. Many database resources other than objects are
also locked with the pending transactions. Matrix users will begin to experience lock
timeouts as they attempt typical database operations.
78 MQL Guide
Working With Threads
MQL has a notion of a “thread,” which is a means by which you can run multiple MQL
sessions inside a single process. Each thread is like a separate MQL session, except that all
threads run within the same MQL process. This concept was introduced into MQL to
support the MSM idea of multiple “deferred commit” windows.
Start Thread By default, when you enter MQL, you are in thread number 1. You can start a new thread
Command by running the start thread command. The command returns the ID (an integer) of
the new thread. You are now in the new thread.
start thread;
If, in the previous thread, you had started a transaction and made a change to the database
but had not committed it yet, the change will not be visible in the new thread. This
behavior is the same as you would have if you had multiple MQL processes running and
in one of them a transaction had been started and a change made.
Resume Thread You can switch back to an existing thread using the resume thread command.
Command Indicate the ID of the thread you want to resume. For example, if you are in the third
thread and want to return to the first thread, use:
resume thread 1;
Print Thread You can find out the current thread by running print thread. The ID number of the
Command current thread is returned.
print thread;
Kill Thread A thread other than the current one can be killed (like killing an MQL process) by using
Command the kill thread command. Indicate the number of the the thread that you want to
terminate.
kill thread 2;
Version 10 79
80 MQL Guide
Part II:
System Administrator Functions
82 MQL Guide
3
Maintaining the System
System Administrator Responsibilities........................................................ 84
Controlling System-wide Settings ................................................................ 85
Case Sensitive Mode........................................................................................ 85
Updating Sets With Change Vault .................................................................... 90
Database Constraints ....................................................................................... 91
Time Zones from the database......................................................................... 92
System Decimal Symbol................................................................................... 92
Allowing Empty Strings for Object Names ........................................................ 93
Setting History Logging for the System ............................................................ 93
Privileged Business Administrators .................................................................. 93
System tidy ....................................................................................................... 93
List Statement................................................................................................... 94
Print Statement ................................................................................................. 94
Validating the Matrix Database...................................................................... 95
Using an Oracle Database................................................................................ 96
Using a DB2 Database ..................................................................................... 96
correct command .............................................................................................. 98
Maintaining and Monitoring Clients............................................................ 100
Viewing User Session Information.................................................................. 100
Error Log and Disk Space............................................................................... 100
Access Log ..................................................................................................... 100
Monitoring Servers ...................................................................................... 105
Enabling Tracing............................................................................................. 105
Enabling trace tools via MQL.......................................................................... 107
ADK interfaces................................................................................................ 108
Output ............................................................................................................. 110
Tracing and Debugging .................................................................................. 111
Examples ........................................................................................................ 112
ADK Session Monitoring................................................................................. 115
Viewing Configuration Diagnostics ............................................................ 120
Developing a Backup Strategy .................................................................... 121
Version 10 83
System Administrator Responsibilities
The duties of the Matrix System Administrator are to maintain and troubleshoot the
system. The System Administrator should also be the on-site point of contact for all
software updates, revisions, and customer support requests. Specific duties include:
• Controlling System-wide Settings
• Validating the Matrix Database
• Maintaining and Monitoring Clients
• Monitoring Servers
• Viewing Configuration Diagnostics
• Developing a Backup Strategy
Other responsibilities, covered in other chapters include:
• Working With Vaults in Chapter 4
• Working With Stores in Chapter 5
• Replicating Captured Stores in Chapter 6
• Distributing the Database in Chapter 7
• Working With Export/Import in Chapter 9
84 MQL Guide
Controlling System-wide Settings
Password requirements can be set for the entire system, as described in System-Wide
Password Settings in Chapter 11. Triggers may be turned on or off with the triggers off
command. In addition, Matrix System Administrators can control certain other settings
that affect the system as a whole using the set system command:
set system SYSTEM_SETTING;
Case Sensitive Matrix has always been case sensitive. This is due in part to the fact that the databases in
Mode which Matrix stores its data have been case sensitive. Beginning in version 8i, however,
Oracle offers a “function-based” index, which provides a mechanism for applications to
deal with Oracle in a case insensitive fashion. On the other hand, at this time Db2 has no
provisions for case insensitivity, so Matrix cannot support it with Db2.
Oracle setup
New and existing Oracle databases must be set up to use a function-based index, if you
wish to work in a case insensitive environment. Three Oracle components must be
adjusted:
Version 10 85
• The database user must have the QUERY REWRITE system privilege.
• The database instance must have the following variables set:
QUERY_REWRITE_ENABLED=TRUE
QUERY_REWRITE_INTEGRITY=TRUSTED
• The oracle optimizer must be running in cost mode.
Provided these three conditions are met, function-based indices will perform identically to
their case sensitive counterparts.
Matrix setup
Matrix/Oracle databases must be at schema version 10.5 or higher to be able to turn case
sensitivity off. For databases older than 10.5, you must run the MQL upgrade command
with version 10.5 or higher. You also must also convert unique constraints to unique
indices in Oracle, and there is the real possibility that duplicate records will exist if you
have used the database before turning off the casesensitive setting. For example, in a case
sensitive environment, you could have users named “bill” and “Bill”, which would cause
unique constraint violations if an attempt was made to make this database case insensitive
(add unique indices). The MQL command validate unique is provided to identify
these conflicts so that they can be resolved prior to turning off the setting. Once resolved,
you then turn off the “casesensitive” system setting, which defaults to on, and reindex the
vaults to switch to unique indices.
To make a Matrix Version 10.5 database case insensitive
1. In MQL, run validate unique to identify conflicts and resolve any issues by
changing some names or deleting unneeded items. For example, the output might
show:
Duplicate person 'Bill'
Duplicate program 'test'
Duplicate state 'Open' in policy 'Incident'
Duplicate signature 'Accept Quality Engineer Assignment' on
state 'Assign' in policy 'Incident'
Duplicate signature 'Accept Quality Engineer Assignment' on
state 'Assign' in policy 'Incident'
86 MQL Guide
Duplicate business type 'CLASS'
Duplicate business object 'RequestReport' 'Unassigned' '1'
Duplicate business object 'Document' 'Financials' 'Q32003'
Duplicate business object 'Test Suite' 'Vault' ''
Duplicate business object 'Milestone' 'Covers For Manuals' ''
Duplicate business object 'Task' 'Regression testing' '0'
You should find all of these objects (in Matrix, Business or System) and resolve them
by deleting or changing the name of one of the duplicates. Note that duplicate
signatures may be reported more than once. This is dependent on the number of
unique signers on the signature for all actions (approve, reject, ignore).
You may also find Person workspace objects such as:
Duplicate table 'Cost PRS' owned by ganley
Duplicate BusinessObjectQuery 'a' owned by coronella
Duplicate VisualCue 'committed' owned by maynes
Duplicate ObjectTip 'Description' owned by liu
Duplicate Filter 'feature' owned by zique
Duplicate BusinessObjectSet 'Current Software' owned by powers
Duplicate ProgramSet 'New Bug' owned by oconnor
These must be resolved by the user specfied as the owner.
All duplicates, including administrative objects, business objects, and workspace
objects must be resolved before proceding.
2. Identify and resolve existing attribute and policy definitions to be sure the rules you
set are what you want. See Matrix with casesensitive off for details.
3. In MQL, run set system casesensitive off;
4. Reindex all vaults to create case insensitive indices. For very large vaults this may
take several hours. You can run validate index vault VAULTNAME; for
information on what will occur. Refer to Indexing Vaults in Chapter 4 for more
information.
5. Calculate or update statistics on all Matrix tables by executing the following MQL
command:
<mql> validate level 4;
The validate level 4 command should be run after any substantial data load operation,
and periodically thereafter, in order to update the statistics. Refer toValidating the
Matrix Database for details.
Matrix is now ready to use in case insensitive mode.
LCD Environments
In a LCD environment, both federations must use the same casesensitivity setting.
Adaplets
Adaplets generate sql independently of the Matrix core, and they may be configured to be
either case insensitive or not when working with Matrix. To make an adaplet operate in
case insensitive mode, add the following line to the adaplet mapping file:
item casesensitive false
Version 10 87
Without this line, adaplets will continue to behave in a case sensitive fashion. Note that
adding this line to an adaplet mapping file will cause Matrix to generate sql against the
foreign database that wraps all arguments inside of an 'upper()' expression. This alone
does not assure the foreign database was designed and indexed in a way that make case
insensitive operation viable.
The foreign database may need its own configuration to run in a case insensitive manner.
If the adaplet has case sensitivity turned on and is in extend or migrate mode, then types
must use mapped ids. Queries on types without mapped ids will produce Oracle constraint
errors. Also you need to be absolutely sure that there are no entries in the adaplet tables
with case sensitive data. In Oracle, this means that the tables must have function based
indices added if they do not already exist. As an example consider the following table:
TableName: Item
Columns:
ITEMID : VARCHAR2(9)
ITEMNAME : VARCHAR2(30)
UOM : VARCHAR2(10)
LOCKER : VARCHAR2(15)
The mapping file has a type ITEM defined as the following:
type ITEM {
id ITEM(ITEMID) mapped;
name ITEMNAME;
description DESCRIP;
attribute "UOM-u" UOM;
locker LOCKER;
default policy PART-u;
default owner mbom-u;
}
This means that the ITEMID column in the ITEM table is considered unique. After the
Matrix configuration for case-insensitivity is done (including the system setting and
mapping file updates), you would have to alter the table in SQL with the following:
drop constraint ITEM_itemid_UK on ITEM(ITEMID);
(This needs to be done only if a unique constraint already exists on the table.)
create unique index ITEM_itemid_UK on ITEM(upper(ITEMID));
(This will ensure that the table cannot have two rows with case-sensitive data for the
column ITEMID.)
In the same table above, if the mapping file defines the type ITEM as below:
type ITEM {
id ITEM(ITEMID,ITEMNAME) mapped;
name ITEMNAME;
attribute "UOM-u" UOM;
locker LOCKER;
default policy PART-u;
default owner mbom-u;
}
then the unique index that gets added should be:
88 MQL Guide
create unique index ITEM_itemid_UK on
ITEM(upper(ITEMID),upper(ITEMNAME))
In summary, for case-insensitivity to work on adaplet vaults, any string columns that need
to be considered for uniqueness in a table, need to be added to the unique index with the
"upper" clause wrapped around them.
Square Brackets
As stated above, in most cases the system returns the name of a selectable as it is stored in
the database, regardless of what you put inside the square brackets. Actually, this applies
only to references to administration objects that can be searched for in “Business” or
“System”; when in square brackets these will return the database name of the object.
However, things like file names, state names and signature names are returned as entered
in the square brackets. For example, consider the following:
An object has an attribute Att1 and a checked in file name File.txt:
MQL<6>temp query bus * a2 * select format.file[file.txt]
format.file[file.txt].name attribute[att1].value;
businessobject A a2 0
format.file[file.txt] = TRUE
(note that the spelling of the filename in the brackets is not corrected.)
format.file[file.txt].name = File.txt
(but, the name of the file is output as recorded in the database)
attribute[Att1].value = 2
(and the attribute name (an admin type) is corrected.)
One exception to this rule is properties on administration objects. Properties on
administration objects always come back with the database name of the property.
Version 10 89
sensitive regardless of the system setting (since this is what equals means). Before turning
off case sensitivity, you should check all attributes for ranges that may disobey the rules of
case insensitivity, such as having 2 range values for initial capitalization and all lower case
(for example “Pica” and “pica” for Units attribute). In this example, one of these ranges
should be deleted, and the other should be set with the “matches” operator instead of
“equals” or “matchcase.” If you use equals, all users will have to match the case precisely
when creating objects or modifying attributes, regardless of the case sensitivity setting.
Revision Fields
When creating objects using a policy that defines an alphabetic revision sequence, the
revision field is case sensitive, regardless of the system setting (that is, Matrix follows the
revision rule exactly). Be sure the rules are defined appropriately.
However, queries on the revision field do follow the rules for the system casesensitive
setting. So if your query specifies “A” for the revision field with case sensitivity turned
off, objects that meet the other criteria are found that have both “A” and “a” as their
revision identifier.
File names
File names remain case sensitive, regardless of the case sensitivity setting. So, for
example, if the object has a file “FILE.txt” checked in, the following command will fail:
checkout bus testtype testbus1 0 file file.txt;
And the following will succeed:
checkout bus testtype testbus1 0 file FILE.txt;
For checkins, if you checkin a file called “FILE.txt” and then checkin another file called
“file.txt”, there will be two separate files checked in (using append).
User Passwords
You cannot have distinct objects with the same spelling but different capitalization (that
is, “Bill” and “bill” are interpretted as the same thing). However, user passwords remain
case sensitive. For example, a user named “Bill” with a password of “secret”, can set
context with:
mql<> set context user Bill pass secret;
or:
mql<> set context user bill pass secret;
but not with:
mql<> set context user bill pass Secret;
Adaplet usage
When an asterisk is not included in the name field of a find operation on an adaplet vault,
(that is, if the name is explicitly specified) objects are shown with the name in the case as
entered by the user, and not necessarily as it exists in the database. The same is true when
explicitly specifying object names to be exported — the object is referenced in the export
file with the name in the case as entered.
Updating Sets When an object’s vault is changed, by default the following occurs behind the scenes:
With Change Vault • The original business object is cloned in the new vault with all business object data
except the related set data
• The original business object is deleted from the “old” vault.
90 MQL Guide
When a business object is deleted, it also gets removed from any sets to which it belongs.
This includes both user-defined sets and sets defined internally. IconMail messages and
the objects they contain are organized as members of an internal set. So when the object’s
vault is changed, it is not only removed from its sets, but it is also removed from all
IconMail messages that include it. In many cases the messages alone, without the objects,
are meaningless. To address this issue, the following functionality can optionally be added
to the change vault command:
• Add the object clone from the new vault to all IconMail messages and user sets in
which the original object was included.
Since this additional functionality may affect the performance of the change vault
operation if the object belongs to many sets and/or IconMails, it is not part of the function
by default, but business administrators can execute the following MQL command to
enable/disable this functionality for system-wide use:
set system changevault update set | on | off |;
Once this command has been run, when users change an object’s vault via any application
(that is, MatrixOne desktop or Web applications, or custom ADK applications), all
IconMails that reference the object are fixed, as well as user’s sets. Refer also to Changing
an object’s vault in Chapter 35 for more information.
Database Some versions of Oracle have a bug that limits performance and concurrency when an
Constraints operation uses a column that has a foreign key constraint and that column is also not
indexed. Such columns can cause deadlocks and performance problems. For systems that
use foreign keys extensively, this leads to a trade off that must be made between
performance, storage, and use of foreign keys. You can use the set system constraint
command to tailor the Matrix schema for one of three possible modes of operation::
set system constraint |none |;
|index [indexspace SPACE] |
|normal |
• Normal
The normal system setting results in a schema that has foreign keys that are not
indexed; that is, foreign key constraints are configured as they have been in
pre-version 10 releases of Matrix. This is the default setting. Databases using this
setting are subject to the Oracle concurrency bug regarding non-indexed foreign keys.
• Index
The index setting results in an Oracle index being added to every column that is
defined as a foreign key, and has no existing index. Overhead in both storage and
performance is added since updates to foreign keys also require updates to their
corresponding index.It is recommended that this option be used in development and
test environments, where there is substantial benefit in the enforcement of foreign key
constraints, and the negative storage/performance impact will not affect large
numbers of users. When issuing the command to add indices to the system, you can
specify the tablespace to use for the indexing operation.
• None
Version 10 91
This option improves concurrency by removing non-indexed foreign key constraints,
thus no additional Oracle index is required. This option eliminates the concurrency
problem of foreign keys, and in fact, further improves system performance and
scalability by eliminating the low-level integrity checks performed at the database
level. It is recommended that this option be used once an application has been
thoroughly tested and is rolled out to a large-scale production environment.
When the system is set with a constraint mode, not only are the changes made to the
relevant columns, but also the setting is stored in the database so that all future operations
including creation of new tables, running the index vault command, and upgrade, will use
the selected mode.
Note that these options only affect the approximately dozen columns (among all Matrix
tables) that have a foreign constraint but not an index.
Time Zones from For Oracle 9 and DB2 you can use the GMT time setting in the database for your servers
the database by running the following command:
set system dbservertimezonefromdb on;
When set, the system gets the time in GMT from the db server when using Oracle 9 or
DB2. If using Oracle 8, GMT is determined as it is when this is turned off (which is the
default) — based on the local time and timezone of the server.
System Decimal Matrix relies on the MX_DECIMAL_SYMBOL setting to present real numbers in all
Symbol MatrixOne applications, Matrix desktop, Web Navigator, and other custom ADK
programs. This setting must be synchronized with the Oracle database setting for
NLS_LANG.
To ensure that these settings are synchronized, the following MQL command is available
for use by System Administrators only:
set system decimal CHARACTER;
When setting the system decimal character, be sure to use the setting that is implied by the
database’s NLS_LANG setting. The default setting is period (.). So, if the database setting
for NLS_LANG is AMERICAN_AMERICA.WE8ISO8859P15, Oracle expects a period
for the decimal symbol (as indicated by the territory setting of AMERICA) and Matrix
will convert as necessary, once the following command is run:
set system decimal .;
The system decimal symbol must be synchronized with the Oracle database setting for
NLS_LANG. MX_DECIMAL_SYMBOL no longer needs to be synched with the other
settings, but is used to indicate the user’s preference for display.
92 MQL Guide
When connecting to a database via any Matrix product, users typically enter real numbers
using the decimal character defined in their MX_DECIMAL_SYMBOL setting. Once the
system decimal setting is in place, Matrix will substitute the correct character as necessary
when it displays the data or writes it to Oracle. For example, with the database configured
with a period (.) decimal character and the user’s MX_DECIMAL_SYMBOL set to a
comma (,), Matrix will always display numbers to that user with a comma and always
write them to Oracle with a period, regardless of how the user enters the number. The
same is true for the reverse; if the database is set to a comma and the user’s preference is
set to a period, numbers are displayed with a period but saved with a comma.
When exporting business objects, MX_DECIMAL_SYMBOL influences the format of
real numbers written to the export file. Therefore, MX_DECIMAL_SYMBOL should be
set in the same way by the user that imports the file, or errors will occur.
Refer to the Matrix Installation Guide for more information on configuring Oracle for
multiple language support.
Allowing Empty The following system-wide setting is available so that System Administrators can enable/
Strings for Object disable the creation of objects with empty name fields in MQL for all user sessions
Names permanently:
set system emptyname [on|off]
By default, the setting is off, which means that empty names are not allowed. MQL and
any other program code will issue an error if any attempt to make a business object have
an empty name is made. It will also cause a warning to be issued if a query specifies an
empty string (“ ”) for the name. (The query will not error out and will not abort any
transaction going on.) If the setting is on, the system allows empty names for objects in
MQL only.
Setting History The following system-wide setting is available so that System Administrators can enable/
Logging for the disable history for all user sessions permanently:
System set system history [on|off]
By default, history is on. When turned off, custom history records can be used on the
operations where history is required, since it will be logged regardless of the global history
setting.
Privileged By default a business administrator can change context to any person without a password.
Business This is to allow administrators and programs to perform operations on behalf of another
Administrators user. A System Administrator can disable this system-wide “back door” security risk by
issuing the following command:
set system privilegedbusinessadmin off;
After this command has been run, business administrators need a password when
changing context to another person. Only system administrators can change context to any
other person without a password.
Version 10 93
A System Administrator can re-enable business administrators to change context without
a password using:
set system privilegedbusinessadmin on;
System tidy In replicated environments, when a user deletes a file checked into an object (via checkin
overwrite or file delete), by default all other locations within that store maintain their
copies of the now obsolete file. The file is deleted only when the administrator runs the
tidy store command.
You can change the system behavior going forward such that all future file deletions occur
at all locations by using:
set system tidy on;
Since this command changes future behavior and does not cleanup existing stores, you
should then sync all stores, so all files are updated. Once done, the system will remain
updated and tidy, until and unless system tidy is turned off.
Running with system tidy turned on may impact the performance of the delete file
operation, depending on the number of locations and network performance at the time of
the file deletion.
While there will be no obsolete files, ingested stores may need to be defragmented
periodically even with system tidy on.
List Statement The list system statement is used to display all system settings.
list system ;
94 MQL Guide
Print Statement The Print statement prints the specified setting to the screen:.
print system |casesensitive |;
|changevault |;
|constraint |;
|dbtimezonefromdb |;
|decimal |;
|emptyname |;
|history |;
|privilegedbusinessadmin|;
|tidy |;
For example:.
print system changevault;
Version 10 95
Validating the Matrix Database
The MQL validate command enables you to check the correctness and integrity of the
Matrix database. Using an Oracle database, the validate command issues a series of
SQL commands that perform variations of the Oracle “analyze table” construct. For DB2,
the validate command issues the runstats or reorg command based on the level
specified.
There are five levels (0-4 in ascending order) used to check the correctness and integrity
of the Matrix database. A validate schedule using a mix of levels can be established to
ensure continuing validity of the database, while optimizing the length of time necessary
for the verification.
• Level 0
Scans the database for flagrant discrepancies within the database bytes. It does not
open or check objects.
• Level 1
Performs Level 0 and then scans the objects of the database with minimal
verification. For example, if Level 1 recognizes a Person object, it ensures that it is
named.
• Level 2
Deletes statistics on all tables.
• Level 3
Estimates statistics on all tables.
• Level 4
Computes statistics on all tables.
If validation errors are discovered, it does not mean the database is damaged, especially if
they are detected in the higher level validations. These errors should be analyzed by a
Matrix Engineer to determine the severity of the inconsistencies and fix any issues that
can be corrected.
The MQL syntax is:
validate [level NUMBER] [output FILENAME] [VALIDATE_ITEM {,VALIDATE_ITEM}];
NUMBER is 0, 1, 2, 3, or 4
FILENAME is the file name to which the DB2 command is written (not used for Oracle).
VALIDATE_ITEM can be any of the following:
vault VAULT_NAME {,VAULT_NAME}
store STORE_NAME {,STORE_NAME} See Validate Store Command in Chapter 5
store STORE_NAME file FILENAME See Validate Store Command in Chapter 5
index vault VAULT_NAME table TABLE_NAME See Clearing and Maintaining Vaults in Chapter 4
96 MQL Guide
For vault and store, if no level number is specified, a Level 4 validation is performed.
Ingested stores are the only type of store that can be validated. The same level validation
can be performed on any combination and number of stores and vaults in one command.
For example,
validate level 2 store 'Drawing Documentation', vault Engineering;
Using an Oracle On Oracle, the MQL validate command results in various forms of the SQL ‘analyze
Database table’ statement being executed against all tables for a given vault. The particular analyze
option is determined by the level setting for validate:
• Level 0: analyze table xxx validate structure;
• Level 1: analyze table xxx validate structure cascade;
• Level 2: analyze table xxx delete statistics;
• Level 3: analyze table xxx estimate statistics;
• Level 4: analyze table xxx compute statistics;
For instance, the MQL command:
validate level 3 vault Actuators;
Using a DB2 For DB2, the validate command issues the runstats or reorg command based on
Database the level specified:
• Level 0: runstats
• Level 1: runstats for indexes all
• Level 2: runstats and indexes all
• Level 3: reorgchk
• Level 4: reorg
It is important to note that validate level 4 uses the DB2 reorg command.
Since reorg physically reorganizes tables and is resource intensive, only a Database
Administrator should run level 4 validation.
Additionally for DB2, an “output” parameter is required for the validate command
that specifies the file name to which the DB2 command is written, for example:
validate level 0 output actuators.bat vault Actuators;
The above validate command will create the actuators.bat file containing the
runstats command for all tables in the Actuators vault.
You then run the batch file from the DB2 command line, which in turn will execute the
appropriate DB2 commands.
See IBM DB2 documentation for more about the runstats, reorgchk, and reorg
commands.
Version 10 97
correct command The mql correct command can be used by System Administrators as directed by
MatrixOne Technical Support, to correct anomalies caused by ancient versions of Matrix.
You must be certain that no users are logged in or can log in while correct is running.
Use the correct command only upon the advise of MatrixOne Technical Support. It is
imperative that no one is using the system when the correct command is run. Confirm that
no users are connected, using the sessions command or Oracle tools, and temporarily
change the bootstrap so that no one can login while correct is running.
98 MQL Guide
TYPE_NAME is the name of a Matrix business type. Business objects of this type are
being corrected. When this command is completed all business objects that have
missing attributes will have those attributes back. The value of the attribute will be
the default value.
ATTRIBUTE_NAME is the name of the attribute that is missing from some objects.
VAULT_NAME is name of the vault in which business objects of type
TYPE_NAME will be examined and corrected if needed.
Run this command for each vault in the database. Only those business objects that
were missing the attribute will be modified. The added attribute on these objects will
be initialized to its default value, and MQL will output confirmation messages similar
to:
Creating attribute attribute_name in Business object TYPE NAME REVISION
5. To verify the integrity of all states in the database or on a single vault use:
MQL<> correct state validate [vault VAULT];
Without the vault clause all states in the database are checked. If you include the vault
clause, only that vault is validated. You can then fix the states using:
MQL<> correct state [vault VAULT];
6. Sets can be validated either across the entire database, or on a server by server basis
using the following:
MQL<> correct set validate [server SERVER_NAME];
If invalid sets are found you can delete them with:
MQL<> correct set fix [server SERVER_NAME];
For all commands, output can be redirected to a file using standard output.
Whenever any form of the correct command is executed, you receive the following
warning and prompt for confirmation:
Correct commands may perform very low level modifications to your database.
Use the 'sessions' command to check that no users are logged in.
It is strongly recommended that you change bootstrap password to insure that no users
log in during correct process, and turn verbose on to record corrective actions.
You should also consult with MatrixOne support to insure you follow appropriate
procedures for using this command.
Version 10 99
Maintaining and Monitoring Clients
Viewing User Some of the tasks you must perform as the Matrix System Administrator require that you
Session shut down the Matrix or system software. Before doing this (and perhaps at other times),
Information you may need to know which users are currently using the Matrix database. You can use
the Sessions command to view a list of all current users.
sessions;
If the executable was started with a shortcut on Windows NT, the PROGRAMNAME
displayed is limited to the first 64 characters.
You must be logged in as the System Administrator to use the Sessions command. If you
receive the following error message, access to the table that stores session information was
not configured when the system was installed:
Table or View does not exist.
The Oracle Database Administrator must run the following SQL*Plus command:
GRANT SELECT ON "SYS"."V_$SESSION" TO "MATRIX";
Error Log and Disk Matrix errors are automatically written to mxtrace.log, located by default in
Space MATRIXHOME, or in the directory defined by MX_TRACE_FILE_PATH in the
Matrix.ini file.
When a user that is not defined as a Business or System Administrator executes a program
that issues a print program select code dump command (or executes the
command in MQL), an error is posted in mxtrace.log. In RMI and EJB Collaboration
Server environments this error does not occur. But since all PS Application Library
programs and many custom programs use this command, the size of the mxtrace.log file
may increase dramatically in a desktop environment that uses these programs regularly.
For that reason, periodic cleanup of the mxtrace.log file is recommended for both server
and client machines.
Access Log You can enable access logs that provide auditing of all access right grants and denials on a
client’s system. UNIX systems make use of the UNIX syslog(3) interface to log, write, or
forward messages to designated files or users; on NT systems, the Application Event Log
is used. Because these O/S logging facilities are utilized, existing auditing tools can be
easily modified to include the Matrix access log.
Log Output
Whether it’s part of the UNIX syslog, or the NT Event Log, the information logged on
each type of object varies as shown in the tables below. Capitalization in the formats
indicate a substitution from Matrix.
Version 10 101
Access Log Data: Relationships
Access checks on relationships involve two steps. The first is to check if the requested
access is allowed on the business objects to which the relationship is connected. These
Access Description access checks, success or failure, will be logged as for business objects. If successful, the
existence of an access rule assignment on the relationship type is checked. If the rule exists,
success or failure will be logged as described below.
Similar to the behavior on relationships, attribute access is first checked on the business
object or relationship to which the attribute is assigned. These access checks will be logged
Access Description as described above. If successful, a second check is made against an optional access rule
assigned to the attribute type. If the rule exists, success or failure will be logged as
described below.
Programs and forms are nearly identical in how access checking is performed. An access
rule can be assigned to a Program or Form object that is checked whenever a user attempts
Access Description
to execute the Program or open the Form. Such access checks will be logged as shown
below.
The file specified must exist before adding the entry in the syslog.conf file.
The UNIX system handles the messages, successful access and failed access, as *.info
and *.notice respectively.
Successful access attempts will be recorded as priority LOG_INFO. Failed access
attempts will be recorded as priority LOG_NOTICE.
In order get the new entry (in the syslog.conf file) recognized, the server must be restarted,
or a kill command must be executed with the hangup option for the syslog process id.
For example:
kill -HUP `cat /etc/syslog.pid`
NOTE: The syslog.pid file located in different areas on different machines.
Sample Output
Feb 21 21:58:42 qesun1 mxaccess[17387]: DOCUMENTS::WIP::read allowed for
Buju on Note BujuNote 0 in CM
Feb 21 21:58:45 qesun1 mxaccess[17387]: DOCUMENTS::WIP::demote allowed for Buju(owner)
on Note BujuNote 0 in CM
Feb 21 21:58:45 qesun1 mxaccess[17387]: DOCUMENTS::Planning::read allowed for Buju on
Note BujuNote 0 in CM
Feb 21 21:59:34 qesun1 last message repeated 1 time
A new entry is not added if the prior entry is the same. Instead, the number of times that
the entry is repeated is entered, and then followed by a different entry.
Version 10 103
To View the access log on NT
1. From the Start menu, choose Event Viewer from the Programs>Administrative
Tools program.
2. Change from the System log to the Application log by choosing Application from the
Log menu.
3. To view any of the access log entries, double click any of the entries whose Source is
Matrix.
4. You can scroll through the access log using the Previous and Next buttons.
5. Click Close when finished viewing the entries.
Diagnostic tools have always been available for Matrix servers using standard output.
However, in the thin client environment, where the Matrix Kernel runs inside a Web
server, accessing trace information that is piped to stdout can be awkward. Enhanced
server diagnostic tools allow the following trace information to be sent either to a file or to
standard output (the “destination”):
• SQL output
• MQL trace: program execution, including both Tcl and Java program objects
• VERBOSE trace of client/server dispatches
• FTP and FTPS communication
• SMTP communication
• LDAP communication
• Trigger execution
• Workflow debugging
• User-defined trace types
All tracing mechanisms for the various Matrix Kernel operations can be turned on and off
for all sessions via environment variables in a UNIX startup script or .ini file settings, or
for either all sessions or single sessions via MQL or the ADK.
Enabling Tracing Traditionally Matrix tracing has been enabled via environment variables in a startup script
(such as startWeblogic, rmireg or Matrix) or Windows .ini file, and therefore affected all
sessions. Refer to the Matrix Installation Guide for more information.
However, since these settings enable tracing of activities for all user sessions, using .ini
settings for starting/stopping tracing should be restricted to those cases where it is
necessary to trace startup behavior. It has two distinct disadvantages that suggest it should
be avoided unless absolutely necessary:
• It requires you to stop the server to reset .ini settings.
• It affects all users. Tracing does slow the system down, especially tracing low-level
operations (verbose, sql) across all sessions.
You can enable both all-session and single-session tracing via MQL or the ADK, which
allows more flexibility.
Version 10 105
MX_VERBOSE_TRACE
MX_SQL_TRACE
MX_MQL_TRACE
MX_FTP_TRACE
MX_WORKFLOW_TRACE
MX_SMTP_TRACE
MX_LDAP_TRACE
MX_TIMER_TRACE
For example, if a filename is specified for MX_VERBOSE_TRACE and MX_SQL_TRACE,
and if MX_TRIGGER_TRACE is set to true, the output for all three kinds of tracing will go
to the stdout. If MX_SQL_TRACE and MX_MQL_TRACE are both set to a filename, the
output for both will go to the file specified for MX_SQL_TRACE.
A list of single-session trace filenames, one for each session that requests some kind of
tracing, is also maintained by the kernel. Single-session trace files are specified in the
MQL/ADK commands that enable the tracing (as described in Enabling trace tools via
MQL, and ADK interfaces). Once a filename has been specified for a specific
single-session trace type, it will be used for all single-session tracing that is requested by
the same session. Similarly, tracing requests from other distinct sessions will have their
own filename on the list so that distinct single-session traces will not interfere with each
other.
One exception to the uniformity is that VERBOSE tracing, which traces client-server
calls, is available for all sessions only. It can, however, be started and stopped via MQL/
ADK. So, if verbose tracing and some sort of single-session tracing are both enabled with
a filename, two separate files will be created.
All-session traces are maintained in a single file, established by the setting of the filename
of the most predominant type of tracing (as listed above). Single-session traces are also
maintained in a single file, though separate from all-session traces. The single-session
filename is determined by the first filename specified, no matter what the trace type. These
files are located in MX_TRACE_FILE_PATH.
The following table shows the effect of having tracing turned on for all sessions, single
sessions, or both. Note that with the exception of verbose tracing, the single-session trace
filename wins.
No n/a none
No No none
mql
verbose
ftp
smtp
ldap
trigger
workflow
store
OTHER_TYPE
Particular care should be taken in the use of SQL and VERBOSE tracing. Both are low
level, and liable to generate a large amount of output data, which will affect performance.
The keyword store can be used with the trace type command, so that when
synchronizing or purging stores a log file can be created that indicates the success or
failure of every file and business object.
OTHER_TYPE allows the definition of a user-defined tracing type, for example,
“MYTRACE”. Refer to text STRING clause for user-defined trace types for more
information.
Version 10 107
constructed by prepending a time-specific prefix to the filename, in the form
“yyyymmddhhmmss__FILENAME.”
on clause
The on modifier will turn the specified tracing on and send it to a previously specified
trace file, or if there is no previously specified trace file, it will send the trace information
to stdout. By default, tracing is started for the current session only, and will NOT record
activities invoked by other sessions.
all clause
You can include the all clause when you want to record trace information of the
specified type for all sessions. By default, you only enable it for the current session.
One exception is that VERBOSE tracing, which traces client-server calls, is available for
all sessions only.
Refer to All-session vs. single-session tracing for more information.
off clause
The off clause turns the specified type of tracing off. If other tracing types had been
turned on, they will stay on. Tracing that is turned on via .ini file settings or using the all
keyword can only be turned off using all. For example:
trace type SQL off all;
When all types of tracing directed at the same file are turned off, the file is closed. In order
to resume tracing to a file, any subsequent command must specify a filename. If it doesn’t,
tracing will be resumed with stdout as the destination.
[not]full clause
Trace output includes timestamp information, which you can turn off with the notfull
clause. You can also use !full. To re-enable, use the full clause.
ADK interfaces Two sets of interfaces are provided that can be used in your Java application to output
tracing messages of any sort to the Matrix trace files. These messages will be output only
MatrixLogWriter methods
With the object-oriented MatrixLogWriter interface, you turn tracing on by instantiating a
MatrixLogWriter object with one of two constructors:
public MatrixLogWriter(Context context)
Context methods
ADK interfaces are also provided that correspond to the MQL commands in the preceding
section. These interfaces are provided as methods on the current Context object:
public void setTrace(String filename,
String type,
Version 10 109
boolean onFlag,
boolean allFlag) throws MatrixException
Output All trace entries have a standard prefix consisting of a fixed-format timestamp (without
the date), the tracing TYPE, the thread ID and a trace message for each line of output. The
prefix will always be 23 characters long, followed by a space, as follows:
21:51:39.795 TYPE t@284 <tracing output>
So, the trace message always begins in column 25. For example:
02:06:59.339 MQL t@354 Start MQLCommand: exec prog printContext
Output columns are as follows:
• Column 1 through 12 contains the timestamp: hour (0-24), minute, second,
millisecond
• Column 14 through17 contains the tracing type: always 4 characters (padded or
truncated, such as: “SQL”, “MQL” “MYTR”
• Column 19 through 23 contains the thread id: t@ followed by 3 digits
• Column 25 - tracing message generated by Matrix Kernel, by MQL ‘trace type text’,
or by ADK calls to printTrace().
This table summarizes the output provided for the various traces. Detailed examples are in
the following sections.
SQL Select, update, insert, delete, rollback and commit commands issued to Oracle. All output is preceded by
thread ID.
MQL Program name and arguments (Tcl or JPO), MQL commands issued by those programs (Tcl MQL
command or JPO mqlCommand interface), total time for program execution, and execution time for each
MQL command. All output is preceded by thread ID. Session ID will also be printed for Program names
and commands executed via the mqlCommand interface*.
* The session ID is a long string, which would make for hard-to-read output if we were to prepend every command with it.
The thread ID is usually sufficient. Therefore, we output session id only with certain server calls, and provide the
corresponding thread id, which will identify subsequent trace messages associated to that thread, hence that session.
LDAP Connect and informational requests/responses to/from LDAP server. All output is preceded by thread ID
Trigger Event and type (check, override, action) for each trigger fired, and the name of the program that is run.
<other> Whatever the implementor has specified via ‘trace type TYPE text STRING’ commands or corresponding
ADK calls.
Tracing and User-defined tracing should be considered at the time that you are developing your
Debugging implementation. Keep in mind the following:
• Because tracing can be turned off, you should consider whether you should leave a
few judiciously-placed calls to printTrace for production level diagnosis and
performance checks. They will be inactive until or unless you explicitly turn on
tracing of the corresponding type. The emphasis here is on “few” and
“judiciously-placed,” since even inactive calls have to do a some checking to discover
they are inactive. For example, putting calls to MatrixLogWriter to write “entering
program” and “exiting program” for every method in a complex client application,
would be frivolous, since each represents an additional call to the server where the
tracing flags are maintained. However, the inclusion of a few tracing calls before and/
or after some complex operations can streamline downstream troubleshooting
considerably.
• Matrix merges multiple trace types into a single file, and may do so for multiple (all)
sessions or threads. The inclusion of explicit TYPE tags in each label allows you to
use OS tools to extract records for a single trace type into its own file. Similarly, the
inclusion of the thread identifier in each label allows you to extract/segregate the
activities of all types for a single session or thread.
• You should also carefully consider the placement of performance traces, since the
mere fact of turning them on affects the very thing they are intended to measure. For
performance analysis, the fixed format lends itself well to parsing the log files and
measuring time spend in certain programs, etc.
Version 10 111
Examples Enabling with MQL
The following example shows how to turn single-session tracing on for SQL, MQL and a
user-defined tracing type ‘MYTRACE’, followed by the resulting text file
myExample.log:
MQL<5>trace type SQL filename myExample.log;
MQL<6>trace type MQL on;
MQL<7>trace type MYTRACE on;
MQL<8>execute program testTrace;
>>>>>>>>>>> myExample.log <<<<<<<<<<<<<<<<<
2001349-22:12:27.970 MQL t@284 mql: trace type MYTRACE text Start checkpoint: Temp
query rev=last
2001349-22:12:27.970 MYTR t@284 Start checkpoint: Temp query rev=last
2001349-22:12:27.970 MQL t@284 mql time 0.000
2001349-22:12:27.970 MQL t@284 mql: temp query bus * * * where 'revision == last'
2001349-22:12:27.970 SQL t@284 select * from mxVer6 where mxOid=:va
2001349-22:12:27.970 SQL t@284 :va=1
2001349-22:12:27.970 SQL t@284 -->select
2001349-22:12:27.970 SQL t@284 select * from lxBO_4a7a4a03
2001349-22:12:27.970 SQL t@284 -->select
…
2001349-22:12:27.980 SQL t@284 -->select
2001349-22:12:28.060 SQL t@284 select * from lxBO_9faf941c
2001349-22:12:28.080 SQL t@284 -->select
…
2001349-22:12:28.160 SQL t@284 -->select
2001349-22:12:28.521 SQL t@284 select * from lxBO_77298049
2001349-22:12:28.521 SQL t@284 -->select
2001349-22:12:28.561 MQL t@284 mql time 0.591
2001349-22:12:28.571 MQL t@284 mql: trace type MYTRACE text End checkpoint: After temp
query
2001349-22:12:28.571 MYTR t@284 End checkpoint: After temp query
2001349-22:12:28.571 MQL t@284 mql time 0.000
2001349-22:12:28.571 MQL t@284 TCL Results:
2001349-22:12:28.571 MQL t@284 END TCL time: 0.631 (0.591 in MQL)
2001354-22:37:10.417 MQL t@360 mql: trace type MYTRACE text Start checkpoint: Temp
query rev=last
2001354-22:37:10.417 MYTR t@360 Start checkpoint: Temp query rev=last
2001354-22:37:10.417 MQL t@360 mql time 0.000
2001354-22:37:10.417 MQL t@360 mql: temp query bus * * * where 'revision == last'
2001354-22:37:11.259 MQL t@360 mql time 0.842
2001354-22:37:11.259 MQL t@360 mql: trace type MYTRACE text End checkpoint: After temp
query 0.842
2001354-22:37:11.259 MYTR t@360 End checkpoint: After temp query 0.842
2001354-22:37:11.259 MQL t@360 mql time 0.000
2001354-22:37:11.259 MQL t@360 TCL Results:
2001354-22:37:11.259 MQL t@360 END TCL time: 0.872 (0.842 in MQL)
2001354-22:37:11.259 MQL t@360 End Program:
Version 10 113
MatrixLogWriter writer2 = new MatrixLogWriter(getContext(),
"myLOG1.log",
"MYTRACE", false);
message = "Message #2";
writer2.write(message, 0, message.length());
writer2.close();
// this will write to myLOG2.log
writer2 = new MatrixLogWriter(getContext(), "myLOG2.log",
"myother", false);
message = "Message #3";
writer2.write(message, 0, message.length());
writer2.close();
// append message to default file
writer1.write("Message #4");
writer1.close();
}
catch (java.io.IOException e)
{
// nothing
}
// Then the local traces are turned off again allowing all the
// trace to go to the all sessions file again.
// Finally, the local (SQL,MQL) traces are turned back on, but
// directed to a different local file.
// Note that:
// - VERBOSE always goes to ALL
// - Single session tracing wins over all session tracing
// - some of the traces (marked [NONE]) don't go anywhere,
// because there's no trace file of the appropriate type open
ADK Session Sessions that are connected to Matrix via the ADK can be monitored to report information
Monitoring such as user names, cache sizes, object IDs, and the like. These statistics are useful for
debugging ADK processes and monitoring memory usage.
The following features are available for monitoring ADK sessions:
• MX_VERBOSE_PARAM_TRACE variable
• monitor context MQL command (RMI and EJB only)
• monitor memory MQL command
Version 10 115
Verbose Tracing
MX_VERBOSE_PARAM_TRACE when set to true can show key ADK call parameters in
verbose tracing. On Windows, you add this variable to the ematrix.ini file; on UNIX,
add and export it as an environment variable to rmireg.sh.
When you set MX_VERBOSE_PARAM_TRACE to TRUE or matrix.log (your log file
name), tracing output includes additional ADK call parameters, such as:
• The user logging in, which is identified in entries including
allocExternalContext.bosInterface and reset.bosContent.
• Entries listing “input params” and “output params”, which contain parameter
information such as user, vault, object name, language, command, etc.
• “stateful dispatch” messages, which are followed by a report of the session name.
• The open.bosBusinessObject call, which also reports the input object-id and
output TNR.
• The open.bosQuery call “input params” message, which also reports query
details.
• The evaluate.bosQuery call “output params” message, which reports the
number of objects returned.
The above information can be used to identify specific ADK calls that cause problems
within the core.
Note that when MX_VERBOSE_PARAM_TRACE is set to TRUE or matrix.log,
verbose logging is created even if MX_VERBOSE_TRACE is not set.
The example below reports information about input params and the session ID:
[15:23:34.539 --- Matrix@HEWEY 0 : t@2224: stateless dispatch for
allocExternalContext.bosInterface]
[15:23:34.539 --- Matrix@HEWEY 0 : t@2224: input params:
sessionId=PUFpXp1kjpqvcIIxhXAFhQqZdNlR89L2BVFbZjNn2l3qufgw28kt|-2636696131106167120/
167839130/6/7001/7001/7002/7002/7001/-1, user=Test Everything, vault=, lang=en-us,
tz=America/Los_Angeles]
[15:23:34.539 --- Matrix@HEWEY 0 : t@2224: dispatch complete]
The example below reports a business object being opened, including input and
output params along with the object ID of the business object being opened:
[15:23:51.143 --- Matrix@HEWEY 0 : t@2224: stateless dispatch for
open.bosBusinessObject]
[15:23:51.143 --- Matrix@HEWEY 0 : t@2224: allocate context for session
PUFpXp1kjpqvcIIxhXAFhQqZdNlR89L2BVFbZjNn2l3qufgw28kt|-2636696131106167120/167839130/6/
7001/7001/7002/7002/7001/-1]
[15:23:51.163 --- Matrix@HEWEY 0 : t@2224: input params: id=57622.20620.20359.61650]
[15:23:51.173 --- Matrix@HEWEY 0 : t@2224: output params: returnVal
objectid=57622.20620.20359.61650, type=Person, name=Test Everything, revision=-,
vault=eService Administration]
[15:23:51.173 --- Matrix@HEWEY 0 : t@2224: dispatch complete]
The following example of a query evaluation reports input parameters that describe the
scope of the query, and an output parameter that indicates the number of objects returned
for the query. (If the timestamps indicate the process took a long time, a large number of
objects returned could explain the long timespan.)
[15:25:28.623 --- Matrix@HEWEY 0 : t@2224: stateless dispatch for evaluate.bosQuery]
[15:25:28.683 --- Matrix@HEWEY 0 : t@2224: allocate context for session
PUFpXp1kjpqvcIIxhXAFhQqZdNlR89L2BVFbZjNn2l3qufgw28kt|-2636696131106167120/167839130/6/
7001/7001/7002/7002/7001/-1]
SESSION-ID is used to limit the display of session information to the context object for
the specified session ID. If not used, all sessions are reported.
The [set|!set] option limits the display of session information to contexts that are
marked as “set” or “not set” respectively. (The ADK context.shutdown() method
will mark a context “not set.”) Use this option only when the session ID is not specified.
terse displays only cumulative statistics and Matrix statistics, not individual sessions.
The monitor context command can display the following information per session:
• number of contexts
• idle vs. active session
• total cached bytes
• session ID
• context set/logged in status
• username
• timestamp for and name of last ADK call and thread on which it executed
• transaction status (for example: active, mode, savepoints, etc.)
• estimate of context-specific and admin cache size in use, if possible, for each active
session
The command displays the following environment information for all sessions:
• Total number of sessions
• Administration cache size
• Total session cache size
• Pooled session cache size
Following is sample output for the monitor context command, taken using an ADK
program that mimics Matrix desktop MQL functionality. Note that the string named after
the session name (current) indicates the context corresponding to the current user
session.
mql>monitor context
Admin cache: 1260859 bytes
Pooled session cache: 0 bytes
4 context objects
Session PUF93l21k9lAjAH0hy0O2WOZCYOhggu2dvWd0owsfT9DDHzH1I5P|
-263669613110616712
Version 10 117
0/167839130/6/7001/7001/7002/7002/7001/-1
User: 'Test Everything' logged in
Vault: 'eService Sample'
Last: t@2208, select.bosBusinessObject
Last recorded cache size: 0
idle: 14 minutes 52 seconds
0 active sessions
Session mx10277030735012117155733
User: 'creator' logged in
Vault: 'ADMINISTRATION'
Last: t@1940, executeCmd.bosMQLCommand
Last recorded cache size: 505579
idle: 5 seconds
2 active sessions
session 0
transaction active,update,wait
savepoint save1
3 cached entries, 3192 bytes
session 1
transaction active,update,wait
3 cached entries, 502387 bytes
Session mx1027703338082-1990050644
User: 'creator' logged out
Vault: 'ADMINISTRATION'
Last: t@2284, executeCmd.bosMQLCommand
Last recorded cache size: 0
idle: 11 minutes 39 seconds
0 active sessions
Only users with System Administrator privileges can execute the monitor context
command.
Notes
• If a context is currently executing at the time another context issues the monitor
context command, output for the active session will resemble the following:
The above sample shows the “Active” time for the session, and a warning message
states “…session is active.”
• In the interest of thread safety, monitor context processing reports only what is safe to
report. Access to cache and transaction information during monitor context
processing is done in a thread-safe fashion so it does not impact system performance
and stability of other sessions and the system as a whole.
Monitoring Memory
The monitor memory command issues memory statistics for the RMI server:
monitor memory;
Only users with System Administrators privileges can execute the monitor memory
command.
Version 10 119
Viewing Configuration Diagnostics
When each Matrix kernel starts, an automated configuration checker will report server
configuration problems in the Matrix environment that can cause severe performance
degradation or server shutdowns. The checker writes diagnostic information to an
mxAudit.log file. Users can view the mxAudit.log file and additional diagnostic
information using the following MQL commands:
• print config, which generates configuration messages to the console or to a file.
If the file specified is mxAudit.log it will append its information after the warning and
critical messages already written to mxAudit.log at server startup time.
• zip config, which creates a zip file containing all known configuration files and
the mxAudit.log file.
Since these commands are used to assist in troubleshooting the Matrix environment,
information about these commands and the settings they check can be found in the
Troubleshooting chapter of the Matrix PLM Platform Installation Guide.
Because there are a number of factors that can cause a database failure, including power
loss, hardware failure, natural disasters, and human error, it is important that you develop
both a backup and a recovery plan to protect your Matrix database. It is not enough that
you develop a recovery plan, however. You must also test that recovery plan to ensure that
it is adequate before your data is compromised. Finding out that your recovery plan is
inadequate after you have already lost your data will not do you much good. Also, testing
of the recovery plan may indicate changes you need to make to your backup strategy.
It is highly recommended that inventories of all stores are performed nightly as part of the
backup procedure. Refer to Inventory Store Statement for details.
Refer to the Matrix System Manager Guide for more information on developing a backup
strategy.
Version 10 121
122 MQL Guide
4
Working With Vaults
Vault Defined................................................................................................. 124
Kinds of Vaults.............................................................................................. 125
Business Object Vaults................................................................................... 125
Administration Vault........................................................................................ 125
Defining a Vault............................................................................................. 126
Description Clause.......................................................................................... 126
Icon Clause..................................................................................................... 127
Vault Types..................................................................................................... 127
Tablespace Clause ......................................................................................... 128
Indexspace Clause ......................................................................................... 128
Server Clause ................................................................................................. 128
Interface Clause.............................................................................................. 128
File Clause...................................................................................................... 128
Map Clause..................................................................................................... 129
Hidden Clause ................................................................................................ 129
Property Clause .............................................................................................. 129
Modifying a Vault Definition ........................................................................ 130
Modifying a Vault Definition ............................................................................ 130
Clearing and Maintaining Vaults ................................................................. 131
Clearing Vaults ............................................................................................... 131
Indexing Vaults ............................................................................................... 131
Fixing Fragmented Vaults............................................................................... 132
Updating Sets With Change Vault .................................................................. 132
Printing a Vault Definition ............................................................................... 133
Deleting a Vault............................................................................................. 134
Version 10 123
Vault Defined
A vault is a grouping of similar objects within the Matrix database, as well as a storage
location for metadata which identifies those objects. For example, in an insurance
company, a vault might contain insurance forms of a similar type or from a single
geographical area. In an engineering environment, a vault might contain all objects related
to a particular project or family of products. In a bank, a vault might include all accounts
of a particular type or loans made during a particular period.
The Business Administrator determines what the vault is for, while the System
Administrator defines where the vault is located on the network. Vaults should use actual
host and path names, not mounted directories. Paths must be exported on the host to all
users who require access to the vaults.
Information on how vaults are defined, modified, viewed, maintained, and deleted is
presented in the sections that follow.
You must be a System Administrator to access vaults. (Refer also to your System Manager
Guide.)
Business Object Business object vaults are used to organize business objects within your database. How
Vaults you do so will depend on the types of objects you use and the relationships they have to
one another.
Vaults contain metadata (information about objects), while stores contain the application
files associated with business objects.
All vaults contain a complete set of Matrix definitions. These definitions identify the
characteristics of items such as persons, roles, types, formats, etc. When you make
changes to a definition (such as add, modify, or delete), all definition copies must be
updated to reflect the change. This update of the vaults occurs simultaneously if all the
copies are available. If any of the copies are not available (a vault is not available), you
cannot alter the definitions. This prevents partial alteration of the Matrix definitions.
For example, assume you want to add a new format definition. After you enter the Add
Format statement, Matrix will attempt to add the definition. If the definition is valid (no
errors), all copies of the Matrix definitions are changed to include this new format. But
assume that a vault resides on a host that is currently offline. In this case, no changes to the
definitions are made. If changes were allowed, the one vault would not be updated to
contain the change. Therefore, you should ensure that all defined vaults are available
before modifying the Matrix definitions.
Administration The Administration vault is used for administrative purposes only and serves as the master
Vault definition vault. It is created automatically when Matrix is installed on your system.
Unlike other vaults, the Administration vault is not listed among the available vaults when
a person uses the Vault Chooser to specify a vault when setting context, performing
queries, or creating new objects in Matrix Navigator or Web Navigator. The
Administration vault is used for definitions only. You cannot use it for storing business
objects.
Version 10 125
Defining a Vault
NAME is the name of the vault you are creating. All vaults must have a unique name in the
database. The name can be up to 127 characters long and can contain spaces. Since you
have this flexibility in naming the vault, you should assign a name that has meaning to
both you and the users.
For example, each of the following is a valid vault name:
Northeast Regional Area
Housing Projects
ADD_ITEM is an Add Vault clause that provides more information about the vault you are
creating. Although none of the clauses is required to make the vault usable, they are used
to define a vault location other than the current default host and path. In addition, the
clauses can help users understand the purpose of the vault.
The Add Vault clauses are:
description VALUE
icon FILENAME
indexspace SPACE
tablespace SPACE
server SERVERNAME
interface LIBRARYFULLPATH
file MAPFILENAME
map STRING
[!|not]hidden
Each clause and the arguments they use are discussed in the sections that follow.
Description The Description clause of the Add Vault statement can provide general information about
Clause the functions covered by the vault. It can also help point out subtle differences between
vaults to the user. If a user is assigned the wrong vault, s/he may not have access to the
business objects needed. Therefore, it is important to distinguish the vaults well.
For example, assume there are two vaults that contain information about Connecticut
telephone customers. One is named “Waterbury Telephone Area” and the other is named
“New Haven Telephone Area.” These names were chosen because they represent areas
Icon Clause Icons help users locate and recognize items by associating a special image with a vault.
You can assign a special icon to the new vault or use the default icon. The default icon is
used when in view-by-icon mode. Any special icon you assign is used when in
view-by-image mode. When assigning a unique icon, you must use a GIF image file.
Refer to Icon Clause in Chapter 1 for a complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
For example, you may want to use a company logo for the vault that contains objects
related to doing business with that company. You could use a project logo for a project
oriented vault, or an object icon (such as a tax form) for the vault containing those type
objects.
Vault Types There are three type of vaults: local, remote, and foreign. Most vaults are local. Remote
vaults are used for loosely-coupled databases, which allow two entirely different Matrix
installations to share data. Foreign vaults are used with Adaplets™, which allow data from
virtually any source to be modeled as Matrix objects.
When defining a vault in MQL, you don’t need to specify which type it is and there is no
clause that allows you to specify the type. The system knows which type of vault you are
defining by the parameters you specify for the vault. For local vaults, you define Oracle
tablespaces using the Tablespace and Indexspace clauses. For remote vaults, you specify
the server using the Server clause. For foreign vaults, you specify tablespaces, and
Interface and Map fields (using the Interface and Map clauses). All these clauses are
described in the following sections.
Version 10 127
Tablespace Clause The Tablespace clause is used to specify the Oracle tablespace in which the data tables for
the vault are stored.
The names of the tablespaces and their associated storage are defined by the database
administrator (DBA). This must be done prior to defining vaults. If you do not specify a
tablespace name, the default data tablespace is used.
Refer to the Matrix System Manager Guide for information on setting up tablespaces to
optimize performance.
Indexspace Clause The Indexspace clause is used to specify the Oracle tablespace in which the index and
constraint information for the vault is stored.
The names of tablespaces and their associated storage are defined by the database
administrator (DBA). This must be done prior to defining vaults. If you do not specify a
tablespace name, the default index tablespace is used.
Refer to the Matrix System Manager Guide for information on setting up tablespaces to
optimize performance.
Server Clause The Server clause of the Add Vault command is used to define the server for a remote
vault. Most vaults will be Local; Remote vaults are vaults mastered in a Loosely-Coupled
Database. Refer to Sharing Data Between Federations in the System Manager Guide for
more information.
Interface Clause The Interface clause of the Add Vault command is used to define the full path name of the
library for a foreign vault. The Interface should be specified as MATRIXHOME/api/
mxff/mxff, with no extension. The .dll or shared library file is then used to access the
vault, depending on whether the client is a Windows or a UNIX client.
Note that this field cannot be modified once the vault has been created. If changes are
required, the vault must be deleted and then recreated. Deleting foreign vaults deletes only
the Matrix/database tables associated with it. The data from the foreign federation is left
intact.
The interface can be used in more than one vault definition, but only by making a copy of
it with a different name. For example, if the mxff interface will be used to link a second
database with Matrix (presumably with a different mapping), a copy of mxff should be
created and renamed, and then referenced in the second foreign vault definition.
Use of the same interface (of the same name) by more than one vault will cause problems
when accessing business objects.
File Clause The File clause of the Add Vault command is used to define the map filename.
Map Clause The Map clause of the Add Vault command is used to specify a string to define the
schema map.
The schema map indicates which metadata in the foreign data maps to what types of data
in Matrix. It becomes part of the vault definition and is always referred to when accessing
the data. The Map clause specifies the server, mode, and each table in the data source.
Refer to Mapping the Data in the Building Adaplets to Other Federations: A
Programmer’s Guide for more information.
Hidden Clause You can specify that the new vault is “hidden” so that it does not appear in the Vault
chooser in Matrix. Users who are aware of the hidden vault’s existence can enter its name
manually where appropriate. Hidden objects are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the vault. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add vault NAME
property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 129
Modifying a Vault Definition
Modifying a Vault After a vault is defined, you can change the definition with the Modify Vault statement.
Definition This statement lets you add or remove defining clauses and change the value of clause
arguments:
modify vault NAME [MOD_ITEM {MOD_ITEM}];
Each modification clause is related to the clauses and arguments that define the vault.
When modifying a vault, you first name the vault to change and then list the changes to
make. For example, the following statement assigns new name and description to the vault
called The Cleveland Project.
modify vault “The Cleveland Project”
name "The San Diego Project"
description "Includes data for San Diego area."
file c:\Matrix\scott.map;
Clearing Vaults The Clear Vault statement is used to delete all business objects and associations in a vault:
clear vault NAME [,NAME];
Indexing Vaults The Index command should be used periodically, after modifications and deletions, to
clean up the database indices.
index vault NAME [table TABLE_NAME] [indexspace TABLESPACE_NAME];
Re-indexing vaults can improve find performance whether or not transaction boundaries
have been used in the data loading process. If data is loaded from a sequentially sorted
data file, the resulting index will be less than optimal. Re-indexing randomizes the index,
making find performance noticeably better. Indexing a vault in this manner rebuilds the
system indices that must be present for locating objects by name, type, and owner, as well
as other indexed fields.
To show the SQL commands for a particular index vault command, without actually
changing the indices, use the validate index vault command as follows:.
validate index vault NAME [table TABLE_NAME] [indexspace TABLESPACE_NAME];
This is helpful to use on very large databases, where indexing a vault may take many
hours. The validate output shows the SQL commands that need to be run. You could then
manually run the commands in order, to make progress with minimal disruption.
Each clause is described below.
table clause
Include the table clause to indicate which database tables should be re-indexed. Only
those columns that have indexing defined will be re-indexed. You should include up to
and including the “_” in a table name, since what follows is specific to the the vault
specified. For example:
index vault "Engineering-1" table lxbo_;
Version 10 131
indexspace clause
Use the indexspace clause to specify an alternate database tablespace to use for
processing this command. For example:
index vault “Engineering-1” table lxbo_ indexspace USER_DATA;
Fixing Fragmented As objects are deleted from a vault, storage gaps will occur in the vault database file.
Vaults These gaps represent wasted disk space and can cause an increase in access time. MQL
provides the tidy vault statement to fix fragmentations in the database file of the
vault.
tidy vault NAME [commit N];
NAME is the name of the vault you want to fix. You can specify the ADMINISTRATION
vault to remove unused records of deleted administration objects.
When this statement is executed, Matrix consolidates the fragmented database file. It
deletes rows in the database tables that are marked for deletion.
commit N clause
Include the commit N clause when tidying large vaults. The number N that follows
specifies that the command should commit the database transaction after this many objects
have been tidied. The default is 1000. For example:
tidy vault “Engineering” commit 200
Since the tidy vault statement creates a temporary database file in the location of the
vault while it is running, it requires free disk space equal to the size of the original
database file.
Updating Sets When an object’s vault is changed, by default the following occurs behind the scenes:
With Change Vault • The original business object is cloned in the new vault with all business object data
except the related set data
• The original business object is deleted from the “old” vault.
When a business object is deleted, it also gets removed from any sets to which it belongs.
This includes both user-defined sets and sets defined internally. IconMail messages and
the objects they contain are organized as members of an internal set. So when the object’s
Once this command has been run, when users change an object’s vault via any application
(that is, all MatrixOne applications, Matrix desktop, Web Navigator, and other custom
ADK programs), all IconMails that reference the object are fixed.
You can also fix IconMail at the time the change vault is performed (in MQL only). For
example:
modify bus Assembly R123 A vault Engineering update set;
Printing a Vault The Print Vault statement prints the vault definition to the screen allowing you to view it.
Definition When a Print statement is entered, MQL displays the various clauses that make up the
vault definition and their current values.
print vault NAME;
Version 10 133
Deleting a Vault
If a vault is no longer required, you can delete it with the Delete Vault statement:
delete vault NAME;
After this statement is processed, the vault is deleted and you receive an MQL prompt for
another statement.
Version 10 135
Store Defined
A store is a storage location for checked-in application files. All files checked in and used
by Matrix are contained in a file store. These files can contain any information and be
associated with any variety of business objects. A file store simply defines a place where
you can find the file. You can define file stores for CAD drawings, documentation files,
problem reports, and so on.
A store is used to divide the database for improved performance. The amount of control
Matrix has over the physical storage, retrieval, and security of a file is dependent on the
type of store used. A file store provides:
• Information on the physical storage location of a file checked into Matrix. Stores, like
vaults, should be strategically placed within the network topology.
• Access to that information. Consider disk storage requirements—the store contains
more data than typically found within the vault.
• Three optional storage methods. Three different types of stores (ingested, captured,
and tracked) provide varying degrees of file security, performance, and access.
• Access to files using NFS or FTP. Captured stores can be configured to use NFS or
FTP for file access. In addition, this type of store can have alternate locations where
the data is replicated, improving access to it from distant sites. Refer to Captured
Store Replication in Chapter 6.
• Full text search. A captured store can be configured to provide full text search
capabilities for the files it contains. Indexing software is also required.
If the store is to be physically located on a PC and accessed through a network drive, the
store host name must be set to LOCALHOST.
Multiple file stores are possible at different locations. For example, two or more file stores
could contain CAD drawings. These stores might be located on the same host or on
different hosts. An object’s policy determines the store that is used for its files.
A lock feature enables you to lock a store from the user for all write activities. Business
objects with a policy using a locked store cannot have files checked in (written), but files
can be checked out (read). This is useful when a store becomes obsolete. Stores are
unlocked by default.
For information on replacing a store with a new store, see Implications of Changing Stores
in Chapter 6.
Stores should use actual host names and paths, not mounted directories. (However, you
may want to use mounted directories for tracked stores. This will make the files seem local
and behave better for launching open/edit/etc.)
Captured Files A captured file store contains captured files. A captured store offers a bit more flexibility
than an ingested store in regard to system control while still taking advantage of Matrix’s
file and access control. Captured files are maintained by Matrix and are subject to the
access rules defined in the policy that governs the file associated with the business object.
The primary means of accessing the file is from Matrix although it is possible to access it
from the file system.
Captured stores provide some features that are not available to other types of stores. FTP
can be used in addition to NFS or UNC paths as the method of accessing files from remote
systems. In addition, full text search of file content can be configured only for captured
stores. Replication of file stores for use with WANs is only supported by captured stores.
Filename hashing
Captured stores can use file name hashing, which is the ability to scramble the file name.
When file name hashing is on (the default), captured stores generate hashed names for
checked in files based on a random number generator and timestamp. If a name collision
occurs, it will retry with a new hashname up to 100 tries, then return an error. Since the
files for captured stores are physically stored on disk, the names are hashed to be
recognized by Matrix only.
When file name hashing is off, the file names appear in the protected captured directory
with original file names. Unhashed file names collide in a store more often than when
Matrix generates unique hashed file names for each checked-in file. Since two physical
Version 10 137
files of the same name cannot reside in a single directory, Matrix will scramble the name
of one copy whenever a collision would occur.
Ingested Files An ingested file store contains ingested files, which are completely controlled by Matrix.
The information within the files is subject to Matrix access control. This results in the
fastest processing times and the simplest file maintenance. Once a file is ingested, it can
be retrieved only using Matrix and cannot be accessed using any of the system file
utilities.
Ingested stores should not be used for very large files (that is, files measured in
gigabytes).
Tracked Files A tracked file store contains tracked files, which provide the least amount of Matrix
control. Matrix maintains information about the file but does not control the physical file
itself—the naming, maintenance, and general access is controlled external to Matrix. A
tracked file maintains the maximum amount of external control while allowing some
access from within Matrix.
When a file is placed in a tracked file store, it becomes accessible to other Matrix users
based upon the policy assigned to the business object associated with the file. For
example, if the business object’s policy allows group access, any file associated with that
business object can be accessed by members of the defined Matrix group. This is true even
if no external (outside of Matrix) access is allowed by the file owner.
When using tracked files, direct physical access of a file via a system file utility can
disrupt Matrix access. If you rename, alter, or move any physical file, you will have to
check in the file again to maintain Matrix access. If you don’t, when file access is
attempted via Matrix, errors will occur
Version 10 139
Defining a Store
NAME is the name of the store you are defining. All stores must have a name unique in the
database. The name can be up to 127 characters long and can contain spaces. You should
assign a name that has meaning to both you and the user. For example, each of the
following is a valid file store name:
Electronic CAD Drawings
X29 Development
Income Taxes
ADD_ITEM is an Add Store clause that provides more information about the store you are
creating. The only required clause for store creation is the type clause. Other clauses can
help to further define the store. The Add Store clauses are:
description VALUE
icon FILENAME
type captured|ingested|tracked
filename [not]hashed
[un]lock
path PATH_NAME
host HOST_NAME
protocol PROTOCOL_NAME
port PORT_NUMBER
user USER
password PASSWORD
url VALUE
fcs FCS_URL
tablespace SPACE
indexspace SPACE
[!|not]hidden
Clause Default
filename hashed
host localhost
indexspace default index tablespace (as defined by the DBA)
unlock
path MATRIXHOME
permission rw, rw, rw
tablespace default data tablespace (as defined by the DBA)
Each clause and the arguments they use are discussed in the sections that follow.
Description The Description clause of the Add Store statement can provide general information for
Clause both you and the Business Administrator about the purpose of the store. It can also help
point out subtle differences between stores to the user.
For example, you might have two file stores that contain captured CAD drawing files. One
store might be used for a particular project or group while the other is used for another
project or group. Having a file store for each group can help with performance. Different
groups or projects may have different memory allocation or cleanup requirements. You
can determine the requirements for each and then define them accordingly.
A Description clause should clearly indicate the differences between each store. For
example, you can identify the differences between the file stores and the kinds of files that
might be stored in each example:
add store “Electronic CAD Drawings”
description “Stores captured electronic CAD drawing files”
type captured;
add store “Vellum CAD Drawings”
description “Stores vault locations of hardcopy CAD drawings”
type tracked;
add store “X29 Development”
description “Stores ingested files related to development of X29 solar
vehicle”
type ingested;
Icon Clause The Icon clause of the Add Store statement associates an image with a file store. Icons
help users locate and recognize items. You can assign a special icon to the new store or
use the default icon. The default icon is used when in view-by-icon mode. Any special
icon you assign is used when in view-by-image mode. When assigning a unique icon, you
must use a GIF image file.
For example, you may want to use a project icon for the file store used by that project or
an icon that represents the types of files found in the file store (a drawing icon for drawing
files, a paper and pen icon for text files, and so on.). Refer to Icon Clause in Chapter 1 for
a complete description of the Icon clause.
Version 10 141
GIF file names should not include the @ sign, as that is used internally by Matrix.
Type Clause The Type clause of the Add Store statement identifies how the files are stored and
accessed. You can specify one of the three file storage types: ingested, captured, or
tracked (as described above).
Matrix is not responsible for tracked files. This can make backups much more difficult—
the System Administrator must ensure that all physical files assigned to the tracked file
store are backed up.
Once you decide how to store and control your files, you can specify the store type by
adding a Type clause to your Add Store statement. All file store definitions must have a
Type clause to be usable. The following example creates a store to hold captured files:
add store Drawings
description “Storage for electronic drawings”
host RELIABLE
path ${MATRIXHOME}/Drawings
type captured;
Filename Hashed The Filename Hashed clause of the Add Store statement applies when using captured
Clause stores only. It enables you to scramble the file name. When file name hashing is on
(hashed), captured stores generate hashed names for checked in files. Since the files for
captured stores are physically stored on disk, the names are hashed to be recognized by
Matrix only. For example:
add store “Electronic CAD Drawings”
type captured
filename hashed;
When file name hashing is off (nothashed), the file names appear in the protected
directory as the original file names. For example:
add store “Electronic CAD Drawings”
type captured
filename nothashed;
Unhashed file names will collide in a store more often than if Matrix generates unique
hashed file names for each checked-in file.
Version 10 143
Lock Clause The Lock clause locks a store from the user for all write activities. Business objects with a
policy using a locked store cannot have files checked in (written), but files can be checked
out (read). This is useful when backups are being made or when a store is full.
add store “Vellum CAD Drawings”
locked
type ingested;
Path Clause The Path clause of the Add Store statement identifies where the file store is to be placed
on the host. The Path clause is required for captured stores. Paths should not include the @
sign, as that is used internally by Matrix.
Stores should use actual host names and paths, not mounted directories. (However, you
may want to use mounted directories for tracked stores. This makes the files seem local
and behave better for launching open/edit/etc.) The location of captured stores must have
the path exported to all users that need access to the files, or captured stores can be
accessed via FTP.
A captured store will create a directory for the captured files. If the captured store will be
accessed via FTP, the Path can be relative to the FTP username login, but not necessarily
the root directory of the FTP server system. For example, if the Path is specified as
Drawings, and doing an FTP login puts you on the host machine in the usr/matrix
directory, the FTP store would be physically located in usr/matrix/Drawings. An absolute
path can also be entered; however, the parent directory must already exist. For example, if
the FTP Store path is specified as “/stores/store1/” and the “/stores” directory does not
exist on the target host, the store will not be created.
The FTP server must use UNIX directory listing option, even on NT. DOS directory style
is not currently supported.
An ingested store does not create a directory. It creates a file in an existing directory into
which it will ingest the checked in files.
The following Add Store statement creates a file store located in the MATRIXHOME
Training subdirectory on the Reliable host:
add store Training
description “Storage for training information”
host Reliable
path ${MATRIXHOME}/Training
type captured;
When a file is checked into a hashed captured store or location, a 2-level directory
structure is created below the store/location’s directory. Each subdirectory name is
derived from the hashed file name and is 2 characters long. The first 2 characters of the
hashed name are the first level subdirectory name; the 3rd and 4th characters are the
second level subdirectory name. For example, a captured and hashed store named Docs is
defined to use the directory Docs. A file is checked in that uses this store and the hashed
Host Clause The Host clause of the Add Store statement identifies the host system that is to contain the
file store being defined. If you want to use the host on which you are currently working,
you do not need to include this statement. If a host is not specified, the current host is
assumed and assigned. Host names should not include the @ sign, as that is used internally
by Matrix.
If the store is to be physically located on a PC and accessed through a network drive, the
store host name must be set to localhost.
A host is not necessary for a tracked store because each tracked file would contain its own
path/host specification.
File stores can be created and can exist across networks. Depending on who uses a file
store, you might install it on a system local to its users. That speeds up access and avoids
placing additional loads on network communications.
File stores that are frequently used by all nodes within a network should be contained on a
centrally located node. If a file store is used extensively by one system, you may want to
place the store on that system to improve access time and communications requirements.
For example, the following statement defines a store (Video) that resides on the system
called Reliable in a directory defined by the environment variable MATRIXHOME:
add store Video
description “Storage for video data”
host Reliable
path ${MATRIXHOME}
type captured;
Protocol and Port When creating a captured store, you can include the parameters protocol and port
Clauses (the same is true for locations).
protocol PROTOCOL_NAME
You can enter ftps as a protocol value only if secure FTP is enabled on your system. See
Enabling Secure FTP for a Captured Store.
Each protocol has a default port that is used if not specified in the store definition. Include
the port clause to specify a port other than the default.
port PORT_NUMBER
Version 10 145
In support of this change, as of version 9, file names in error messages no longer use the
Matrix-specific format:
/DIR/NAME@SERVER
but will now use a Web-like URL:
PROTOCOL:/LOCATIONHOSTNAME:PORT/LOCATIONPATH/FILENAME
For example:
add store NFSStore type captured host Reliable
path ${MATRIXHOME}/NFSStore protocol NFS;
If a store/location does not have a protocol specified, Matrix looks at other object
attributes to determine which protocol was likely intended.
• If the host is ‘localhost’ (or empty), the protocol used will be ‘file’ (local file system).
• If the host is not ‘localhost’ and a username/password was given, then the store will
use ftp.
• If the host is not ‘localhost’ and there is no username/password, the store will use
nfs.
Note these checks eliminate the need to add protocol/port parameters to store/locations
added prior to version 9.
Permission Clause For captured store only, the Permission clause specifies who will have the ability to read,
write, or execute a database being stored. There are three categories of users:
• Owner
• Group
• World
These categories are assigned and controlled by your operating system. They are not the
same as an Owner or Group within Matrix—instead, Owner and Group are categories that
define access (as described below).
The Permission clause uses the following syntax:
permission OWNER_ACCESS [,GROUP_ACCESS [,WORLD_ACCESS]]
The default is rw, rw, rw which indicates Owner read/write access, Group read/write
access, and World read/write access.
If you are specifying permissions, you must include at least the Owner Access. If you
choose to define Group Access or World Access, the Owner Access or Owner and Group
Access must precede it, respectively.
In the first example, only the owner of the files has read and write access to them. In the
second example, the file owner has read and write access while the group has only read
access. In the third example, both the owner and group may read and write, and everyone
else has read access.
When setting the values for the permission, you need to know how ownership of the
database files are assigned from within the operating system. If they were assigned to a
single owner, you will want to set the Owner values for full access. If they were assigned
to a group, the group should have full access.
User and The User and Password clauses are used to specify the FTP username and password.
Password Clauses When moving files to/from a captured store, the FTP username defines FTP account users
for the store. If FTP information is not provided, the system uses NFS to move files. The
FTP password provides access to the FTP account.
Before an FTP store can be used, the store’s host system must be configured to act as an
FTP server, and the FTP Username and Password specified here must be established.
Matrix has FTP client functionality built in so no additional software or configuration is
necessary on the Matrix workstations. See your operating system documentation for more
information on installing and configuring FTP.
URL Clause To implement URL full text searching, a URL must be defined in captured Stores. The
URL is in the form of a CGI-bin request. It is assumed that the CGI-bin program and the
indexing engine used by the URL is installed and administered independently of Matrix.
Each Store should specify the following URL:
http://${HOST}/matrix/mxis.asp?ct=${LOCATION}&qu=${QUERY}&mh=${LIMIT}
During query evaluation, these variables are expanded as follows:
• LOCATION is expanded to the name of the Matrix store object
• HOST is expanded to contain the host of the Matrix store object
• QUERY is expanded to contain the search string
• LIMIT is expanded to contain the contents of the MX_FULLTEXT_LIMIT variable
in each users’ initialization file
If you are using FTP stores, the paths will vary from the paths used to create the
directories for the index server catalog.
Version 10 147
Matrix.ini Settings
Some search engines may need more information than provided with the basic URL
shown above. Additional common parameters to be used with the full text search
integration can be set in the Matrix.ini file and added to the URL specified in the store. For
example, MODE, LIMIT, and MINSCORE settings can be passed to a search engine by
setting the following variables in the .ini file:
• MX_FULL_TEXT_MODE
• MX_FULL_TEXT_LIMIT
• MX_FULL_TEXT_MINSCORE
The URL should be modified using variable syntax. For example, to add the MINSCORE
setting use:
http://${HOST}/matrix/mxis.asp?ct=${LOCATION}&qu=${QUERY}&mh=${LIMIT}
&score=${MINSCORE}
The possible values for these variables depend on the search engine used. However, many
have the concepts of a simple versus a complex MODE, a LIMIT to the number of files to
return, and a MINSCORE value which the file must meet. Also, up to three additional
parameters can be passed to the search engine using the ARG1, ARG2, and ARG3
variables in the .ini file.
If you set any of these variables in the .ini file and add them to the URL of the store,
Matrix will provide them to the search engine, but the search engine will then be
responsible for interpreting the settings.
Refer to Enabling Text Searches on Captured Stores in the Matrix System Manager Guide
for more information.
FCS Clause If using Enhanced FCS (EFCS) for file checkins and checkouts with a captured store, you
must specify the URL for the store’s server.
For J2EE, include the Web application name. The syntax is:
fcs http://host:port/WEBAPPNAME
For example:
fcs http://host:port/ematrix
If using Single Sign On (SSO) with EFCS, the FCS URL should have the fully qualified
domain name for the host. For example:
fcs http://HOSTNAME.matrixone.net:PORT#/ematrix
You can also specify a JPO that will return a URL. For example:
fcs ${CLASS:prog} [-method methodName] [ args0 … argN]
For information about EFCS processing, see the System Manager Guide.
Tablespace Clause The Tablespace clause is used to specify the Oracle tablespace in which the data tables for
the ingested store reside.
The names of the tablespaces and their associated storage are defined by the database
administrator (DBA). This must be done prior to defining vaults. If you do not specify a
tablespace name, the default data tablespace is used.
Indexspace Clause The Indexspace clause is used to specify the Oracle tablespace in which the index and
constraint information for the ingested store resides.
The names of tablespaces and their associated storage are defined by the database
administrator (DBA). This must be done prior to defining vaults. If you do not specify a
tablespace name, the default index tablespace is used.
Refer to the Matrix System Manager Guide for information on setting up tablespaces to
optimize performance.
Hidden Clause You can specify that the new store is “hidden” so that it does not appear in the Store
chooser in Matrix. Users who are aware of the hidden store’s existence can enter its name
manually where appropriate. Hidden objects are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the store. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add store NAME
property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 149
Enabling Secure FTP for a Captured Store
Secure FTP (FTPS) builds on the standard FTP protocol by adding strong encryption and
authentication methods, providing secure password management and encrypted file
content between the client and the server. Matrix can be used to communicate via secure
FTP using the secure FTP server provided by the Stanford Secure Remote Password
(SRP) Authentication Project.
MatrixOne has qualified the secure FTP support using version 1.7.2 of the SRP server on
the HP platform only.
The main tasks for configuring Matrix to support secure FTP are:
1. Download and install the OpenSSL toolkit.
2. Download and set up the SRP version 1.7.2 server.
3. Configure Matrix as a secure FTP client by defining a secure FTP store.
There may be a significant performance impact if you choose to encrypt file content,
which is the default configuration. To turn off data encryption but still have username/
password hashed, you can use the NO_ENCRYPTION option. This option is a compile
time flag on the server.
Building the FTP server requires the compilers/linkers appropriate for the chosen
platform, as specified in the SRP Project documentation.
4. Install the resulting binary server/daemon and password following the instructions in
the provided documentation.
5. Qualify the build/installation independently from Matrix using any FTP client. The
SRP Project site provides a secure FTP client you can use to test the server. Also
confirm that the system on which the SRP is installed can be connected to using any
of the other tools your company may require to access the system, such as ordinary
FTP, telnet, mount, automount (from UNIX systems), mapped drives (Windows),
remote login, remote shell, xwindows (unix) and emulators (Windows).
Don’t attempt to connect using Matrix until you are sure the SRP server works correctly.
Make sure the SRP server works with a standard FTP client before attempting to use the
Matrix client.
Version 10 151
Modifying Store Definitions
Modifying a File After a file store is defined, you can change the definition with the Modify Store
Store statement. This statement lets you add or remove defining clauses and change the value of
clause arguments:
modify store NAME [MOD_ITEM {MOD_ITEM}];
As you can see, each modification clause is related to the clauses and arguments that
define the file store. The only modifications that you cannot make to a file store definition
is a change in the store type or the tablespaces used. To change the store type, you must
create a new file store. Once a store type is assigned, it remains in place as long as the file
store exists. When you modify a store, you first name the store and then list the
modifications. For example, the following statement changes the name of the Drawings
store and the path:
modify store Drawings
name “CAD Drawings”
path ${MATRIXHOME}/CADDrawings;
When this statement is executed, the name of the store changes to “CAD Drawings” and
the path is changed to ${MATRIXHOME}/CADDrawings.
Multiple When the MQL upgrade command is run for version 10.5 or higher, all existing captured
directories in and hashed stores and locations are updated to use multiple directories. So files checked
hashed captured into any store from that point on will use the new algorithm for file storage. Files existing
in a pre-Matrix 10.5 database remain in the 8.3 format, in a single directory file system
stores unless they are re-checked into a captured and hashed store that has the
multipledirectories setting turned on. The rehash store command will only
regenerate the name in the existing format. If you wish to re-distribute files based on the
new algorithm, you should create MQL scripts to checkout and then checkin all files. You
can then run these scripts as time and computer resources allow.
You may disable the setting if required, with one of the following commands:
mod store STORE_NAME [!|not]multipledirectories];
mod location LOCATION_NAME [!|not]multipledirectories];
It is recommended that if you need to turn off multipledirectories, you do so only
temporarily, in order to modify integrations that access files. External programs that edit
files should be rewritten promptly using the Matrix ADK.
Therefore, hashed stores/locations have two possible settings:
• multipledirectories (default) will generate 16.3 format hashed filenames in a 2-level
subdirectory structure.
• notmultipledirectories will generate 8.3 format hashed filenames in the single
directory.
A non-hashed store/location will ignore the multipledirectories setting. It will use the
filename given and will always use a single directory. If it is forced to hash a filename due
to a conflict, it will be 8.3 format.
Version 10 153
When the rehash store command is processed on a store that uses multiple directories, the
first 4 characters in the name will not change, since they indicate the subdirectories used to
store the file.
MQL provides two statements that help you maintain file stores: the Tidy Store statement
and Inventory Store Statement.
Tidy Store As files are checked in and, consequently, older versions are deleted, the ingested store
Statement file may become fragmented. The Tidy Store statement defragments the database file.
The Tidy Store statement can also be used in a captured store situation to clean up
obsolete copies of files that might exist in a replicated environment.
tidy store NAME;
Since the tidy store statement creates a temporary database file in the location of the
store, it requires free disk space equal to the size of the original database file.
Inventory Store System Administrators can list the file contents of a store by using the Inventory Store
Statement statement. Additional clauses provide the ability to specify a subset of locations to
inventory. Memory usage remains at a low fixed amount regardless of the size of the store.
The syntax is:
inventory store NAME [location LOCATION_TARGET{,LOCATION_TARGET}] [store];
It is highly recommended that inventories of all stores and locations are performed nightly
as part of the backup procedure.
If files names are hashed, a list is presented containing a mapping of the hashed names to
the original names.
If MQL is running in verbose mode, the output includes:
• The full path of file origination
• The date and time of creation (if the file name is hashed)
• The format of the file and the owning business object.
You can also include the keyword store after the storename to list files stored at the store
itself. For example, the command:
inventory store Assemblies store location Dallas,London;
might result in the following output:
store Assemblies file original
Version 10 155
C:\Designs\widget\SHEET1.PRT captured /matrix/prod/stores/
Assemblies/31b49a45.784 on Tue Apr 4, 1994 4:19:17 PM format
Cadra of business object Assembly 12345 A
The creation date and time for hashed file names correlates to when the database received
control of the file and hashed the name. Keep in mind that there are a number of ways a
file can get into Matrix: through checkin, import, cloning, or revisioning.
If the output indicates that files have been orphaned, contact MatrixOne Customer Service
for help in diagnosing the error.
Rehash Store The Rehash Store statement iterates through each file in a captured store and regenerates
Statement its file name based on the store’s definition. This command is particularly useful under the
following conditions:
• A store is changed from hashed to non-hashed and the administrator wants to restore
the original names of the files.
• A store is changed from non-hashed to hashed and the administrator wants to hash all
the names in the store.
• A URL is added to a store that changes the name hashing algorithm. In this case, the
administrator wants to regenerate the hashed names to be compatible with
full-text-search (that is, the extension is not hashed).
• When hashed files are created in a non-hashed store when importing a business
object, and the administrator wants to quickly change all files in the store back to
non-hashed files.
The command syntax is:
rehash store NAME;
When the rehash store command is processed on a store that uses multiple directories, the
first 4 characters in the name will not change, since they indicate the subdirectories used to
store the file.
Validate Store The Validate Store statement can be used to identify files in a captured store that are not
Command associated with any business object in the Matrix database. The command requires an
input file that lists all files relative to the store’s directory. For multiple directory stores
(the default for captured and hashed stores), the input file can be created from the captured
store directory using the following command from the store directory on Unix:
find -type f -print
For example, your file might look like:
./00/b3/00b30d7774254606.b27
./0036a01d.6ff
./01/11/01119e1b826a714e.0fb
From a DOS prompt on Windows, the input file can be created from the output of:
dir /s /b /a: -d
However, on Windows you will need to remove the drive and store directory from each
file listed. For example, for a store named “distribs” you might have output similar to:
D:\distribs\00\b3\00b30d7774254606.b27
D:\distribs\0036a01d.6ff
D:\distribs\01\11\01119e1b826a714e.0fb
You would need to search on “D:\distribs\” and delete.
Once the input file is created, System Administrators can use the following command:
validate store NAME file FILENAME;
Where:
NAME is the name of a captured store.
FILENAME is an input file that lists all files in a captured store directory.
The validate store command creates a file called FILENAME.out (the same name
as was used for the input filename, except with a file extension of .out), which lists files
that are not associated with business objects. You can then cleanup the store’s directory by
deleting these files.
Monitoring Disk As a System Administrator, you should monitor the disk space available to your stores
Space carefully. If disk space is running low, you could simply change the path or host of the
store, but then you would have to move all checked-in files to the new directory, or users
would receive errors when trying to access the files. A better solution is to change the
store that the policies use.
To replace an existing store
1. Use the following MQL command:
modify store STORE_NAME lock;
2. Create a new store with a host and path that has ample disk space.
3. Determine which policies use the store that needs to be replaced.
Version 10 157
a ) In MQL, run the following command:
list policy * select name store dump |;
The results will look something like:
CMM|Object
Model|Product
Critical Report|Submission
Incident|Submission2
Sequencer|Object
Media|Product
Task|Object
Marketing Documents|Document
Kit|Product
...
b ) Copy the list and paste it into a text editor.
c ) Create a table and sort by the policy column.
4. Modify the policies that use the filled up store to use the newly defined store.
5. Unlock the original store.
New files checked into objects governed by these policies will be put in the new store.
Files that were checked in previously can still be checked out and opened for view, but if
new files are checked in, the new store is used. Refer to Implications of Changing Stores
for more information, particularly if you are using a replicated environment.
If a file store is no longer required, you can delete it with the Delete Store statement:
delete store NAME;
After this statement is processed, the store is deleted and you receive an MQL prompt for
another statement.
Purging Files The Purge Store statement is used to purge files from store locations. The syntax is:
purge store STORE_NAME [continue] [commit N] [location
LOCATION_TARGET{,LOCATION_TARGET}];
If the Purge Store statement is used with just a store name, it does a purge on all locations,
leaving files only in the default place defined in the store object. For example, if you
wanted to purge all files in the store called Maps, you would enter the following MQL
statement:
purge store Maps;
Optional clauses provide more control over which files are deleted. In addition, you can
trace the purge event by using the trace type store command that logs the store’s
events. Refer to Enabling trace tools via MQL for more information.
Each purge store clause is described in the sections that follow.
continue clause
Include the keyword continue if you don’t want the command to stop if an error
occurs. If the log file is enabled, failures are listed in the file. Refer to Enabling trace tools
via MQL for more information. For example:
purge store “Engineering-Dallas” continue;
If an error occurs when using the continue clause, the existing transaction is rolled
back, so any database updates that it contained are not committed. The command starts
again with the next business object. For this reason, when using the continue clause
you should also include the commit clause, described below.
Version 10 159
commit N clause
Include the commit N clause when purging large stores. The number N that follows
specifies that the command should commit the database transaction after this many objects
have been purged. The default is 10. For example:
purge store “Engineering-Dallas” continue commit 20;
location clause
To specify a subset of locations that you want purged, include the location clause. For
example:
purge store “Engineering-Dallas” continue commit 20 location
London,Paris,Milan;
Version 10 161
Captured Store Replication
Modeling of replicated captured stores relies on the creation of locations and sites.
• Locations provide alternate host and path information for captured stores. They can
be added to existing captured store definitions only.
• A site, which is a set of locations, can be added to a person or group definition to
specify location preferences.
There may be times when you need to create a new store to replace an existing store. For
example, the existing store may be running low on space. When you replace a store, you’ll
need to change the policies that reference the old store and have them reference the new
store. That way, all new files that are checked into objects governed by the policies will be
placed in the new store. Refer to Monitoring Disk Space for more information.
Be aware however that the old store will still be used because files checked in before the
policy change will still reside in the old store. Also, if these objects are revised or cloned,
the new revision/clone references the original file and its storage location. When the time
comes for the reference to become an actual file (as when the file list changes between the
2 objects) the file copy is made in the same store the original file is located in.
For systems that use replicated captured stores, files are copied for checkout and open
operations to the locations and sites associated with a file’s store.
Consider this example of a system that has replicated captured stores:
OldStore -> OldLocation1, OldLocation2
NewStore -> NewLocation1, NewLocation2
Site1: OldLocation1, NewLocation1
Site2: OldLocation2, NewLocation2
User1 default: Site1
User2 default: Site2
1. User1 checks file into business object Rev1, which goes to OldLocation1.
2. Change policy to point to NewStore and lock OldStore.
3. User2 revises business object Rev1 to business object Rev2.
4. User2 checks out file in business object Rev2. File is created in OldLocation2 not
NewLocation2.
5. User2 checks in file in business object Rev2. File gets created in NewLocation2. Note
that copy of file in OldLocation2 made in Step 4 does not get deleted.
Version 10 163
Defining a Location
Locations contain alternate host, path and FTP information for a captured store. The host,
path and FTP information in the store definition is considered to be the default location for
the store, while any associated location objects identify alternate file servers.
Think of a location as another store—it is defined as an FTP/NFS or UNC “location.” The
same rules apply as in specifying a store.
A Matrix location is defined with the Add Location Statement:
add location NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the location you are defining. All locations must have a name unique
in the database. The name can be up to 127 characters long and can contain spaces. You
should assign a name that has meaning to both you and the user.
ADD_ITEM is an Add Location clause that provides more information about the location
you are creating. The Add Location clauses are:
description VALUE
host HOST_NAME
icon FILENAME
protocol PROTOCOL_NAME
port PORT_NUMBER
password PASSWORD
path PATH_NAME
user USER_NAME
url VALUE
fcs FCS_URL
[!|not]hidden
Description The description can provide general information for both you and the Business
Clause Administrator about the location. It can also help point out subtle differences between
locations to the user.
Host Clause The Host clause of the Add Location statement identifies the system that is to contain the
location being defined. If a host is not specified, the current host is assumed and assigned.
Icon Clause The Icon clause of the Add Location statement associates an image with a file location.
Icons help users locate and recognize items.
You can assign a special icon to the new location or use the default icon. The default icon
is used when in view-by-icon mode. Any special icon you assign is used when in
view-by-image mode. When assigning a unique icon, you must use a GIF image file.
Refer to Icon Clause in Chapter 1 for a complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Protocol and Port When creating a location object for captured stores, you can include the parameters
Clauses protocol and port.
Protocol and port can be defined when creating a location object for captured stores.
protocol PROTOCOL_NAME
You can enter ftps as a protocol value only if secure FTP is enabled on your system. See
Enabling Secure FTP for a Captured Store in Chapter 5.
Each protocol has a default port that is used if not specified in the location definition.
Include the port clause to specify a port other than the default.
port PORT_NUMBER
In support of this change, as of version 9, file names in error messages no longer use the
Matrix-specific format:
/DIR/NAME@SERVER
PROTOCOL:/STOREHOSTNAME:PORT/STOREPATH/FILENAME
If a store/location does not have a protocol specified, Matrix looks at other object
attributes to determine which protocol was likely intended.
• If the host is ‘localhost’ (or empty), the protocol used will be ‘file’ (local file system).
• If the host is not ‘localhost’ and a username/password was given, then the store will
use ftp.
• If the host is not ‘localhost’ and there is no username/password, the store will use
nfs.
Note these checks eliminate the need to add protocol/port parameters to store/locations
added prior to version 9.
Version 10 165
Password Clause The FTP password provides access to the FTP account.
The Password clause uses the following syntax:
password PASSWORD
Before an FTP store location can be used, the location’s host system must be configured
to act as an FTP server, and the FTP Username and Password must be established.
Matrix has FTP client functionality built in so no additional software or configuration is
necessary on the Matrix workstations. See your operating system documentation for more
information on installing and configuring FTP.
Path Clause The path identifies where the location is to be placed on the host. When a location is
defined, a directory for the captured files is created. If the captured store location will be
accessed via FTP, the PATH_NAME can be relative to the FTP username login, but not
necessarily the root directory of the FTP server system.
For example, you could use the following statement:
path Drawings
In this case, if an FTP login puts you on the host machine in the usr/matrix directory,
the FTP store location would be usr/matrix/Drawings.
An absolute path can also be entered; however, the parent directory must already exist.
For example, in the following statement, if the /stores directory does not exist on the
target host, the location will not be created.:
path stores/store1
Permission Clause Permissions specify read, write, or execute privileges for the new location. There are three
categories of users:
• Owner
• Group
• World
These categories are assigned and controlled by your operating system. They are not the
same as an Owner or Group within Matrix; instead, Owner and Group are categories that
define access (as described below).
The Permission clause uses the following syntax:
permission OWNER_ACCESS [,GROUP_ACCESS [,WORLD_ACCESS]]
In the first example, only the owner has read and write access to the location. In the
second example, the owner has read and write access while the group has only read
access. In the third example, both the owner and group may read and write, and everyone
else has read access.
You must define at least the Owner Access. When setting the values for the permission,
you need to know how ownership of the database files are assigned from within the
operating system. If they were assigned to a single owner, you will want to set the Owner
values for full access. If they were assigned to a group, the group should have full access.
The permission set is used only for NFS. FTP permissions are defined by users who
logged in.
User Clause When moving files to/from a store location, the FTP username defines the FTP account
used.
The User clause uses the following syntax:
user USER_NAME
Before an FTP store location can be used, the location’s host system must be configured
to act as an FTP server, and the FTP Username and Password must be established.
Matrix has FTP client functionality built in so no additional software or configuration is
necessary on the Matrix workstations. See your operating system documentation for more
information on installing and configuring FTP.
URL Clause To implement URL text searching, a URL is stored with Matrix Location objects. The
URL is in the form of a CGI-bin request. It is assumed that the CGI-bin program and the
indexing engine used by the URL is installed and administered independently of Matrix.
Each Location should specify the following URL:
http://${HOST}/matrix/mxis.asp?ct=${LOCATION}&qu=${QUERY}&mh=${LIMIT}
During query evaluation, these variables are expanded as follows:
• LOCATION is expanded to be the name of the Matrixlocation object
Version 10 167
• HOST is expanded to contain the host of the Matrixlocation object
• QUERY is expanded to contain the search string
• LIMIT is expanded to contain the contents of the MX_FULLTEXT_LIMIT variable
in each users’ initialization file
If you are using FTP locations, the paths will vary from the paths used to create the
directories for the index server catalog.
FCS Clause If using Enhanced FCS (EFCS) for file checkins and checkouts with a captured location,
you must specify the URL for the location’s server.
For J2EE, include the Web application name. The syntax is:
fcs http://host:port/WEBAPPNAME
For example:
fcs http://host:port/ematrix
If using Single Sign On (SSO) with EFCS, the FCS URL should have the fully qualified
domain name for the host. For example:
fcs http://HOSTNAME.matrixone.net:PORT#/ematrix
You can also specify a JPO that will return a URL. For example:
fcs ${CLASS:prog} [-method methodName] [ args0 … argN]
Hidden Clause You can specify that the new location object is “hidden” so that it does not appear in the
Location chooser in Matrix. Users who are aware of the hidden location’s existence can
enter its name manually where appropriate. Hidden objects are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the location. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add location NAME
property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 169
Modifying a Location Definition
Modifying a After a location is defined, you can change the definition with the Modify Location
Location statement. This statement lets you add or remove defining clauses and change the value of
Definition clause arguments:
modify location NAME [MOD_ITEM {MOD_ITEM}];
As you can see, each modification clause is related to the clauses and arguments that
define the location.
When you modify a location, you first name the location and then list the modifications.
For example, the following statement changes the permissions of the NY-Documents
location:
modify location "NY-Documents"
permission rw, r, r;
Version 10 171
Deleting a Location
If a location becomes obsolete, you can delete that location by using the Delete Location
statement:
delete location NAME;
Purging Files The Purge Location statement removes all files from the location. For example, if you
wanted to purge all files in the location called Shelton, you would enter the following
MQL statement:
purge location Shelton;
Purge removes the metadata for all the location files and then deletes the location files.
If a location holds the only valid copy of a file, then that file is replicated back to the
store’s default location (the place defined in the store object itself).
Removing a location from a store will perform a purge location before
disassociating the location from the store. Therefore the files are replicated to the store
before the location is removed from the store and the business objects will not lose their
files.
Sites are nothing more than a set of locations. A site can be associated with a person or
group object. When associated with a person, the site defines the list of locations preferred
by a particular person. When associated with a group, the site defines the list of locations
preferred by all members of the group.
In addition, a matrix.ini or ematrix.ini file may contain the following setting:
MX_SITE_PREFERENCE = SITENAME
where SITENAME is the name of the site object.
This setting overrides the setting in the person or group definition for the site preference. It
is particularly designed for use in the ematrix.ini, where all Web clients should use the site
preference of the Matrix Collaboration Server to ensure optimum performance. Refer to
the Matrix PLM Platform Installation Guide for more information.
AMatrix site is defined with the Add Site Statement:
add site NAME [ADD_ITEM {ADD_ITEM}]
NAME is the name of the site you are defining. All sites must have a name unique in the
database. The name can be up to 127 characters long and can contain spaces. You should
assign a name that has meaning to both you and the user.
ADD_ITEM is an Add Site clause that provides more information about the site you are
creating. The Add Site clauses are:
description VALUE
icon FILENAME
[!|not]hidden
Description The description can provide general information for both you and the Business
Clause Administrator about the site. It can also help point out subtle differences between sites to
the user.
Icon Clause The Icon clause of the Add Site statement associates an image with a file store. Icons help
users locate and recognize items.
You can assign a special icon to the new site or use the default icon. The default icon is
used when in view-by-icon mode. Any special icon you assign is used when in
view-by-image mode. When assigning a unique icon, you must use a GIF image file.
Refer to Icon Clause in Chapter 1 for a complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Version 10 173
Member Clause Use the Member Clause of the Add Site statement to add locations to the site definition.
The location named must exist in the database and the spelling and case must match
exactly. If the location name contains embedded spaces, use quotation marks. For
example:
add site member location "Western Division";
Hidden Clause You can specify that the new site is “hidden” so that it does not appear in the Site chooser
in Matrix. Users who are aware of the hidden site’s existence can enter its name manually
where appropriate. Hidden objects are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the site. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add site NAME
property NAME [to ADMINTYPE NAME] [value STRING];
Modifying a Site After a site is defined, you can change the definition with the Modify Site statement. This
Definition statement lets you add or remove defining clauses and change the value of clause
arguments:
modify site NAME [MOD_ITEM {MOD_ITEM}];
As you can see, each modification clause is related to the clauses and arguments that
define the site.
Version 10 175
Deleting a Site
If a site is no longer required, you can delete it. Since deleting a site affects all locations
within that site, it is recommended that you make a backup prior to deletion. This protects
you if you need access to files from that site at a later date. You may need to involve the
DBA in the backup and restore process (if a restore is necessary).
To delete a site, use the Delete Site statement:
delete site NAME;
Synchronization is the means that Matrix uses to ensure that users access the latest
versions of files when checking out or viewing files in a replicated store environment.
Synchronization occurs in one of two ways:
• Matrix automatically synchronizes files for a user’s preferred location during
checkout and open for viewing operations.
• System Administrators can use MQL commands to synchronize files for a business
object or for a store to ensure that all locations contain the most recent copy of the
files.
If you use FTP via the command line to transfer hashed file names and then run a sync
command, Matrix will ignore the files that you have copied or put there. Matrix names the
files as it creates the copies and stores the names in the database, all as part of the sync
operation.
Automatic Synchronization occurs automatically when a person checks out or opens a file for
Synchronization viewing and the file at the user's preferred location is not the latest version. In such a case,
Matrix copies the latest version of the file to the user's preferred location and then checks
out or opens the local file.
Manual In order to publish newly checked-in files to other locations associated with the store,
Synchronization System Administrators must use the sync statement against either the business object or
the store. In such a case, Matrix performs a sync on demand, using one of the following:
• To synchronize using the business object, use the following command:
sync businessobject TYPE NAME REV [to [store] [location
LOCATION_TARGET{,LOCATION_TARGET}]] [from [store][location
LOCATION_SOURCE{,LOCATION_SOURCE]] [update] [overwrite];
This command copies the business object’s files to the specified locations.
• To synchronize using the store name, use the following command:
sync store STORE_NAME [continue] [commit N] [to [store]
[location LOCATION_TARGET{,LOCATION_TARGET}]] [from
[store][location LOCATION_SOURCE{,LOCATION_SOURCE]] [update]
[overwrite];
All files within the named store are copied to the specified locations.
When comparing files between a remote and host store, Matrix looks for the hashed
name that is known to the database, for the business object associated with the store
or location, as well as the file size and permissions.
Do not use the sync bus command within a transaction that also performs a file
checkin or filenames will be hashed.
The sync command clauses and related sync commands are described in the sections that
follow.
Version 10 177
continue clause (sync store only)
Include the keyword continue if you don’t want the command to stop if an error
occurs. If the log file is enabled, failures are listed in the file. Refer to Enabling trace tools
via MQL for more information.
For example:
sync store “Engineering-Dallas” continue
If an error occurs when using the continue clause, the existing transaction is rolled
back, so any database updates that it contained are not committed. The command starts
again with the next business object. For this reason, when using the continue clause
you should also include the commit clause, described below.
to clause
If you want to sync only a subset of all of a store’s locations, include the to location
and/or store clause. For example:
sync bus Assembly R123 A to location London,Paris,Milan store;
When specifying only some locations, a comma (but not a space) is used as a separator.
Including the keyword store indicates that the store itself (default host and path) should
be updated, too.
If an on-demand sync is initiated for multiple locations, the sync will be rolled back if the
sync fails at any of the locations. For example, assume an on-demand sync for five
locations. The first two locations sync, but the third fails because the machine is down.
The fourth and fifth stores will probably not get synched, depending on where the file is
physically located and what order the stores are created in.
• If the file lives in a downed store, none will get synced.
• If the file lives in a store that is online, then the sync will fail when it reaches the
downed store. Any stores that would have been synced after that store will not be
synced.
While the stores that were synced will retain the new file, Matrix will rollback the sync
command and think that only the original location of the file will still have that file. Matrix
will not know of any other locations that now have the file.
If you do not include the to keyword, all locations will be updated, potentially including
those listed in the from clause. You can optionally include the store keyword in either
the from or to clause to include the store’s host and path.
If an on-demand sync is initiated for multiple locations, the sync will be rolled back if the
sync fails at any of the locations, as described above in to clause.
update clause
Use the update clause to copy files only to locations that contain a previous version of
the file. For example:
sync store “Engineering-Dallas” continue commit 20 update
overwrite clause
The overwrite clause, used with the to|from location and/or store
clauses, forces an overwrite of files on those servers. All files are copied to the specified
locations/store without doing a comparison. For example:
sync store “Engineering-Dallas” continue commit 20 from
location London,Paris,Milan to location Moscow,Boston
overwrite;
sync businessobjectlist
Use the sync businessobjectlist clause to specify a list of business objects to
sync:
sync businessobjectlist BUS_OBJECT_COLLECTION_SPEC [continue]
[commit N] [to [store] [location
LOCATION_TARGET{,LOCATION_TARGET}]] [from [store] [location
LOCATION_SOURCE{,LOCATION_SOURCE]] [update] [overwrite];
BUS_OBJECT_COLLECTION_SPEC includes:
| set NAME |
| query NAME |
Version 10 179
| temp query [TEMP_QUERY_ITEM {TEMP_QUERY_ITEM}] |
You can also use these specifications in boolean combinations. Refer to the Expressions
on Queries in Chapter 39 for more information on evaluating expressions.
The keyword businessobjectlist can be shortened to buslist.
For example:
sync buslist set MyAssemblies continue commit 20 to location
London,Paris,Milan store;
Using format.file The proper handling of distributed file stores requires that you be able to identify which of
several locations holds up-to-date versions of a particular file checked into a given
business object.
The file.format select clauses shown below are available to more efficiently manage
on demand synchronization. Using the print bus TNR select command, you can
find all locations that hold up-to-date versions of a particular file in order to sync files
using a specific location.
For example, suppose you have three locations over a WAN and a sync needs to happen to
one location because a user is requesting the file there. You can force sync from the
“nearest” synced location, that is, the location from which the FTP traffic is fastest.
format.file.location
Finds locations which are in the current user’s preferred sites and are sychronized, and
returns the first of them. If no locations satisfy both conditions, returns the first
synchronized one.
format.file.synchronized
Returns all locations holding synchronized versions of the checked in file(s), regardless of
user preference.
format.file.obsolete
Returns all locations holding a copy of the file that has been marked as obsolete (needing
synchronization), regardless of user preference.
When using format.file[FILENAME].*, you can use either of the following
formats for the filename:
• the complete host:/directory/filename.ext from which it was last
checked in.
• just the filename (FILENAME.EXT), which must be unique within this object/
format. This makes the extraction of data specific to a single file much easier.
Tidying all In replicated environments, when a user deletes a file checked into an object (via checkin
locations overwrite or file delete), by default all other locations within that store maintain their
copies of the now obsolete file. You can run the tidy store command to remove
obsolete copies.
Running with system tidy turned on may impact the performance of the delete file
operation, depending on the number of locations and network performance at the time of
the file deletion.
Version 10 181
182 MQL Guide
7
Distributing the Database
Distributed and Replicated Data ................................................................. 182
Preparing for Distribution ............................................................................ 183
System Setup and Installation ........................................................................ 183
Working with Servers ................................................................................... 185
Defining a Server ............................................................................................ 185
Description Clause.......................................................................................... 186
Icon Clause..................................................................................................... 186
User Clause .................................................................................................... 186
Password Clause............................................................................................ 186
Connect Clause .............................................................................................. 186
Timezone Clause............................................................................................ 186
Hidden Clause ................................................................................................ 188
Property Clause .............................................................................................. 188
Modifying a Server Definition ...................................................................... 190
Modifying a Server Definition.......................................................................... 190
Disabling or Deleting a Server..................................................................... 191
Disabling a Server .......................................................................................... 191
Deleting a Server ............................................................................................ 191
Distributing Data Across Servers ............................................................... 192
Setting Up a Distributed Database ................................................................. 192
Considerations.............................................................................................. 194
Network Stability ............................................................................................. 194
Locating the Master Vault ............................................................................... 194
Renaming Servers .......................................................................................... 194
Distribution Problems...................................................................................... 194
Importing Servers ........................................................................................... 195
Should I Use a Link or a Copy? ...................................................................... 195
Using Schema Names .................................................................................. 197
Requirements ................................................................................................. 197
Use Case ........................................................................................................ 197
Version 10 183
Distributed and Replicated Data
While setting up a distributed database is easily executed from Matrix System Manager, it
requires careful preparation by the System and Database Administrator(s). When
distributing a Matrix database across a WAN, or even within one location across several
Oracle servers, communication between all servers must first be established at the
database level. The following guidelines should be used in preparation for distributing a
Matrix database.
System Setup and Obviously, the servers must have the Oracle recommended O/S version installed. While
Installation setting up replication and distribution, it may be helpful to change the system default TCP/
IP parameter for clearing a port. For example, on Solaris, the default is 4 minutes. To see
this, use the command:
%ndd /dev/tcp tcp_close_wait_interval
It should return a value of 240000 by default. To change it to 20 seconds, use the
command:
%ndd -set /dev/tcp tcp_close_wait_interval 20000
This should greatly affect the ability to start a process in a timely manner after stopping it,
which may need to be done frequently when setting up and testing distribution.
Oracle
The Oracle Enterprise Server Software must be installed on each server. A database
instance should be created by the DBA on each server. Consult the Matrix Installation
Guide and Defining Data and Index Table Space in the Matrix System Manager Guide for
guidelines for initialization parameter settings, tablespace sizes, and location of data files,
log files and control files. In addition, add or modify the following setting in the
init<SID>.ora file in all instances:
global_names=false
If you have more than five servers in your distribution schema, you will need to modify
the following statement in the init<SID>.ora file at all participating servers:
open_links = 50
The default is 4; this restricts the number of db_links to 4. The number of db_links is
always one less than the number of servers configured.
Version 10 185
Matrix servers must adhere to Oracle naming conventions. This means that Server names
(as well as Oracle user names) cannot begin with a number. If they do, you will receive the
following error when starting Matrix:
ORA-00987: missing or invalid usernames
However, Matrix Server and Oracle user names may contain a number (for example,
mx7010).
Connect_Strings
Create Oracle database aliases (connect string entries for Matrix) at all servers for all other
servers. On Windows this is done using SQL*Net Easy Configuration. Carefully note the
spelling and case of each entry so that Matrix connect strings in the server definition will
be correct.
Is is essential that each server in a distribution schema is uniquely identified by the exact
same connect string at all participating servers. Server names must NOT contain
embedded spaces.
Verification
Verify using SQL*Plus that each server can connect to each other server, using the user
account set up for Matrix. This confirms the connect string and the Oracle User.
Once the Oracle portion is configured correctly, a Matrix client machine should be set up
and connected to one of the Oracle servers. At this point, the modeling of the servers in
Matrix can begin.
Network
When using synchronized database replication, it is strongly recommended that the
network be stable. We suggest using redundant network paths between synchronized
replicated servers. It is less critical that the network be fast; stability is essential.
In order to distribute a database across a WAN, several Oracle instances are created. Each
Oracle instance will correspond to a Matrix server object. The Matrix server parameters
are:
• Username
• Password
• Connect String
• Time Zone
Based on these settings, users’ connection files can point to any of the servers in the
federation, ideally the one that is physically located the closest. The first three parameters
(Username, Password, and Connect String) establish the Oracle instance that contains the
schema. The Time Zone setting is important when Matrix databases are used throughout
the world. It enables users to see dates and times based on a conversion to their local time
zone. Refer to Time Zone Usage for more information.
It is highly recommended that a Server is created for all Matrix databases, even those that
use only Local vaults. It is required when Remote or Foreign vaults are added, or when
distributing vaults as described in Distributing Data Across Servers.
Currently you cannot distribute Matrix/DB2 databases. However, server objects may be
created to establish a Time Zone.
For administrative work done in the Business, System, or MQL applications, all Server
objects are accessed. For this reason, machines used for these functions must have an
Oracle database alias configured for each server object. For example, for a system with
two Servers with connectstring values of “SanDiego” and “SanJose”, administrator’s
machines must have two Oracle database aliases configured named “SanDiego” and
“SanJose”. Refer to Chapter 2, Installing the Database in the Matrix Installation Guide
for information on adding database aliases.
Defining a Server AMatrix server is defined with the Add Server statement:
add server NAME [ITEM {ITEM}];
NAME is the name of the server you are defining. All servers must have a unique name.
The server name is used as the name of the Oracle link that is created, so it must conform
to Oracle naming conventions. Spaces are not allowed. Server names cannot begin
with a number. They can, however, contain numbers. Consult Oracle documentation for
naming conventions.
ITEM is an Add Server clause that provides more information about the server you are
creating. The Add Server clauses are:
description VALUE
icon FILENAME
user USER_NAME
password PASSWORD
Version 10 187
connect CONNECT_STRING
timezone ZONE
[!|not]hidden
Description The description can provide general information about the purpose of the server. It can
Clause also help point out subtle differences between servers to the user.
Icon Clause Icons help users locate and recognize items. You can assign a special icon to the new
server or use the default icon. The default icon is used when in view-by-icon mode. Any
special icon you assign is used when in view-by-image mode. When assigning a unique
icon, you must use a GIF image file. Refer to Icon Clause in Chapter 1 for a complete
description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
User Clause Use the User clause of the Add Server statement to specify the Oracle User that has been
created for use with Matrix. It was created by the Oracle DBA, as described in Preparing
for Distribution. The User clause uses the following syntax:
user USER_NAME
Password Clause The Password clause of the Add Server statement is used to specify the password that is
associated with the Oracle User. It was defined by the Oracle DBA at the time of User
creation, as described in Preparing for Distribution.
Connect Clause The Connect clause of the Add Server statement is used to specify the Oracle database
Alias. The Oracle Alias was created on the Oracle server by the Oracle DBA. The Oracle
Alias and the connect string entry must exactly match in spelling and case. This is
especially important in a mixed UNIX and NT environment. The Connect clause uses the
following syntax:
connect CONNECT_STRING
Timezone Clause The Timezone clause of the Add Server statement is used to specify the default timezone
for the server. The Timezone clause uses the following syntax:
timezone ZONE
Note that time zones can be set in Matrix Server objects with either the “in relation to
GMT” value, or by their abbreviations. However, use of the abbreviation is recommended
since it will take into account the Daylight Savings time switch, while the offset value
would have to be manually changed when moving between Daylight and Standard times.
Version 10 189
• Converting all times into GMT in the database makes time comparisons legitimate.
• Converting all times into the user’s local time for display is easier for the user.
Times that are generated by the system are handled differently than user keyed-in times.
• System generated times (originated, modified, history, actual, mail) are generated
with the database server’s clock, but they are converted to GMT for storing, and can
therefore be converted properly to the user’s local time zone for display.
• User keyed-in times (attribute, scheduled) are converted to GMT on input and
thereafter converted properly to the user’s local time zone for display.
This will allow the Matrix client, wherever it is, to display all times in its local time zone.
For example, assume a company has clients in San Jose, Boston, and Bonn, all set to their
local time zones. A user in San Jose promotes an object on December 11, 1998, 4:45 pm
(PST). Clients in Boston will read the Actual Date in EST (December 11, 1998, 7:45 pm)
and clients in Bonn will read it in German local time (December 12, 1998, 1:45 am).
Hidden Clause You can specify that the new server is “hidden” so that it does not appear in the Server
chooser in Matrix. Users who are aware of the hidden server’s existence can enter its name
manually where appropriate. Hidden objects are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the server. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 191
Modifying a Server Definition
Modifying a Server After a server is defined, you can change the definition with the Modify Server statement.
Definition This statement lets you add or remove defining clauses and change the value of clause
arguments:
modify server NAME [MOD_ITEM {MOD_ITEM}];
As you can see, each modification clause is related to the clauses and arguments that
define the server.
Disabling a Server Servers in a distributed environment can be disabled to prohibit access to them. Use the
following MQL command:
disable server NAME;
Users will not be able to log on to a disabled server, nor will vaults that are mastered there
be available. This is helpful following the failure of a machine or network, to allow access
in a distributed database. Once the failed systems have been disabled, the surviving
servers can still be used.
After being disabled, the server is taken out of distribution. To re-enable it, use the Server
Distribution Table.
Deleting a Server If a server is no longer required, you can delete it with the Delete Server statement:
delete server NAME;
Version 10 193
Distributing Data Across Servers
When multiple Matrix servers are created, vaults and ingested stores can be distributed or
replicated to another server in the federation. This is done by editing the Server
Distribution Table.
Setting Up a Vaults should be distributed while logged on to the server that contains the master, or
Distributed original, data. Data can be distributed across servers with the modify server
Database statement.
Master Clause
The master server for a vault contains the original Oracle tablespaces for it. Only one
server can be listed as the master for a vault. The following example assigns the Morocco
vault as the master vault for the server Jupiter:
modify server Jupiter
master vault Morocco
Link Clause
A server can connect to a vault located on another server via a link. This is called link
distribution. The Oracle Tables on the master server are accessible to the linked server.
Any number of servers can be linked to a vault on the master server. The following
example allows the server Pluto to connect to the vault Copenhagen.
modify server Pluto
link vault Copenhagen
Vaults should be distributed and replicated while logged on to the master vault’s Oracle
instance.
Version 10 195
Considerations
As stated before, when distributing databases, careful planning is required. The following
sections describe some issues which should be considered when planning the database
distribution schema.
Network Stability Ensure that the network is stable when considering using synchronous replication—low
network bandwidth is less of a negative factor than network instability. This network
distributed database architecture requires redundant network routes between servers. The
database can be disabled for all users if either server goes down, or if the servers can not
communicate with each other. Uninterruptable power supplies should be employed to
protect the network.
If a server or network failure occurs for a synchronized replicated vault, the vault will still
be locally accessible but only in read-only mode until server/network restoration.
Locating the The Oracle server which is located in the LAN with the most Matrix clients should be set
Master Vault up as the Master database server. Since the federation is only as reliable as its weakest
server, it should not be presumed that the master server should be the strongest or best
maintained server, if this is in a central office remote from the users. All servers must be
reliable and well maintained, and proximity to the users should be the overriding factor in
deciding where to locate the master server.
When modifying the Distribution Table to set up links or copies of a vault, the connection
(bootstrap) file of the client machine performing the modification should be pointing at
the server where the Master is located.
You can set a vault to be mastered at any server in the distribution federation. A vault may
be mastered at one server; another vault may be mastered elsewhere.
Renaming Servers If it is necessary to rename a machine that is part of a distribution schema, modify the
database alias rather than define a new one. Simply modify the connect string Alias to
point to the newly named server.
Distribution Distribution problems are typically a result of network or SQL*Net configuration issues.
Problems Prior to distribution, confirm that all servers can assess each other’s Oracle user/password/
connect strings via SQL*Plus. Also edit all server definitions; this confirms that the server
is accessible from the current server.
If a server in a distributed database is lost, or an Oracle user deleted, changes cannot be
made to the database until you disable the failed server. To prohibit access to the failed
server, use the following MQL command:
disable server NAME;
Users will not be able to log on to a disabled server, nor will vaults that are mastered there
be available. Once the failed systems have been disabled, the surviving servers can still be
used.
Importing Servers If a server object is imported (via MQL or Oracle) into a different Oracle instance or user
than it was exported from, the username and password settings of the server must be
modified before distributed access is available. This is particularly important if an
Upgrade will follow the import, since all servers must be accessible to the machine doing
the upgrade.
Should I Use a Both link distribution and synchronous replication have their merits and downfalls when
Link or a Copy? creating a global database environment. Consider the following:
• Read access to data in a linked vault will be somewhat slower than that in a copied
vault, but write transactions will pay the performance penalty when copied vaults are
used.
• If the communications network is down between servers, you can still access data in a
copied vault, although no one on either side of the connection will be able to modify
it. Vaults that your server accesses via a link will not be accessible to you; however,
users connected to its master server will have both read and write access.
• Some vaults and ingested stores may not need to be distributed at all.
• Administrative data must be accessible at all times to all servers.
The sections that follow provide more guidelines on the available distribution methods.
Version 10 197
When to Replicate Data Vaults
Data vaults should be copied to remote sites when the data they contain needs to be
accessed frequently in read and write mode from more than one location. If the business
objects in a particular vault are commonly connected to business objects in vaults
mastered in other locations, it is a good candidate for replication. Users will be best served
by this approach because they will get the complete information as they navigate from
object to object, in spite of temporary network interruptions. Replication will actually
reduce the WAN traffic produced by Matrix clients because clients will be getting their
data from their LAN’s replica of the vault.
Matrix must use database links as a means of connecting different Oracle users when the
users are in different Oracle instances. But since it is very common to setup a distributed,
replicated, loosely-coupled, or open federation all within a single Oracle instance, schema
names can be used instead, which greatly improves performance. Note this is intended
primarily for setting up a demo environment, but it could certainly be used in production,
as long as the requirements listed below can be met.
Both these Server objects are referencing tables in the same Oracle instance. By default,
Matrix will create a database link called Server2 in the Server1 schema and another
database link called Server1 in the Server2 schema, and reference all table names through
the database links. For instance, when a Matrix user connected to Server1 requests the list
of business types stored on Server2, the following SQL command is issued when database
links are in use:
Select * from mxbustype@Server2;
With schema names, instead of using a database link, the system prefixes the table name
with the instance user name. The following SQL command is equivalent to the above
query using schema names:
Select * from user2.mxbustype;
The significant difference is that the transaction is local. A duplicate connection to taurus
is not needed, and the request does not have to go “there and back again.”
Version 10 199
200 MQL Guide
8
Working with Indices
Indexed Attributes and Basics .................................................................... 202
Considerations................................................................................................ 203
Defining an Index.......................................................................................... 204
Description Clause.......................................................................................... 204
Icon Clause..................................................................................................... 204
Attribute Clause .............................................................................................. 205
field FIELD_VALUE ........................................................................................ 206
Unique Clause ................................................................................................ 208
Property Clause .............................................................................................. 208
Modifying an Index Definition...................................................................... 209
Working with an Index.................................................................................. 210
Enabling an Index ........................................................................................... 210
Disabling an Index .......................................................................................... 210
Validating an Index ......................................................................................... 210
Using the index as select output..................................................................... 210
Deleting an Index............................................................................................ 211
Index Tracing .................................................................................................. 211
Version 10 201
Indexed Attributes and Basics
Matrix stores each attribute and “basic” property of an object in a separate row in the
database, allowing flexible and dynamic business modeling capabilities. (Basic properties
include type, name, revision, description, owner, locker, policy, creation date,
modification date, and current state). This has the side effect of requiring extra SQL calls
(joins) when performing complex queries and expands that specify multiple attribute or
basic values. To improve performance of these operations, you can define an index. In
fact, test cases show marked improvement on many types of queries and expands when an
index is in place.
Queries and expands will choose the 1 “best” index to perform the operation. If 2 indices
are equally qualified to perform the operation, the first one found will be used.
An index is a collection of attributes and/or basics, that when enabled, causes a new table
to be created for each vault in which the items in the index are represented by the columns.
If a commonly executed query uses multiple attributes and/or basics as search criteria, you
should consider defining an index. Once enabled, searches involving the indexed items
generate SQL that references the index table instead of the old tables, eliminating the need
for a join.
A query that doesn’t use the first specified item in an index will not use that index.
Therefore, when creating an index, specify the most commonly used item first.
When an index is created or items are added or removed from it, the index is by default
disabled. The new database tables are created and populated when the index is enabled.
This step can be time-consuming; roughly 30 seconds for 100,000 objects. However, it is
assumed that an index will be enabled by a system administrator once when created or
modified, and will remain enabled for normal system operation.
Creating an index is only one way of optimizing performance. A properly tuned database
is critical. While the Matrix PLM Platform Installation and MQL Guides provide some
guidelines and procedures, refer to your database documentation for tuning details.
Write operations of indexed items occur in 2 tables instead of just 1 and so a performance
penalty is paid. This has a negligible effect in cases where end users may be modifying a
few values at a time, but it recommended is that indices are disabled prior to performing
bulk load/update operations. Re-enabling the indices after the bulk update is more
efficient than performing the double-bookkeeping on a value-by-value basis during the
bulk update.
PROS CONS
Excellent for reads. Write performance is impacted (data is
duplicated).
Query execution runtimes are More disc space is required (for duplicate
significantly reduced data).
Table joins are significantly reduced. Greater potential for deadlock during write
operations. (more data in one row as opposed
to separate rows within separate tables).
Item order in the definition of the index is
important, since if the operation doesn’t use
the first item, the index is skipped.
Version 10 203
Defining an Index
NAME is the name you assign to the index. The index name is limited to 128 characters.
unique is a keyword that indicates that a unique constraint is to be placed on the index
table in the database schema. This allows a very efficient mechanism for implementations
to require unique combinations of values on business objects.
Note that the unique setting only applies to objects within a single vault.
ADD_ITEM is an add index clause which provides additional information about the index:
description VALUE
icon FILENAME
[!|not]unique
[!|not]hidden
For example:
add index CostAndWeight
description “Actual Costs and Weight”
icon index.gif
field attribute[Actual Cost],attribute[Actual
Weight],owner;
When you create an index, the mxindex table is updated. The ix tables are not created until
the index is enabled.
Each clause is described below.
Description The description clause of the add index statement provides general information for you
Clause about the function of the index you are defining. Based on the following descriptions, note
the differences between the indices defined:
Index for Finance Query
Index for Project Status Report
Index for Cost Analysis
There is no limit to the number of characters you can include in the description.
Icon Clause Icons help users locate and recognize items. You can assign a special icon to the new
index or use the default icon. The default icon is used when in view-by-icon mode of
System Modeler. Any special icon you assign is used when in view-by-image mode of
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Attribute Clause The attribute clause of the add index statement assigns attributes to the index. These
attributes must be previously defined with the add attribute statement (See Defining an
Attribute in Chapter 12), and may not include multiline attributes. Use the attribute clause
if only attributes will be included in the index. If you will include basic properties, use the
field FIELD_VALUE syntax, described below.
A maximum of 25 items may be placed in a single index, with the caveats described in
Including description in an index. However, a typical index will have between 2 and 5
items. For example:
add index CostAndWeight
description “Actual Costs and Weight”
icon index.gif
attribute “Actual Cost”,“Actual Weight”;
Notice that in this syntax, attribute names are listed separated by a comma but no space,
with the keyword “attribute” used only once. Quotes are needed for names that include
spaces.
Generally, all attributes placed in an index should exist in the same type definitions. For
example, if an index is created with the attributes Cost, Weight, and Quantity, then all
relationships or types that reference Cost, Weight, or Quantity should reference all three
of them. If there is a type or relationship that references only some of the attributes in an
index, a warning is generated. You can proceed with the index creation, but it will take
longer to create an index where this completeness test fails.
There are special rules that apply when including a long string attribute in an index. Since
a string attribute can be any length, and the index tables are constructed using fixed length
columns, string attributes are truncated to 255 characters when written to an index table.
This means that only the first 255 characters are searchable on the index. As mentioned
below, the same applies to descriptions, but these fields are truncated (and therefore
searchable) on the first 2040 characters.
Only the first 255 characters of string attributes and 2040 characters of descriptions are
indexed.
This should not really be a concern, since string attributes designed to hold this much data
are generally defined as “multli-line” and multi-line attributes may not be included in an
index.
Version 10 205
field Field FIELD_VALUE is used when you want to include basic properties in an index.
FIELD_VALUE FIELD_VALUE may be any of the following:
attribute[NAME]
type
name
revision
policy
current
owner
locker
modified
originated
For example:
add index “Shipping Details” unique field attribute[Cost]
attribute[Weight] attribute[Quantity] current owner;
Notice that in this syntax, attributes names are in square brackets and include the keyword
attribute with each one. Also, there is a space but no comma between fields.
You can assign any combination of basic properties (type, name, revision, description,
owner, locker, policy, creation date, modification date, and current state) and defined
attributes to the index, except for multiline attributes. A maximum of 25 items may be
placed in a single index, with the caveats described in Including description in an index.
However, a typical index will have between 2 and 5 items.
The first item in the index determines which objects go into the index table. Also, only
queries and expands that include the first item will ever use it. If the first item in an index
is an attribute, then all business objects and relationships that have that attribute will be
added to the index table. If the first item in an index is a basic property, then all business
objects (since all business objects have basics!) and no relationships are added. Care must
be taken when adding an index that has a basic property as its first field. If there are many
such indices, performance will suffer, and storage requirements may exceed expectations.
Indices defined with a basic property first include all business objects and require
maximum storage facilities. Therefore, adding basic properties first in an index should be
limited to those that include only basic properties.
Generally, all attributes placed in an index should exist in the same type definitions. For
example, if an index is created with the attributes Cost, Weight, and Quantity, then all
relationships or types that reference Cost, Weight, or Quantity should reference all three
of them. If there is a type or relationship that references only some of the attributes in an
Only the first 2040 characters of descriptions and 255 characters of string attributes are
indexed.
Also, there is a database limit to how long the index table’s key can be. The key is the sum
of the column sizes in the index table plus some overhead values. If the key length exceeds
the limit, then you cannot enable the index in Matrix.
While it is possible to have more, most indices should have no more than 5 items.
For Oracle with a max block size of 8k (the recommended value on Solaris), the max key
length is about 3218 bytes. However, the key size is restricted more with Oracle 8i than 9i,
since 8i has more overhead than 9i. For more information see http://www.fors.com/
velpuri2/STORAGE/index.
For DB2, the maximum number of items in an index is 16, with the max key length being
1024.
To calculate the size of the key for the index table you are creating, add together the
potential maximum size of each column, as specified in the table below:
For example, if we wanted to create an index with 13 string attributes and 3 integer
attributes, the key size would be:
13 * 255 + 3 * 4 = 3327 bytes
Version 10 207
In this scenario, the index could not be enabled on either Oracle or DB2. You would either
have to increase the max block size in Oracle from 8K to 16k OR remove some of the
items from the index table. If we removed 1 of the string attributes, we would be within
the acceptable key length range for Oracle. However, this should not be a concern since
sensible indices would only include up to 5 items.
Unique Clause An index may be defined as “unique.” When this is specified, a unique constraint is placed
on the index table in the database schema. This allows a very efficient mechanism for
implementations that want to require unique combinations of values on business objects.
Note that the unique setting only applies to objects within a single vault.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the index. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add index NAME
property NAME [to ADMINTYPE NAME] [value STRING];
After an index is defined, you can change the definition with the modify index statement.
This statement lets you add or remove defining clauses and change the value of clause
arguments:
modify index NAME [MOD_ITEM {MOD_ITEM}];
Version 10 209
Working with an Index
Enabling an Index An index must be enabled before it is used to improve performance. The following
command can be executed from MQL provided that the current user is defined as a
System Administrator.
enable index NAME;
As soon as you enable the index, a table is created in every vault. (The tables are named in
the form ixXXXXXX_XXXXX, created by concatenating a prefix associated with the
index and a suffix associated with the vault. The prefix can be obtained from print index
command and the suffix from the print vault command.) If you then disable the index, or
add or remove items, these tables are dropped, and to use the index, it must be re-enabled.
For example, to enable the index named “Index for Finance queries,” enter the following
MQL statement:
enable index “Index for Finance queries”;
Creating and enabling indices are not appropriate actions to be performed within explicit
transaction boundaries, particularly if additional operations are also attempted before a
commit.
Disabling an Index It is recommended that indices are disabled when performing bulk loading or bulk
updating of data.
To disable a defined index, use:
disable index NAME;
Validating an Since up-to-date database statistics are vital for optimal query performance, after enabling
Index an index you should generate and add statistics to the new database tables. Use the
following command to do so:
validate level 4 index NAME [output FILENAME]
Using the index as You can use the index[] selectable on businessobjects and relationships to retrieve the
select output attribute and basic values directly from the index table. This is roughly N times faster than
Deleting an Index If an index is no longer required, you can delete it with the Delete index statement:
delete index NAME:
Index Tracing Tracing can be enabled to detect queries/expands that can benefit by using a new or
modified index. When enabled, messages are displayed whenever a query or expand is
executed that fails to find an associated index. A message is output for each item in the
query or expand that could be in an index (an attribute or basic property). The intent of this
tracing is to highlight queries and expands that use indexable items, none of which are the
first item in any index (so no index is used to optimize the operation).
To enable the index trace messages, use the mql command:
trace type INDEX on;
or set the environment variable:
MX_INDEX_TRACE=true
When this trace type is enabled, trace messages will be displayed in the format:
No index found for attribute[NAME1],attribute[NAME2],BASIC3…
Version 10 211
The items in the trace message may or may not be in a defined index. However, even if
they are part of an enabled index, they are not the first item in it, and so the index is not
usable for that query or expand.
A developer can conclude that adding at least some of the listed fields to a new or existing
index (making one of the items first) may improve system performance.
Version 10 213
Examples ........................................................................................................242
Migrating Databases .....................................................................................243
Migrating Files .................................................................................................243
Comparing Schema ......................................................................................245
Scenario ..........................................................................................................245
Creating a Baseline .........................................................................................245
Comparing a Schema with the Baseline .........................................................246
Reading the Report .........................................................................................248
Examples ........................................................................................................252
The Matrix Exchange Format is subject to change with each Matrix version.
Version 10 215
Exporting Administrative Objects
Before exporting any objects, it is important to verify that MQL is in native language
mode. Exporting in the context of a non-native language is not supported. If you need to
redefine the language, use the push alias command, as described in Overriding the
Language in Chapter 24.
Export statement Use the Export statement to export the definitions of a Matrix database. The complete
export command for administrative objects is as follows:
export ADMIN_TYPE TYPE_PATTERN [OPTION_ITEM [OPTION_ITEM]...]| into | file FILE_NAME
| onto |
[exclude EXCLUDE_FILE] [log LOG_FILE] [exception EX_FILE];
continue !mail .
!icon !set .
!mail and !set (notmail and notset) are only meaningful when exporting person objects
but should not cause syntax errors for other types.
OPTION_ITEMs can be used in any order before the into|onto file clause.
FILENAME is the name of a new or existing file to which to write the export data.
Each clause is described in the sections that follow.
ADMIN_TYPE The ADMIN_TYPE clause of the Export statement is used to specify which administrative
Clause definitions to export. Valid values are shown in the table above. Specifying admin will
export all administrative types of the name or pattern that follows. For example, you may
Using export admin * does not export creator and guest user accounts.
Instances of specific administrative object types can be exported using the appropriate
administrative object form of this command. For example, to export all policies you might
use:
export policy * into file policy.mix;
When exporting person objects, there is an associated workspace. The workspace contains
IconMail and sets (as well as Visuals) saved by the person being exported. When
exporting Persons, workspaces are exported by default, but you can omit mail and sets
using the !mail and !set clauses. These clauses are valid with the export person
and export admin statements only. Refer to the discussion in Migrating Databases for
information on why you would want to exclude these items.
!mail and !set (notmail and notset) are only meaningful when exporting Person
objects but should not cause syntax errors for other types.
For example, to export all persons without mail or sets, the following can be used:
export person * !mail !set into file person.mix;
Incremental N Clause
Use the incremental clause to export a specified number (N) of unarchived objects.
Unarchived objects are objects that have not yet been exported, or have been changed
since they were last exported. If no number is specified, all unarchived objects are
exported. Without this clause, export does not look at the archived setting and exports
all objects fitting the criteria.
Version 10 217
Note that while it is possible to export administrative changes incrementally, it is
recommended that during database migration, Business and System Administration tasks
are avoided.
!Archive Clause
The !archive clause is used to tell Matrix not to set the archive setting on objects being
exported. This is used to facilitate performance of large exports that will not require an
incremental export.
Continue Clause
The continue clause tells Matrix to proceed with additional exports even if an error is
generated. When continue is used, it is helpful to use the log and/or exception clauses
as well, so that diagnostics can be performed, and the data that caused the error is trapped.
XML Clause Use the XML clause to export data into XML format. For details, see Exporting Objects to
XML.
Into File/Onto File Exported data can be appended to a file or written to a new file by using the onto file
or into file forms of the Export statement. The into file form creates a new file,
or overwrites an existing file of the name specified as FILENAME. The onto file form
appends to an existing file.
Exclude Clause Use the Exclude clause to point to a map file that lists any objects to be excluded. It
includes the exclude keyword and a map file name. For example:
export admin TEST* into file teststuf.mix exclude nogood.txt;
The contents of the exclude map file for Administrative objects must follow the following
format:
ADMIN_TYPE NAME
ADMIN_TYPE NAME
ADMIN_TYPE can be any of the administrative object types: vault, store, location, server,
attribute, program, type, relationship, format, role, group, person, policy, report, form,
association, rule, workflow, or process.
NAME is the name of the definition instance that should be excluded in the import.
Wildcard patterns are allowed.
As indicated, each definition to be excluded must be delimited by a carriage return. The
exclude clause is optional.
Log FILENAME Apply this clause if you want to specify a file to contain error messages and details for the
Clause export process. The output is similar to using the verbose flag, but includes more details.
Version 10 219
Exporting Business Objects
Before exporting any objects, it is important to verify that MQL is in native language
mode. Exporting in the context of a non-native language is not supported. If you need to
redefine the language, use the push alias command, as described in Overriding the
Language in Chapter 24.
Export Bus Use the Export Businessobject statement to export business objects from a vault or a set:
Statement
export bus[inessobject] OBJECTID [from |vault VAULT_NAME|] [OPTION_ITEM {OPTION_ITEM}]
|set SET_NAME |
| into | file FILENAME [FILE_TYPE FILENAME [FILE_TYPE FILENAME]...];
| onto |
OBJECTID is the OID or Type Name Revision of the business object. It may also include
the in VAULTNAME clause, to narrow down the search. Wildcard patterns are allowed.
VAULT_NAME is the name of the vault from which to export the business object(s). While
neither is required, you can specify either a vault or a set from which to export, but not
both.
SET_NAME is the name of the set from which to export the business objects. While
neither is required, you can specify either a vault or a set from which to export, but not
both.
OPTION_ITEM is an export clause which further defines the requirements of the export.
It can be any of the following:
OPTION_ITEMs can be used in any order before the into|onto file clause.
FILENAME is the name of the file in which to store the exported information.
FILE_TYPE FILENAME offers a way to log errors and trap exceptions, as well as to
exclude objects in the export. FILE_TYPE can be any of the following:
Note that when FILE_TYPEs are specified on export, the use keyword is not required.
However, when used on import, it is.
To export all objects from vault TEMP and reset the current state to the beginning of the
lifecycle, use:
export businessobject * * * from vault TEMP !state into file
obj.mix;
OPTION_ITEMs can be used in any order before the into|onto file clause. Refer to
the descriptions of the other OPTION_ITEMS in the OPTION_ITEMs section of
Exporting Administrative Objects.
Exclude Clause
Use the Exclude clause to point to a file that lists any objects to be excluded. For example:
export businessobject TEST* into file teststuf.mix exclude nogood.txt;
The contents of the exclude file for business objects must follow the following format:
businessobject OBJECTID
businessobject OBJECTID
OBJECTID is the OID or Type Name Revision of the business object. It may also include
the in VAULTNAME clause, to narrow down the search.
As indicated, each business object to be excluded must be delimited by a carriage return.
Excluding Files
When exporting (or importing) business objects, the options for its files are:
1. !file, which tells Matrix not to export files when exporting business objects. By
default, both file data and content are exported.
2. !captured, which tells Matrix not to export captured store file content. This flag
affects content only, not file metadata.
Version 10 221
3. Otherwise, both file metadata and actual file contents are written to the export file. In
this case any file sharing is lost (resulting in duplication of files).
When !file is used, the captured flag cannot be used, since you cannot include files
without metadata. (Attempts to do this will not return an error, but no file information or
content will be included). Refer to Migrating Databases for more information on file
migration strategies.
Before exporting any objects, it is important to verify that MQL is in native language
mode. Exporting in the context of a non-native language is not supported. If you need to
redefine the language, use the push alias command, as described in Overriding the
Language in Chapter 24.
Export Workflow Use the Export Workflow statement to export workflows from a vault or a set:
Statement
export workflow PROCESS_PATTERN [from vault VAULT_NAME] [OPTION_ITEM [OPTION_ITEM]...]
| into | file FILENAME [FILE_TYPE FILENAME [FILE_TYPE FILENAME]...];
| onto |
PROCESS_PATTERN includes both the name of the process on which the workflow is
based and the workflow name. Wildcard patterns are allowed. For example, to export the
“Assembly 4318” workflow, which is based on the process “Create Part,” you would use
the following:
export workflow “Create Part” “Assembly 4318”;
VAULT_NAME is the name of the vault from which to export the workflow(s).
OPTION_ITEM is an export clause which further defines the requirements of the export.
It can be any of the following:
OPTION_ITEMs can be used in any order before the into|onto file clause.
OPTION_ITEMs are similar to those used when exporting business objects. See
OPTION_ITEMs in the Exporting Business Objects section for details.
FILENAME is the name of the file in which to store the exported information.
FILE_TYPE FILENAME offers a way to log errors and trap exceptions, as well as to
exclude objects in the export. FILE_TYPE can be any of the following:
Note that when FILE_TYPEs are specified on export, the use keyword is not required.
However, when used on import, it is.
Version 10 223
Exporting Objects to XML
The eXtensible Markup Language (XML) standard, defined by the World Wide Web
Consortium (W3C), is becoming increasingly important as an Internet data exchange
medium. Like HyperText Markup Language (HTML), XML is a text-based tag language
based on Standard Generalized Markup Language (SGML). Unique features that
distinguish XML from HTML include:
• Where as HTML is a Web presentation language, XML is a data description language
that defines the structure of data rather than how it is presented.
• Whereas HTML uses a fixed set of tags and attributes, XML lets authors define their
own tags and attributes, providing complete control over the structure of data in an
XML document. This makes XML “extensible’ and “self-describing,” as tag names
can incorporate domain-specific terminology.
• Whereas HTML combines presentation markup with content markup, XML separates
presentation from content. By accessing presentation information stored in XSL or
CSS style sheets, the same XML data can be presented in different formats on
different devices.
These features give XML great flexibility as a standard way of exchanging structured data
across platforms and applications and displaying that data in a variety of web-enabled
devices (e.g., computers, cell phones, PDAs).
For Matrix users, XML can enhance business-to-business EDI functions by facilitating
data exchange and application integration with a partner’s ERP or other data-driven
systems. XML will make it easy for you to import Matrix data from customers and
partners and display that data in a variety of formats. You will also be able to read an
XML export files into any version of Matrix, assuring backward as well as forward
compatibility among versions of Matrix software.
XML Export Matrix schema and business objects may optionally be exported in XML format. The
Requirements and resulting XML stream follows rules defined in the Matrix XML Document Type
Options Definition (DTD) file (named “ematrixml.dtd”) that is installed with Matrix in the /XML
directory. This DTD file is referenced by all exported Matrix XML files. In order to
interpret and validate Matrix XML export files, an XML parser must be able to access the
eMatriXML DTD file. This means that the DTD file should reside in the same directory as
the exported XML files and be transferred along with those files to any other user or
application that needs to read them.
Using MQL, you can export Matrix objects to XML format in either of two ways:
• Insert an XML clause in any Export statement for exporting administrative, business,
or workflow objects
• Issue an XML statement to turn on XML mode as a global session setting. In this
mode, any Export statements you enter, with or without the XML clause, will
automatically export data in XML format.
Be aware of the following restrictions related to exporting and importing in XML format:
• When exporting programs to XML, make sure the code does not contain the
characters “]]>”. These characters can be included as long as there is a space between
the bracket and the greater sign. For more information, see Programs Exported to
XML in the Matrix PLM Platform Programming Guide.
XML Clause Use the XML clause as an OPTION_ITEM in any Export statement to export
administrative, business, or workflow objects in XML format. To ensure that the XML
file(s) reside in the same directory as the Matrix XML DTD, you can export files to the
XML folder (in your MATRIXHOME directory) where the DTD is installed.
Alternatively, you can specify another location in your Export statement and copy the
DTD into that directory. Use the into clause in your Export statement and specify a full
directory path, including file name. For example:
export person guy xml into file c:\matrix\xml\person.xml;
XML Statement Use the XML statement to turn XML mode on or off as a global session setting. The
complete XML command syntax is:
xml [on|off];
Omitting the on/off switch causes XML mode to be toggled on or off, depending on its
current state. XML mode is off by default when you start an MQL session.
For example, to export a person named “guy” using an XML statement along with an
Export statement, you can enter:
xml on;
export person guy into file c:\matrix\xml\person.xml;
If you need to export several Matrix objects to XML format, using the XML statement to
turn on XML mode first can eliminate the need to re-enter the XML clause in each Export
statement as well as the possibility of an error if you forget.
XML Output The XML export format typically generates a file 2 to 3 times larger than the standard
Matrix export format. To conserve space, subelements are indented only if verbose mode
is turned on. Indentation makes output more readable but is not required by an XML
parser. Some XML viewers (like Internet Explorer 5.0) will generate the indentation as the
file is parsed.
Version 10 225
The following example shows standard export output when you export a person named
“guy” during an MQL session. While relatively compact, this output is not very
intelligible to a user.
MQL<1>set context user creator;
MQL<2>export person guy;
!MTRX!AD! person guy 8.0.2.0
guy Guy ""
"" "" "" "" 0 0
1 1 1 0 1 0 1 "" "" *
1111101111111100111110
0 1 .finder * GuyzViewTest 0 * FileInDefaultFormat 1 ""
0 0
0 0
0
0
0
de3IJEE/JIJJ.
""
0
0
0
1
Test""
1
Description description 1
0 0 0 0 70 21 0 0 1 1
1
0 0
0
0 0
person guy successfully exported.
!MTRX!END
export successfully completed
The next example shows XML output when you use the Export statement, with XML
mode turned on, to export a person named “guy” during a continuation of the same MQL
session. While more intelligible to a user, this code creates a larger output file than the
standard Matrix export format.
MQL<3>xml on;
MQL<4>verbose on;
MQL<5>export person guy;
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- (c)MatrixOne, Inc., 2000 -->
<!DOCTYPE ematrix SYSTEM "ematrixml.dtd">
<ematrix>
<creationProperties>
<release>8.0.2.0</release>
<datetime>2000-05-05T17:57:19Z</datetime>
<event>export</event>
<dtdInfo>&ematrixProductDtd;</dtdInfo>
</creationProperties>
<person id="0.1.31721.46453">
<adminProperties>
<name>guy</name>
</adminProperties>
<fullName>Guy</fullName>
<fullUser/>
Version 10 227
</column>
</columnList>
</table>
</tableList>
</person>
</ematrix>
When migrating objects or entire databases, it is important to import in the correct order:
1. Import all administrative objects first.
2. Import all business objects.
3. Import workspaces from the same exported ASCII data file as was used to import
Persons. Refer to Importing Workspaces for more information.
4. Import workflows. Refer to Importing Workflows for more information.
5. Import properties of the administrative objects that have them. The same file that was
used to import the administrative objects should be used. Refer to Importing
Properties for more information.
For more migration strategies refer to Migrating Databases.
Import Statement Use the Import statement to import administrative objects from an export file to a Matrix
database. The export file must be in Matrix Exchange Format or in an XML format that
follows the Matrix.dtd specification.
import [list] [property] ADMIN_TYPE TYPE_PATTERN [OPTION_ITEM [OPTION_ITEM]...]
from file FILENAME [use [FILE_TYPE FILE [FILE_TYPE FILE]...];
OPTION_ITEMs can be used in any order before the from file clause. The sections
below describe these options.
FILENAME is the path and name of the existing .mix file from which to import the
information.
Version 10 229
FILE_TYPE can be used to specify files to be used to control the import and log files and
exceptions. FILE_TYPE can be any of the following:
map exclude log exception
Note that the use keyword must be used with any files that are specified: map files,
exclude files, log files, or exception files. If more than one file type is to be used, the use
keyword should only be stated once. (The use keyword in not used at all in the export
command).
FILE is the name of the file to be used with FILE_TYPE. For example, an exclude FILE
would be the name of the existing file that lists any Matrix objects which should not be
included in the import.
List Clause The List clause of the Import statement is used to show on the screen what would be done
on import. It enables you to perform a practice run, ensuring that the files to be imported
are read correctly. For example:
import list admin * from file c:\admin.mix;
Admin and The Admin clause of the Import statement is used to import all administrative types of the
ADMIN_TYPE name or pattern specified (TYPE_PATTERN). For example, you may have exported to one
Clauses file a test schema with definitions for attributes, types, policies, relationships, and so on—
all beginning with “TEST”. To import all the test administrative types, you might use the
following:
import admin TEST* from file TestStuff.mix
If the icon was omitted during the export, it cannot be included during import, regardless
of the use of this clause.
Overwrite Clause
The overwrite clause is used if objects were incrementally exported. If an object
already exists, the overwrite clause tells the import command to modify any objects that
are found to already exist. Without the overwrite clause, if an administrative object exists,
the import will fail, since it will try to create a new object with the same name as an
existing object.
When !overwrite is used, the objects that don’t import because they already exist are
written to the exception file (if specified).
When importing, the default for administrative objects is !overwrite. For business
objects, the default is overwrite.
Overwrite will not work on administrative objects that are referenced by business objects.
This eliminates the possibility of doing things like import overwrite to change icon
images, or editing an administrative object in a development environment, testing, and
then importing into a production environment.
Skip N Clause
Skip N provides a way not to import the beginning N number of objects in an export file.
It is helpful if a previous attempt to import a file was unsuccessful and aborted part way
through the process.
Commit N Clause
The commit clause gives you the abililty to specify N number of objects to enclose in
transaction boundaries. In this way, some progress could be made on the import even if
some transactions are aborted. The default is 100.
Version 10 231
Pause N Clause
Pause allocates the amount of time in seconds to wait between import transactions. It is
used with the commit clause. A pause is beneficial when import is running in the
background for an extended period of time. It provides a larger window of opportunity for
you to access the database machine’s resources. Import transactions run continuously
when this clause is not included.
Continue Clause
The continue clause tells Matrix to proceed with additional imports even if an error is
generated. When continue is used, it is helpful to use the log and/or exception
clauses as well, so that diagnostics can be performed, and the data that caused the error is
trapped.
Use FILE_TYPE You can indicate that a file should be generated or referenced with the use FILE_TYPE
Clauses clause. Note that the use keyword must be included with any clauses that specify map
files, exclude files, log files, or exception files. If more than one file type is listed, the use
keyword should only be stated once. (The use keyword is not used at all with the export
command.) FILE_TYPE can be any of the following:
Map Clause
The Map clause of the Import statement indicates a map file which lists any new locations
or names for objects. The map file must use the following format:
ADMIN_TYPE OLDNAME NEWNAME
ADMIN_TYPE OLDNAME NEWNAME
ADMIN_TYPE can be any of the administrative object types: vault, store, location, server,
attribute, etc.
OLDNAME is the name of the instance that will be found in the import file.
NEWNAME is the name that should be substituted for OLDNAME when imported into the new
database.
As indicated, each definition to be changed must be delimited by a carriage return.
Exclude Clause
Use the Exclude clause of the Import statement to indicate a file that lists any objects to be
excluded. For example:
import admin TEST* from file teststuf.mix use exclude nogood.obj;
The exclude file for administrative objects must use the following format:
ADMIN_TYPE NAME
ADMIN_TYPE NAME
ADMIN_TYPE can be any of the administrative object types: vault, store, location, server,
attribute, program, type, relationship, format, role, group, person, workspace, policy,
report, form, association, rule, workflow, or process.
Importing Servers If a server object is imported (via MQL or Oracle) into a different Oracle instance or user
than it was exported from, the username and password settings of the server must be
modified before distributed access is available. This is particularly important if an upgrade
will follow the import, since all servers must be accessible to the machine doing the
upgrade.
Importing Workspaces contain a user’s queries, sets, and iconmail, as well as all Visuals.
Workspaces Workspaces are always exported with the person they are associated with. However, when
Persons are imported, the workspace objects are not included. This is because they may
rely on the existence of other objects, such as Types and business objects, which may not
yet exist in the new database. Workspaces must be imported from the same .mix file that
was used to import persons. For example:
import workspace * from file admin.mix;
Or:
import workspace julie from file person.mix;
Importing Workflows
To import a specific workflow, you must specify the process name followed by the
workflow name after the keyword workflow:
import workflow PROCESS_NAME WORKFLOW_NAME;
For example, to import the “Assembly 4318” workflow, which is based on the process
“Create Part,” you would use the following:
import workflow “Create Part” “Assembly 4318”;
Wildcards can be used. For example, to import all workflows, use * for the process and
workflow names:
import workflow * *;
Version 10 233
If you are importing an entire database, you must include workflows. For example:
import admin *
import bus * * *
import workflow * *
import workspace *;
These import statements must be performed in this order. Workflows can refer to business
objects, so they must be done after import bus. Also, TaskMails require that the
appropriate person objects exist, so import person or import admin must precede
import workflow.
Importing Properties are sometimes created to link administrative objects to one another. Like
Properties workspaces, properties are always exported with the administrative object they are on.
Import is somewhat different, however, since a property may have a reference to another
administrative object, and there is no way to ensure that the referenced object exists in the
new database (administrative objects are sometimes exported and then imported in
pieces). So a command to import administrative objects is issued, the specified objects are
created first, and then the system attempts to import its properties. If the “continue”
modifier is used, the system will get all the data it can, including system and user
properties. But to ensure that all properties are imported, even when the administrative
data may have been contained in several files, use the import property command.
For example, data can be exported from one database as follows:
export attrib * into file attrib.exp;
export program * into file program.exp;
export type * into file type.exp;
export person * into file person.exp;
Finally, workspaces and any “missed” properties are imported. Note that properties may
exist on workspace objects, so it is best to import properties after workspaces:
import workspace * from file person.exp;
import property attrib * from file attrib.exp;
import property program * from file program.exp;
import property type * from file type.exp;
import property person * from file person.exp;
Version 10 235
Importing Business Objects
If triggers are attached to an object being imported, they may be executed at the time of
import. Therefore, the MQL command:
trigger off;
Import Bus Use the Import Businessobject statement to import business objects from an export file to
Statement a Matrix database. The export file must be in Matrix Exchange Format or in an XML
format that follows the Matrix DTD specification.
import [list] bus[inessobject] OBJECTID [OPTION_ITEM [OPTION_ITEM]...]
from file FILENAME [use [FILE_TYPE FILE [FILE_TYPE FILE]...];
OBJECTID is the OID or Type Name Revision of the business object. It may also include
the in VAULTNAME clause, to narrow down the search. Wildcard patterns are allowed.
OPTION_ITEM is an import clause which further defines the requirements of the import
to be performed. It can be any of the following:
OPTION_ITEMs can be used in any order before the from FILE clause. The sections
below describe these options.
FILENAME is the name of the file from which to get the exported ASCII data.
FILE_TYPE can be used to specify files to be used to control the import and log files and
exceptions. FILE_TYPE can be any of the following:
Note that the use keyword must be used with any files that are specified: map files,
exclude files, log files, or exception files. If more than one file type is to be used, the use
keyword should only be stated once. (The use keyword in not used at all in the export
command).
FILE is the name of the file to be used with FILE_TYPE. For example, an exclude FILE
would be the name of the existing file that lists any Matrix objects which should not be
included in the import.
Another alternative for redirecting business objects during import is to use a map file as
discussed in the section Use Map Clause. In fact, if you want to import business objects
that have revisions and put them into a different vault, you must use a map file or errors
will occur.
Excluding Information
When importing business objects, the default is to include everything about the object.
However, you may specify that some parts of the .mix file should not be imported.
Any information that was omitted during the export cannot be included during import,
regardless of the use of this clause.
The table below shows the options which can be used when importing business objects to
exclude information:
Version 10 237
Clause Used to:
!icon Exclude icons.
!relationship Exclude all relationships.
!torelationship Exclude “to” relationships.
!fromrelationship Exclude “from” relationships.
!state Exclude state information. Generally used with the
overwrite option, so that even though other parts of the
object will be overwritten, current state and signature
information will not be. This can also be used to put objects
back to the first state in their lifecycle.
For example, to import all objects from file mystuff.mix and exclude all checked in files,
use:
import businessobject * * * !file from file mystuff.mix;
For captured files, file metadata can be included, without the actual file content by using
the !captured option. See the discussion Excluding Files for more information.
To import a single object without including history, use:
import businessobject Assembly “ABC 123” A !history from file
obj.mix;
When importing objects, several options are available with regard to relationship
information:
• Include all relationship information (default)
• Exclude all relationship information (!relationship)
• Exclude to relationships (!torelationship)
• Exclude from relationships (!fromrelationship).
To import all objects and reset the current state to the beginning of the lifecycle, use:
import businessobject * * * !state from file obj.mix;
!Overwrite Clause
!overwrite tells import not to replace any objects that already exist with the new object
information from the specified .mix file. Specifying !overwrite will cause an error if
an object already exists. Default behavior for business objects is to overwrite files.
When importing, the default for administrative objects is !overwrite. For business
objects, the default is overwrite.
OLDNAME is the name of the Vault that will be found in the import file.
NEWNAME is the name of the Vault that the object is imported into in the new database.
If multiple vaults are listed, they must be delimited by a carriage return.
For example, to import and place everything from vault Test to vault Prod using a map
file, the map file entry would be: vault Test Prod and the command would be:
import businessobject * * * from file c:\stuff.mix use map
c:\newvault.map
Changing vaults on import is also possible using the From Vault and To Vault Clauses.
Exclude Clause
Use the Exclude clause to indicate a file that lists any objects to be excluded. For example:
import businessobject TEST* from file teststuf.mix use map changes.map exclude
nogood.obj;
The exclude map file for business objects must use the following format:
businessobject OBJECTID
businessobject OBJECTID
OBJECTID is the OID or Type Name Revision of the business object. It may also include
the in VAULTNAME clause, to narrow down the search.
As indicated, each business object to be excluded must be delimited by a carriage return.
Import Example
The following command:
• imports business objects from export.mix
• commits the import transaction every 5 business objects
• writes the audit trail to import.log
Version 10 239
• writes exception objects to error.mix
import bus * * * commit 5 continue from file export.mix use log
import.log exception error.mix;
If an error occurs, you can look at the entries in the import.log to see what went wrong.
Once the problem is resolved, the error.mix file could be used to import the objects that
were not imported successfully the first time.
When object imports fail, the transaction aborts and rolls back the import of any objects
that precede it in the transaction boundary. These are the objects written to the exception
file. A new transaction is started with the next object. Using the example above, suppose
the third object attempted caused a problem; the transaction is aborted. The first three
objects are written to error.mix and a new transaction begins with the fourth object. After
the eighth object was imported, the transaction is committed and the new database has five
new objects.
Import Workflow Use the Import Workflow statement to import workflows from an export file to a Matrix
Statement database.
PROCESS_PATTERN includes both the name of the process on which the workflow is
based and the workflow name. Wildcard patterns are allowed. For example, to import the
“Assembly 4318” workflow, which is based on the process “Create Part,” you would use
the following:
import workflow “Create Part” “Assembly 4318”;
OPTION_ITEM is an import clause which further defines the requirements of the import to
be performed. It can be any of the following:
OPTION_ITEMs can be used in any order before the from FILE clause. These
OPTION_ITEMs are similar to those used for importing business objects. For details, see
the items detailed in the Importing Business Objects section.
VAULT_NAME is the name of the vault you are importing from and to.
FILENAME is the name of the file from which to get the exported ASCII data.
FILE_TYPE can be used to specify files to be used to control the import and log files and
exceptions. FILE_TYPE can be any of the following:
Note that the use keyword must be used with any files that are specified: map files,
exclude files, log files, or exception files. If more than one file type is to be used, the use
keyword should only be stated once. (The use keyword in not used at all in the export
command).
FILE is the name of the file to be used with FILE_TYPE. For example, an exclude FILE
would be the name of the existing file that lists any Matrix workflows that should not be
included in the import.
Version 10 241
Extracting from Export Files
Sometimes export files contain more information than you want imported. When this is
the case, the extract statement can be used to create a new file containing only the
specified information of the original file.
extract |bus OBJECTID | [OPTION_ITEM [OPTION_ITEM]]from file FILENAME |into| file NEW;
|ADMIN ADMIN_NAME| |onto|
OBJECTID is the OID or Type Name Revision of the business object. It may also include
the in VAULTNAME clause, to narrow down the search. If a pattern is listed, the first
match is extracted.
ADMIN is any of the administrative types to be extracted.
ADMIN_NAME is the name of the administrative object to be extracted.
OPTION_ITEM can be any of the following:
Skip Clause
The skip clause is used to begin the extraction at a place other than the beginning of the
file. N is the number of beginning entry marks (!MTRX) to skip.
Examples For example, if all administrative objects were extracted into one file called admin.mix,
you can extract all policies into a separate file as follows:
extract policy * from file admin.mix into file policy.mix;
To extract all business object from the fifth entry until the end of the file use:
extract bus * * * skip 4 remaining from file objects.mix into file newobjs.mix;
4. Import workspaces from the same exported ASCII data file as was used to import
Persons. For example:
import workspace * from file admin.mix;
Or:
import workspace julie from file person.mix;
Workflows can refer to business objects, so they must be done after import bus.
TaskMail is imported by import workspace and refers to workflows. So import
workspace must be done last.
Workspaces contain a user’s queries, sets, TaskMail, and IconMail, as well as all
Visuals. Workspaces are always exported with the person with which they are
associated. However, when Persons are imported, the workspace objects are not
included. This is because they may rely on the existence of other objects, such as
Types and business objects, which may not yet exist in the new database.
5. Import properties of administrative objects.
When administrative objects are imported, Matrix imports all the objects without
their properties and then goes back and imports both system and user properties for
those objects. If administrative objects were exported in pieces, such as all Types in
one file, all Persons in another, then properties should be explicitly imported with the
import property command. Refer to Importing Properties for more information.
Migrating Files When migrating business objects, there are three options for its files:
1. By default, both file metadata and actual file contents are written to the export file.
Matrix UUencodes the file and writes it to the export data file, along with business
object metadata. Pointers to the files are guaranteed because the file is recreated
during import. In this case, any file sharing is lost, (as when revisions use the same
file list—each revision in the chain gets its own copy of the file).
2. Adding the !file clause tells Matrix not to include any file metadata or content.
3. Using the !captured clause tells Matrix not to include captured store file content.
This option writes only the fully qualified path of checked in files in the data file,
along with business object metadata.
Version 10 243
When migrating databases, most often the !captured option is recommended. This will
facilitate the process, in that the .mix files will not be as large, and therefore will not
require as much disk space or processing time to complete the migration. Once the import
is complete, the objects will point to the appropriate files in the same location. The same is
true for tracked files; if metadata is included for tracked files, the imported objects will
point to the appropriate location, as long as the store names and hosts have stayed the
same. For ingested files, the options are to include both metadata and content or not to
include either.
The key to keeping the file pointers accurate is keeping the store path definitions
consistent. For example, let’s say the database from which we are exporting has a captured
store named “Released Data Store.” The path of this store is defined as “/company/
released.” To maintain pointer consistency when using !captured, the new database
must also have a defined captured store “Released Data Store” with the same path
definition. If stores are exported and then imported, there is no problem. However, if
stores are first created in the new database, to redistribute them onto different machines,
for example, problems could occur with objects that have directories checked in. Since the
export function needs to UUencode the directory structure and files, the machine defined
as the host in the original store definition must still be accessible to MQL through NFS.
If objects are to be deleted and then re-imported, use the !captured option, but be sure
to tar off any captured store directories before deleting any objects. Once the objects are
deleted, the directories restored, and the objects imported, the files will be associated with
the appropriate objects.
This section describes how to compare two schemas to determine the differences between
them. A schema is all the administrative objects needed to support a Matrix application.
Use schema comparison to compare:
• Different versions of the same schema to manage changes to the schema.
• Two schemas from different databases so you can merge the schemas (for example,
merge a checkout system with a production system).
The process of comparing schema involves two main steps:
1. Create a baseline sample of one schema using XML export. See Creating a Baseline.
2. Analyze the differences between the baseline sample and the other schema (or a later
version of the same schema) using the compare command. You specify the
administrative types (attributes, relationships, etc.) and a name pattern (for example,
all attributes beginning with “Supplier”) to compare. Each compare command outputs
a single log file that contains a report. The report lists the administrative objects in the
baseline export file that have been added, deleted, and modified. See Comparing a
Schema with the Baseline.
If your goal is to merge the two schemas by making the necessary changes to one of the
schemas (sometimes called “applying a delta”), you can make the changes manually or by
writing an MQL script file that applies the changes to the target schema.
Scenario Suppose you need to determine the changes that have occurred in a checkout database
versus what continues to exist in the production database. In this case, you may want to
create a baseline of both databases, and use each to compare against the other. One report
would be useful to find out what has changed in the checkout database. The other report
would be useful to determine what it would take to apply those changes to the production
database.
Creating a The first step for comparing two schemas is to establish a baseline for analysis by
Baseline sampling one of the schemas. You create a baseline by exporting administrative objects to
XML format. You can use any option available for the export command to create the
baseline export files. For information on options and more details about the export
command, see Exporting Administrative Objects.
Use the following guidelines to perform the export.
• Start MQL using a bootstrap file that points to the database containing the schema for
which you want to create the baseline.
• There are two ways to produce an XML export file: toggle on XML mode and issue a
normal export command, or issue a normal export command but include the XML
keyword. For example:
xml;
export ADMIN_TYPE TYPE_PATTERN into file FILENAME;
Or the equivalent:
export ADMIN_TYPE TYPE_PATTERN xml into file FILENAME;
Version 10 245
• It’s best to create separate a export file for each administrative type and to keep all the
objects of a type in one file. For example, export all attributes to file attributes.xml, all
relationships to relationship.xml, etc. This keeps the baseline files to a reasonable
size, and also lets you compare specific administration types, which makes it easy to
produce separate reports for each administration type. If you need to identify subsets
of objects within an export file to focus the analysis, you can do so using the compare
command.
• The compare command requires that the ematrixml.dtd file be in the same directory
as the export files. Therefore, you should create the export files in the directory that
contains the dtd file or copy the dtd file into the directory that contains the export
files. If you don’t specify a path for the export file, Matrix creates the file in the
directory that contains mql.exe file.
The following table shows examples of export commands that export different sets of
administrative objects. All the examples assume the XML mode is not toggled on and that
the ematrixml.dtd file is in the directory d:\Matrix\xml.
Comparing a After creating the baseline for one of the schemas, the second step is to analyze the
Schema with the differences between the baseline and the second schema, and generate a report that lists
Baseline the differences. The MQL compare command performs this step. The syntax for the
compare command is shown below. Each clause and option in the command is explained
in the following sections.
compare ADMIN_TYPE TYPE_PATTERN [workspace] from file FILENAME [use [map FILENAME]
[exclude FILENAME] [log FILENAME] [exception FILENAME]];
When issuing the command, make sure you start MQL using a bootstrap file that points to
the database that you want to compare with the schema for which you created the baseline.
The compare command analyzes only administrative objects and ignores any business
objects and workflow instances in the baseline export file.
The value admin compares all administrative types of the name or pattern that follows.
For example, the clause “admin New*” compares all administrative objects with the prefix
“New.” All other ADMIN_TYPE values compare specific administrative types. For
example, to compare all policies, you could use:
compare policy * from file d:\Matrix\xml\policy.xml;
To compare objects of a particular type whose names match a character pattern, include
the pattern after the ADMIN_TYPE clause. For example, to compare only relationships that
have the prefix “Customer”, you could use:
compare relationship Customer* from file d:\Matrix\xml\relationship.xml;
workspace Option
The workspace option applies only when comparing administrative types that can have
associated workspace objects: persons, groups, roles, or associations. When you add the
keyword “workspace” to the compare command, any workspace objects (tips, filters, cues,
toolsets, sets, tables, and views) owned by the persons, groups, roles, or associations being
compared are included in the comparison operation.
For example, suppose you compare the Software Engineer role and the only change for the
role is that a filter has been added. If you don’t use the workspace option, the compare
operation will find no changes because workspace objects aren’t included in the
comparison. If you use the workspace option, the comparison operation will report that the
role has changed and the filter has been added.
Use the use keyword once for any optional files specified in the compare command: map
files, exclude files, log files, or exception files. If more than one file type is to be used, the
use keyword should be stated once only.
The use FILETYPE FILENAME option lets you specify optional files to be used in the
compare operation. FILETYPE accepts four values:
• log
The use log FILENAME option creates a file that contains the report for the compare
operation. The compare command can be issued without identifying a log file, in
which case just a summary of the analysis is returned in the MQL window—total
number of objects analyzed, changed, added, deleted. The log file report lists exactly
Version 10 247
which objects were analyzed and describes the differences. More information appears
in the report if verbose mode is turned on. For more information about the report, see
Reading the Report.
An efficient approach is to run the compare command without a log file to see if any
changes have occurred. If changes have occurred, you could turn on verbose mode,
re-run the compare command and supply a log file to capture the changes.
• map
A map file is a text file that lists administrative objects that have been renamed since
the baseline file was created. The map file maps names found in the given baseline
file with those found in the database (where renaming has taken place). Use the map
file option to prevent the compare operation from finding a lot of changes simply
because administrative objects had their names changed. The map file must use the
following format:
ADMIN_TYPE OLDNAME NEWNAME
ADMIN_TYPE OLDNAME NEWNAME
OLDNAME is the name of the object in the baseline export file. NEWNAME is the name
of the object in the current schema (the schema you are comparing against the
baseline file). Include quotes around the names if the names include spaces. Make
sure you press Enter after each NEWNAME so each renamed object is on a separate
line (press Enter even if only one object is listed). For example, if the Originator
attribute was renamed to Creator, the map file would contain this line:
attribute Originator Creator
If no map file is specified, the compare operation assumes that any renamed objects
are completely new and that the original objects in the baseline were deleted.
• exclude
An exclude file is a text file that lists administrative objects that should not be
included in the comparison. The exclude file must use the following format:
ADMIN_TYPE NAME
ADMIN_TYPE NAME
NAME is the name of the administrative object that should be excluded in the compare
operation. Make sure you press Enter after each NAME so each excluded object is on
a separate line (press Enter even if only one object is listed). Wildcard patterns are
allowed. Include quotes around the names if the names include spaces. For example,
if you don’t want to compare the Administration Manager role, the exclude file would
contain this line:
role “Administration Manager”
• exception
The use exception FILENAME option creates a file that lists objects that could not be
compared. If a transaction aborts, all objects from the beginning of that transaction up
to and including the “bad” object are written to the exception file.
FILENAME is the path and name of the file to be created (log and exception files) or used
(map and exclude files). If you don’t specify a path, Matrix uses the directory that contains
the mql.exe file.
Reading the If you specify a log file in the compare command, the compare operation generates a
Report report that lists all objects analyzed and the changes. The report format is simple ASCII
Preamble—Lists the clauses and options used in the compare command, the time of the
operation, and software version numbers.
Object banner—Each object analyzed is introduced with a banner that includes the
object type and name wrapped by “=” characters.
Sub-object banner—Each sub-object analyzed for an object is listed under the object
banner. The sub-object banner includes the sub-object type and name wrapped by “-”
characters. In the above example, only one object, Joe Chief_Engineer, has sub-objects,
which in this case is a query and a set.
Change Analysis—Following the banner for each object and sub-object analyzed, there
are four possibilities:
1. If no changes are found, then no analysis lines appear. The next line is the banner for
the next object/sub-object or the summary section.
2. If the object (sub-object) has been added, then the following line appears: “Has been
added.”
3. If the object (sub-object) has been deleted, then the following line appears: “Has been
deleted.”
4. If the object (sub-object) has been changed, there are three possibilities:
a ) If a field has been added, then the following line appears: “FIELD has been
added.”
b ) If a field has been deleted, then the following line appears: “FIELD has been
deleted.”
c ) If a field has changed, then the following line appears: “FIELD has been
changed.”
Version 10 249
where FIELD is in the following form: FIELDTYPE [‘FIELDNAME’]
[SUBFIELDTYPE [‘FIELDNAME’]] ...
and FIELDTYPE identifies the type of field using tags found in the ematrixml.dtd
file, and FIELDNAME identifies the name of the field when more than one choice
exists.
The best way to identify the field that has changed is to traverse the XML tree
structure, looking at element names (tags) and the value of any name elements
(placed in single quotes) along the way. Use the ematrixml.dtd file as a roadmap.
Element names never have single quotes around them, and values of name elements
always have single quotes around them. This should help parsing logic distinguish
between the two.
Here are some sample messages that would appear in the change analysis section if
the compare operation finds that an object has changed (possibility 4):
frame 'Change Class' has been added.
typeRefList 'Change Notice' has been deleted.
field fieldType 'select' has been deleted.
widget 'ReasonForChange' multiline has been changed
widget 'ReasonForChange' validateProgram programRef has been changed.
businessObjectRef objectType 'Assembly Work Instruction' objectName 'WI-300356'
objectRevision 'D' has been deleted.
Summary—The final section of the report contains a timestamp followed by the same
summary that appears in the MQL window.
Verbose Mode
Turn on verbose mode to see more details in the report for changed objects/sub-objects
(possibility 4 in the above description). To see these additional details, make sure you turn
on verbose mode before issuing the compare command.
Verbose mode does not produce additional information if an object has been added
(possibility 2 in the above description) or deleted (possibility 3). To get more information
about an added object, use a print command for the object. To gather information about a
deleted object, look at the XML export file used for the baseline.
When the operation finds changes to objects, verbose mode adds text as follows:
• For possibility 4a (field has been added), the keyword “new” appears followed by
VALUE.
• For possibility 4b (field was deleted), the keyword “was” appears followed by
VALUE.
• For possibility 4c (field was changed), the keywords “was” and “now” appear, each
followed by VALUE.
where VALUE is either the actual value (in single quotes) or a series of name/value
pairs (where the value portion of the name/value pair is in single quotes).
Here are some sample messages that would appear in the change analysis section if the
compare operation finds that an object has changed (possibility 4) and verbose mode is
turned on:
field fieldType 'select' has been added.
new absoluteX '0' absoluteY '0' xLocation
'382.500000' yLocation '36.000000' width
'122.400002' height '24.000000'
Version 10 251
Has been added.
====== 'person' 'creator' ======
Has been added.
Examples Below are two example MQL sessions. The first MQL session shows two baseline export
files being created.
Matrix Query Language Interface, Version 9.0.0.0
Copyright (c) 1993-2000 MatrixOne, Inc.
Line <2> places the session All rights reserved.
into XML mode. All MQL<1>set context user Administrator;
subsequent export MQL<2>xml on;
commands will generate
export files in XML format. MQL<3>export program A* into file d:\Matrix\xml\program1.xml;
Line <3> exports all programs MQL<4>export person * into file d:\Matrix\xml\person1.xml;
(including wizards) that start MQL<5>quit;
with “A”.
Line <4> exports all persons.
The second MQL session shows several comparisons being performed using the baseline
export file person1.xml. It is assumed changes have occurred in the database, or the
session is being performed on a different database.
Matrix Query Language Interface, Version 9.0.0.0
Line <2> compares all person Copyright (c) 1993-2000 MatrixOne, Inc.
objects that start with “Joe C” All rights reserved.
with the baseline file MQL<1>set context user Administrator;
person1.xml. Since no log file is MQL<2>compare person “Joe C*” from file d:\Matrix\xml\person1.xml;
specified, no report is generated.
0 objects have been added.
(Not having a log file would
typically be done to see if 0 objects have been removed.
anything has changed.) The 0 objects have been changed.
summary message states that 5 objects are the same.
none of the 5 objects analyzed MQL<3>compare person “Joe C*” workspace from file d:\Matrix\xml\person1.xml;
have changed.
0 objects have been added.
Line <3> performs the same
compare but also includes 0 objects have been removed.
workspace items assigned to the 1 objects have been changed.
persons. The results now show 4 objects are the same.
that there has been a change. MQL<4>verbose on;
To view the changes, a report
MQL<5>compare person “Joe C*” workspace from file d:\Matrix\xml\person1.xml use
must be generated.
log d:\Matrix\xml\person1w.log;
Line <4> turns on verbose mode.
0 objects have been added.
Line <5> performs the previous
0 objects have been removed.
compare but also gives a log file
to place the report into. The 1 objects have been changed.
resulting report can be found in 4 objects are the same.
Reading the Report. compare successfully completed.
program1.map
program “Add Task” “Add Task Import”
program1.log
Map file 'd:\Matrix\xml\program1.map' successfully read.
An exclude file was not given.
Input baseline file: 'd:\Matrix\xml\program1.xml'.
Type = 'program', Name Pattern = 'A*', Workspace 'excluded'.
Start comparison at 'Wed Jun 21, 2000 2:13:49 PM EDT'.
Baseline version was '9.0.0.0'.
Current version is '9.0.0.0'.
=====================================================
====== 'program' 'Add Component (As-Designed)' ======
description has been changed.
====== 'program' 'Add Assembly (As-Designed)' ======
====== 'program' 'Add Purchase Requisition' ======
====== 'program' 'Add Event' ======
====== 'program' 'AttributeProg' ======
====== 'program' 'A' ======
====== 'program' 'A1' ======
====== 'program' 'A2' ======
====== 'program' 'Add ECR' ======
Version 10 253
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Change Type' ------
------ 'frame' 'Reason For Change' ------
width has been changed.
widget 'ReasonForChange' multiline has been changed.
widget 'ReasonForChange' validateProgram programRef has been changed.
widget 'postECR Input1label4' fontName has been changed.
widget 'Reason For Changelabel5' widgetValue has been changed.
------ 'frame' 'Product Line' ------
widget 'Product Linelabel4' has been added.
------ 'frame' 'Change Priority' ------
------ 'frame' 'Reason for Urgency' ------
widget 'Product Linelabel4' has been deleted.
------ 'frame' 'AdditionalSignatures' ------
------ 'frame' 'Conclusion' ------
------ 'frame' 'Conclusion-Urgent' ------
------ 'frame' 'Status Feedback' ------
frame 'Change Class' has been added.
====== 'program' 'Add Assembly' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Make vs Buy' ------
widget 'MakevsBuy' validateProgram programRef has been changed.
------ 'frame' 'Part Family' ------
------ 'frame' 'Assembly Description' ------
------ 'frame' 'Target Parameters' ------
------ 'frame' 'Status Feedback' ------
'program' 'Add Task' mapped to 'Add Task Import'
====== 'program' 'Add Task Import' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Key Task Name' ------
------ 'frame' 'Task Description' ------
------ 'frame' 'Status Feedback' ------
====== 'program' 'Add Note' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'prepreStatus Feedback' ------
------ 'frame' 'preStatus Feedback' ------
====== 'program' 'Add Operation' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Key Operation Name' ------
------ 'frame' 'Operation Description' ------
------ 'frame' 'Status Feedback' ------
====== 'program' 'Add ECR Import' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Change Type' ------
------ 'frame' 'Change Class' ------
------ 'frame' 'Reason For Change' ------
------ 'frame' 'Product Line' ------
------ 'frame' 'Change Priority' ------
------ 'frame' 'Reason for Urgency' ------
------ 'frame' 'AdditionalSignatures' ------
------ 'frame' 'Conclusion' ------
------ 'frame' 'Conclusion-Urgent' ------
------ 'frame' 'Status Feedback' ------
====== 'program' 'Audioplay' ======
program2.log
Map file 'd:\Matrix\xml\program1.map' successfully read.
An exclude file was not given.
Input baseline file: 'd:\Matrix\xml\program1.xml'.
Type = 'program', Name Pattern = 'A*', Workspace 'excluded'.
Start comparison at 'Wed Jun 21, 2000 2:13:36 PM EDT'.
Baseline version was '9.0.0.0'.
Current version is '9.0.0.0'.
=====================================================
====== 'program' 'Add Component (As-Designed)' ======
description has been changed.
was 'Matrix Prof Services: Contains settings for the program to create and connect and
a new object with AutoName logic.'
now 'Matrix Professional Services: Contains settings for the program to create and
connect and a new object with AutoName logic.'
====== 'program' 'Add Assembly (As-Designed)' ======
====== 'program' 'Add Purchase Requisition' ======
====== 'program' 'Add Event' ======
====== 'program' 'AttributeProg' ======
====== 'program' 'A' ======
====== 'program' 'A1' ======
====== 'program' 'A2' ======
====== 'program' 'Add ECR' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Change Type' ------
------ 'frame' 'Reason For Change' ------
width has been changed.
was '380.0'
now '360.0'
widget 'ReasonForChange' multiline has been changed.
was '0'
now '1'
widget 'ReasonForChange' validateProgram programRef has been changed.
was 'NameCheck2'
now 'NameCheck'
widget 'postECR Input1label4' fontName has been changed.
was 'Arial-bold-14'
now 'Arial-bold-10'
widget 'Reason For Changelabel5' widgetValue has been changed.
was 'Enter The Stock Disposition:'
now 'Enter Stock Disposition:'
------ 'frame' 'Product Line' ------
widget 'Product Linelabel4' has been added.
new absoluteX '0' absoluteY '0' xLocation '198.900009' yLocation '72.000000' width
'160.650009' height '24.000000'
autoWidth '0' autoHeight '0' border '0' foregroundColor '' backgroundColor ''
Version 10 255
widgetType 'label' widgetNumber '100002'
widgetValue 'Enter Product Line' fontName 'Arial-bold-10'
------ 'frame' 'Change Priority' ------
------ 'frame' 'Reason for Urgency' ------
widget 'Product Linelabel4' has been deleted.
was absoluteX '0' absoluteY '0' xLocation '198.900009' yLocation '72.000000' width
'160.650009' height '24.000000'
autoWidth '0' autoHeight '0' border '0' foregroundColor '' backgroundColor ''
widgetType 'label' widgetNumber '100002'
widgetValue 'Enter Product Line' fontName 'Arial-bold-10'
------ 'frame' 'AdditionalSignatures' ------
------ 'frame' 'Conclusion' ------
------ 'frame' 'Conclusion-Urgent' ------
------ 'frame' 'Status Feedback' ------
frame 'Change Class' has been added.
====== 'program' 'Add Assembly' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Make vs Buy' ------
widget 'MakevsBuy' validateProgram programRef has been changed.
was 'NameCheckTest'
now 'NameCheck'
------ 'frame' 'Part Family' ------
------ 'frame' 'Assembly Description' ------
------ 'frame' 'Target Parameters' ------
------ 'frame' 'Status Feedback' ------
'program' 'Add Task' mapped to 'Add Task Import'
====== 'program' 'Add Task Import' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Key Task Name' ------
------ 'frame' 'Task Description' ------
------ 'frame' 'Status Feedback' ------
====== 'program' 'Add Note' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'prepreStatus Feedback' ------
------ 'frame' 'preStatus Feedback' ------
====== 'program' 'Add Operation' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Key Operation Name' ------
------ 'frame' 'Operation Description' ------
------ 'frame' 'Status Feedback' ------
====== 'program' 'Add ECR Import' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Change Type' ------
------ 'frame' 'Change Class' ------
------ 'frame' 'Reason For Change' ------
------ 'frame' 'Product Line' ------
------ 'frame' 'Change Priority' ------
------ 'frame' 'Reason for Urgency' ------
------ 'frame' 'AdditionalSignatures' ------
------ 'frame' 'Conclusion' ------
------ 'frame' 'Conclusion-Urgent' ------
------ 'frame' 'Status Feedback' ------
====== 'program' 'Audioplay' ======
Has been added.
====== 'program' 'Add Task' ======
program1.exc
program “Add ECR”
program “Add Note”
program3.log
Map file 'd:\Matrix\xml\program1.map' successfully read.
Exclude file 'd:\Matrix\xml\program1.exc' successfully read.
Input baseline file: 'd:\Matrix\xml\program1.xml'.
Type = 'program', Name Pattern = 'A*', Workspace 'excluded'.
Start comparison at 'Wed Jun 21, 2000 2:13:28 PM EDT'.
Baseline version was '9.0.0.0'.
Current version is '9.0.0.0'.
=====================================================
====== 'program' 'Add Component (As-Designed)' ======
description has been changed.
was 'Matrix Prof Services: Contains settings for the program to create and connect and
a new object with AutoName logic.'
now 'Matrix Professional Services: Contains settings for the program to create and
connect and a new object with AutoName logic.'
====== 'program' 'Add Assembly (As-Designed)' ======
====== 'program' 'Add Purchase Requisition' ======
====== 'program' 'Add Event' ======
====== 'program' 'AttributeProg' ======
====== 'program' 'A' ======
====== 'program' 'A1' ======
====== 'program' 'A2' ======
====== 'program' 'Add Assembly' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Make vs Buy' ------
widget 'MakevsBuy' validateProgram programRef has been changed.
was 'NameCheckTest'
now 'NameCheck'
------ 'frame' 'Part Family' ------
------ 'frame' 'Assembly Description' ------
------ 'frame' 'Target Parameters' ------
------ 'frame' 'Status Feedback' ------
'program' 'Add Task' mapped to 'Add Task Import'
====== 'program' 'Add Task Import' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Key Task Name' ------
------ 'frame' 'Task Description' ------
------ 'frame' 'Status Feedback' ------
====== 'program' 'Add Operation' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
Version 10 257
------ 'frame' 'Key Operation Name' ------
------ 'frame' 'Operation Description' ------
------ 'frame' 'Status Feedback' ------
====== 'program' 'Add ECR Import' ======
------ 'frame' 'Master Frame' ------
------ 'frame' 'Welcome' ------
------ 'frame' 'Change Type' ------
------ 'frame' 'Change Class' ------
------ 'frame' 'Reason For Change' ------
------ 'frame' 'Product Line' ------
------ 'frame' 'Change Priority' ------
------ 'frame' 'Reason for Urgency' ------
------ 'frame' 'AdditionalSignatures' ------
------ 'frame' 'Conclusion' ------
------ 'frame' 'Conclusion-Urgent' ------
------ 'frame' 'Status Feedback' ------
====== 'program' 'Audioplay' ======
Has been added.
====== 'program' 'Add ECR' ======
Has been excluded.
====== 'program' 'Add Task' ======
Has been added.
====== 'program' 'Add Note' ======
Has been excluded.
=====================================================
End comparison at 'Wed Jun 21, 2000 2:13:29 PM EDT'.
2 objects have been added.
0 objects have been deleted.
2 objects have been changed.
10 objects are the same.
Version 10 261
Administrative Objects that Control Access
Matrix lets you control the information users see and the tasks they can perform. Like
most Business Administrator functions, you control user access in Matrix by defining
administrative objects in Business Modeler.
This chapter describes all the administrative objects that allow you to control user access.
It also defines the various kinds of user access and explains which ones take precedence
over others. Use this chapter to help you plan the administrative objects you should create
and the accesses you should assign. To implement your plan, refer to the chapter in this
guide that describes how to work with each type of administrative object:
configurable user interface The chapter for the object you want to work with
components
When a user attempts to perform a task on a business object—for example, view a file
checked into the object or change the value of an attribute for the object—the system
allows the user to perform the task only if the user has been assigned access to perform the
task. This section describes the administrative objects in Business Modeler that you can
use to control user access. To see a list and descriptions of the accesses you can assign and
deny, see Accesses.
If you are working with an application that has a user interface external to Matrix desktop
or Web Navigator, you may also be able to control access by controlling who sees various
components of the user interface. For example, if you are building a custom applet, you
can use the ADK to determine who sees specific pages and links on the pages. If you are
working with an application that is built with configurable component objects, you can use
access features of those components to control access. Although configurable component
objects are administrative objects that can be used to control access, they are not described
here because they are specific to a particular type of user interface. For information, see
the Application Exchange Framework Guide.
Persons You must define a person object for every person who will use Matrix. There are many
components to a person definition, such as the user’s full name and e-mail address, and
several of these components effect user access.
Person Access
Part of creating a person definition involves specifying the accesses the user should have
for business objects. If the user will ever need to perform a task for any business object,
you must assign the access in the user’s person definition. Other administrative objects,
User Type
Another element of a person definition that can effect user access is the user type. If a
user’s type is System Administrator, Matrix performs no access checking. Therefore, the
system allows such a user to perform any task on any object, even if a policy or rule limits
the user’s access.
You should assign the System Administrator user type only to people who need full access
to all objects, such as a person who will be importing and exporting data or maintaining
vaults and stores. For such a user, you should create a second person definition that is not
assigned the System Administrator user type. When using Matrix for routine work with
business objects, the user should set the session context using this second person
definition.
Also, if the user’s type is Trusted, the system allows the user to perform any task that
requires read access only (viewing basics, attributes, states, or history for the object).
User Categories Three administrative objects allow you to identify a set of users (persons) who require the
same accesses: groups, roles, and associations. The shared accesses can be to certain types
of business objects (as defined in policies) or other administrative objects, such as specific
attributes, forms, relationships, or programs (as defined in rules). When you create a group
or role, you assign specific users to the category. When you create an association, you
assign groups and roles to the association. A user can belong to any number of groups,
roles, and associations.
If many users need access to a type of business object, you should consider creating a user
category to represent the set of users. Creating a user category saves you the trouble of
listing every user in the policy or rule definition. Instead, you just list the user category.
For example, suppose you create a user category, such as a group, and assign 25 users to
the group. Then you assign the group to a state in the policy and grant the group full
access. All 25 users within that group will have full access to objects governed by the
policy. It is easier to build and maintain user categories than to specify individual users in
all policy and rule definitions.
To decide which kind of user category you should create, consider what the users have in
common and why they need some of the same accesses.
• Groups—A collection of people who work on a common project, have a common
history, or share a set of functional skills.
In a group, people of many different talents and abilities may act in different jobs/
roles. For example, an engineering group might include managerial and clerical
personnel who are key to its operation. A documentation group might include a
Version 10 263
graphic artist and printer/typesetter in addition to writers. While the groups are
centered on the functions of engineering or documentation, they include other people
who are important for group performance.
• Roles—A collection of people who have a common job type: Engineer, Supervisor,
Purchasing Agent, Forms Adjuster, and so on.
• Association—A collection of groups, roles, or other associations. The members of the
user categories have some of the same access requirements based on a combination of
the roles users play in the groups in which they belong. For example, perhaps a
notification that an object has reached a certain state should be sent to all Managers in
an Engineering department. Or maybe, only Technical Writers who are not in
Marketing are allowed to approve a certain signature.
Policies A policy controls many aspects of the objects it governs, including who may access the
objects and what tasks they can perform for each state defined in the policy. There are
three general categories used to define who may access objects in each state. For each
category, you may assign full, limited, or no access.
• Public—Everyone in the Matrix database. When the public has access to perform a
task in a particular state, any Matrix user can perform the task (except if they are
denied it in their person definition). When defining public access, it is important to
define access limits. Should the public be able to check in files to the object, override
restrictions for promotions, and delete objects? These are some of the access
questions that you should answer when defining the public access.
• Owner—The person, group, role, or association that currently owns the object. When
a user initially creates an object, the user (person) who creates it is the owner. This
user remains the owner unless ownership is transferred to someone else. In an
object’s lifecycle, the owner usually (though not always) maintains control or
involvement. In some cases, the original owner might not be involved after the initial
state. Typically, the owner has full access to objects.
• User—A person, group, role, or association that has specific access requirements for
a particular state. When a group, role, or association is assigned access, all the persons
who belong to the group, role, or association will have access. Additionally, all
persons assigned to groups and roles that are children of the assigned group or role
will have access. (Child groups inherit all accesses from the parent group and child
roles inherit all accesses from the parent role.)
For example, you may not want the public to make flight reservations. Therefore, the
public is not given access to create reservation objects. Instead, you establish that a Travel
Agency group can originate flight reservations. Any member of that group can create a
reservation object. Note that once an agent creates a reservation object, that agent is the
owner and has all access privileges associated with object ownership.
Assigning user access to groups, roles, and associations is an effective means of providing
access privileges to a user. Under most circumstances, a person will have both a group and
a role assignment and may also have multiple group and role assignments. In many cases,
it is easier to specify the roles, groups, or associations that should have access in a policy
rather than list individual users. This way, if personnel changes during a stage of the
project, you do not need to edit every policy to change user names.
If a user is assigned access (public, owner, or user) in the current state of an object, the
system allows the user to perform the task. For example, suppose a user belongs to a group
and a role. If the policy allows the role to perform the task but does not allow the group to
perform the task, then the user can perform the task.
Working With User access lists defined on a policy or rule can accept a filter expression in order to grant
Expression or deny access to a specific user. If the filter expression evaluates to “true,” the specified
Access Filters access will be granted; otherwise the access is denied.
While evaluating expressions that are part of the Expression Access in a policy, Show
access is not checked since Show access prevents expands, prints and almost all other
commands if the user does not have this access mask. For example, Show access may be
one of the accesses that the user would be evaluating for during a traverse through a set of
connected business objects.
The following describes operands of expression access filters.
• Anything that one can select on a business object can be used as an operand of an
expression access filter. For example:
("attribute[Priority Code]" == "High") && (description ~~ "*test**")
Notice that the business object attribute called “Priority Code” and the business object
description are used as operands.
• Anything that one can select from the context user object can be included as an
operand of an expression access filter. For example:
context.user.isassigned[Group_Name] == true
• Any property defined on the “context user” can be used as operand of an expression.
For example:
context.user.property[Export Allowed].value == true
• Dynamic Expressions stored as business object attributes
You can also define an expression access filter in a business object attribute and have
Matrix evaluate the expression stored in the attribute when checking access. For
example:
Enter following for the expression filter
evaluate attribute[expattr]
Evaluate the expression shown below:
Version 10 265
MQL> evaluate expr 'evaluate attribute[expattr]' on bus ECR1 test 0;
TRUE
Matrix first extracts the expression stored in the attribute “expattr” and then evaluates
that expression. Here is what is stored as value of the attribute “expattr”:
context.user.isassigned[MX-GROUP-1] == true && context.user.isassigned[Ind_ass] == true
• Dynamic Expressions stored as a description of a business object
You can define an expression access filter in a business object description and have
Matrix evaluate the expression stored in the description. For example:
Enter following for the expression filter:
evaluate description
Evaluate the expression shown below:
MQL> evaluate expr 'evaluate description' on bus ECR1 test 0;
TRUE
Matrix first extracts the description of the business object and then evaluates that
expression. Here is what is stored as a description of the business object:
context.user.isassigned[MX-GROUP-1] == true && context.user.isassigned[Ind_ass] == true
• Dynamic Expressions stored in a description of a connected control object.
Example:
Assembly MTC1234 0 is connected to
Assembly MTC3456 0 by relationship ECR1
Assembly MTC3456 0 is connected to
Part MTC6789 0 by relationship ECR2
Evaluate the expression shown below:
MQL> evaluate expr 'evaluate
to[ECR1].businessObject.to[ECR2].businessObject.description' on bus Assembly "MTC 1234"
0;
Matrix first extracts the description of the business object “Part MTC6789 0” and
then evaluates the expression. Here is what is stored as a description of the business
object Part MTC6789 0:
context.user.isassigned[MX-GROUP-1] == true && context.user.isassigned[Ind_ass] == true
This allows storing the expression filter rule in some central to which all objects to be
controlled are connected.
There is one way users can gain access privileges that isn’t controlled by the Business
Administrator using administrative objects. In Matrix Navigator, users can grant any or all
the access privileges they have for a business object to another user or group. However, a
user can only grant accesses on an object to another user or group if the grantor has the
“grant” access privilege for the object. As Business Administrator, you control who has
grant access by assigning or denying the grant access in the person definition and in policy
definitions.
Users can only grant accesses that have been assigned to them in their person definition or
in a policy for an object’s current state. For example, if a grantor’s person definition
denies the override access privilege, the user cannot grant that privilege to another user.
However, a grantee can be granted privileges that are denied in his/her person definition.
(This is the only way users can perform a task that is denied in their person definition.)
Such a user could not then grant the privilege to another user.
The MQL command and ADK methods for granting business objects allow users to:
• grant an object to multiple users
• have more than one grantor for an object
• grant to any user (person/group/role/association)
• use a key to revoke access without specific grantor/grantee information
Custom ADK programs and MatrixOne applications can take advantage of the
enhancements. However, desktop Matrix and Matrix Applet (Web) user interfaces do not
support these changes.
For information on how to grant access to objects, see Granting Access in Chapter 35.
Version 10 267
Which Access Takes Precedence Over the
Other?
Suppose a user’s person definition does not include delete access but a policy assigns
delete access to the user. Will the user be able to delete an object governed by the policy?
The answer is no, the user won’t be able to perform the action because the person
definition takes precedence over the policy. This section describes which kinds of access
take precedence over others. To see a flow chart that represents this information, see
Access Precedence: Flow Chart.
Access The highest level of access control occurs through the user interface: users who have
Precedence: delete access for an object can only delete the object if the user interface provides some
Description mechanism, such as a Delete link, button, or menu option, that lets users delete the object.
If you are working with an application that is built using configurable components (for
example, command, menu, table, form objects), you can use access features for these
components to control who can see these user interface elements. The access features
include restricting user interface components to specific roles or access privileges. Some
components also let you control access using a select expression or JPO. For information
on the access controls available for configurable components, see "Controlling User
Access to User Interface Components" in the Application Exchange Framework Guide.
When a user attempts to perform an action for a business object, the system checks to see
what type of user is defined in the user’s person definition. If the user is a System
Administrator-type user, the system allows the action and performs no further checking. If
the user is Trusted and the action involves read access only, the action is permitted.
If the user is not System Administrator or Trusted (or if the user is Trusted and the action
involves more than read access), Matrix checks the user’s person definition. A user’s
person definition takes precedence over accesses granted in the policy definition—if an
access is denied in the person definition, the user will not have that access, even if a policy
assigns the access. However, a person can be “granted” access to a business object even if
the action is denied in the person definition. (See Access that is Granted.)
If the person definition allows access, Matrix next examines the current state of the policy
to see if the user is allowed access. The policy allows the user access if the access for the
action is assigned to the:
• public or
• owner and the user is the owner or
• user or to a user category (group, role, association) to which the user belongs
If the user is denied access in the policy or person definition, the system checks to see if
the user has been granted the access for the business object by another user. If so, the
system makes sure the grantor has the access by going through the same access checking
as described above. If the grantor has access, then the user is allowed to perform the
action. If the user has not been granted access or the grantor doesn’t have the access, the
action is denied.
If the policy and person definition allow the access or if the user has been granted access,
the user is allowed to perform the action with one important exception. If the action
involves an attribute, relationship, form, or program, the system first checks to see if any
rules deny access. If the system finds a rule that governs the attribute, relationship, form,
Version 10 269
Access
Precedence:
Flow Chart
The UI provides a link or other (Configurable component objects,
control that lets a user perform an such as menu and command
action. The user tries to perform objects, can be configured to
the action for a business object. control who has access to UI
elements.).
A
(If the action involves read
User is allowed to access only, then Trusted
Y Is the user a System N
perform the action. users are also automatically
Administrator-type user?
allowed to perform the action).
An access is the permission to perform a particular task or action within Matrix. You
assign accesses in person definitions, policies, and rules. In policies and rules, you can
assign or deny accesses to the public (all users), owner, or users (persons, groups, roles,
and associations). Matrix users also can grant their accesses for an object to other users.
This table lists and describes all the accesses available and shows which administrative
object uses each access.
Summary of All
Accesses
Can be
Access Privilege Allows a user to: assigned in:
Read View the properties of an object, including basics attributes, states, and Person definition
history. For more information, refer to the More About Read Access, below. Policy definition
To delete files checked into a business object, a user must have read and Rule for attributes
checkin access.
Modify Edit the attributes of an object or relationship. Person definition
Policy definition
Rule for attributes
Rule for
relationships
Delete Delete an object from the database. Does not apply to files. To delete files Person definition
checked into a business object, a user must have both read and checkin Policy definition
access.
CheckOut Copy files contained within a business object to the local workstation. Also Person definition
allows the user to open a file for viewing. Policy definition
To allow a user to use the open for edit command for files checked into an
object, the user must have checkin, checkout, and lock access for the object.
CheckIn Copy files from the local workstation to a business object. Person definition
To allow a user to use the open for edit command for files checked into an Policy definition
object, the user must have checkin, checkout, and lock access for the object.
To delete files checked into a business object, a user must have both read and
checkin access.
Schedule Set and modify schedule dates for the states of a business object. Person definition
Policy definition
Version 10 271
Can be
Access Privilege Allows a user to: assigned in:
Lock Restrict other users from checking files into a business object and from Person definition
opening files for editing. Policy definition
To allow a user to use the open for edit command for files checked into an
object, the user must have checkin, checkout, and lock access for the object.
If an object is governed by a policy with enforce locking turned on, users can
only lock the object when checking out a file. Users cannot manually lock the
object. Enforce locking prevents one user from overwriting changes to a file
made by another user. See also the discussion of enforced locking in Enforce
Clause in Chapter 17.
Execute Execute a program. This access applies only when assigning rules for Rule for programs
programs. It does not apply in person or policy definitions. A program rule
establishes who has the right to use the programs to which it is assigned by
setting owner, public, and user accesses in the rule. Applies only to programs,
including wizards, executed explicitly by the user; that is business object
methods and those executed via a custom toolbar.
UnLock Release a lock placed on a business object by another user. Users may Person definition
release locks they themselves have placed on objects without this access. Policy definition
Reserve unlock access only for those users who may need to override
someone else’s lock, such as a manager or supervisor.
Unlocking an object locked by another user should especially be avoided for
objects governed by policies with enforce locking turned on. For information
on enforce locking and how unlocking objects manually can cause confusion,
see Enforce Clause in Chapter 17.
Freeze Freeze, or lock, a relationship so that business objects may not be Person definition
disconnected until the relationship is thawed. Also, the type or attributes of a Policy definition
frozen relationship may not be modified. Rule for
relationships
Thaw Thaw, or unlock, a relationship so that it may be modified or deleted. Person definition
Policy definition
Rule for
relationships
Note: When a user attempts to perform a task that requires freeze or thaw access, the system checks
the access privileges for the objects on both sides of the relationship (defined in the relevant policies),
as well as accesses defined for the relationship type (defined in relevant access rules).
Create Create original and clone business objects. Create access applies only for the Person definition
first state of an object. If a policy gives the owner or the public create access Policy definition
in the first state of an object, anyone will be able to create that type of object
(when objects are created, the owner is the one performing the function). To
allow only a certain group, role, person, or association to be able to create a
specific type of object, deny create access for the owner and public in the
object’s first state. Then add a user access for the person, role, group, or
association that includes create access.
Revise Create a revision of a selected business object. Person definition
Policy definition
Promote Change the state of an object to be that of the next state. Person definition
Policy definition
Enable Unlock the state so that a business object can be promoted or demoted. Person definition
Policy definition
Disable Lock a state so that a business object cannot be promoted or demoted. Person definition
Policy definition
Override Disable requirement checking allowing for promotion of an object even when Person definition
the defined conditions for changing the state have not been met. Policy definition
ChangeName Change the name of a business object. Person definition
Policy definition
ChangeType Change the type of a business object or relationship. To change a relationship Person definition
type, the user needs changetype access for the object on both ends of the Policy definition
relationship and on the relationship. Rule for
relationship
ChangeOwner Change the owner of a business object. Person definition
Policy definition
ChangePolicy Change the policy of a business object. Person definition
Policy definition
ChangeVault Change the vault of a business object. Person definition
Policy definition
FromConnect Link business objects together on the “from” side of a relationship. Person definition
Policy definition
Rule for
relationships
ToConnect Link business objects together on the “to” side of a relationship. Person definition
Policy definition
Rule for
relationships
FromDisconnec Dissolve a relationship on “from” business objects. Person definition
t Policy definition
Rule for
relationships
Version 10 273
Can be
Access Privilege Allows a user to: assigned in:
ToDisconnect Dissolve the “to” side relationship between business objects. Person definition
Policy definition
Rule for
relationships
Note: When a user attempts to perform a task that requires connect or disconnect access, the system
checks the access privileges for the objects on both sides of the relationship (defined in the relevant
policies), as well as accesses defined for the relationship type (defined in relevant access rules).
ViewForm View a form. The ViewForm and ModifyForm accesses apply only when Rule for forms
assigning rules for forms. It does not apply to person or policy definitions. A
form rule establishes who can view and modify the form to which it is
assigned by setting owner, public, and user accesses in the rule.
ModifyForm Edit attribute and other field values in a form. Rule for forms
Show Control whether a user knows that a business object exists. The access Person definition
privilege is designed to prevent a user from ever seeing the type, name, or Policy definition
revision of an object. Rule definition
More About Read The read access privilege allows a user to view the properties of an object, including basic
Access information, attributes, states, and history. For example, if a user does not have read
access for an object, the user will not be able to see the Object Inspector, Attributes,
Basics, States, or History dialog boxes when the object is selected. Furthermore, the user
won’t be able to expand on the object using the Navigator browser or view the Image
assigned to the object. When a user performs queries based on criteria other than type,
name, and revision, Matrix will only find those objects to which the user has read access.
This applies also to visual cue, tip, and filter queries: Matrix will not apply the visual,
filter, or tip to objects found by the query if the user does not have read access to them.
All users have access to tables (both indented and flat) and reports. If a user does not have
read access to an object, Matrix displays only the type, name, and revision. Table cells that
provide additional information on objects to which there is no read access display
“#DENIED!”. Reports work in a similar manner, providing only the information to which
the user has access. MQL commands using SELECT or EXPAND also return #DENIED! if
the user does not have read access. When read access is denied on an attribute, the
#DENIED! message is displayed there as well.
If read access to a business object is denied, the system does not display the Attributes or
the States browser. This prohibits functions such as modify, promote, demote, and so on.
In MQL, however, if users have these privileges, the transactions are allowed. For
example, if a user has no read access but does have modify access, the user may modify
the object’s attributes in MQL. This is because the user does not have to print the business
object (which would not be permitted) before modifying it.
However, if a user has modify or promote access for an object, it makes little sense to
deny read access. Similarly, allowing a user to check out files without assigning read
access only partially prohibits the user from seeing information for the object. Carefully
think through how you assign accesses, whether you are assigning accesses for users
(person, group, role, and association), policies, or access rules. Read access must be used
logically in conjunction with the other accesses.
More About Show When a user does not have show access, Matrix behaves as if the object does not exist. So,
Access for instance, the print businessobject command errors out with the same error as
if the object does not exist.
Without show access for an object, the user will never see the object or any information
about that object in any browser or in MQL. Specifically, the user will not see the object
displayed under these circumstances:
• Performing a “find” in the desktop or Web versions.
• Opening a set.
• Clicking on the plus sign in a Navigator dialog in the desktop or Web clients.
• Evaluating a query in MQL.
• Running the expand businessobject command in MQL.
• Running the print set command in MQL.
• Running the expand set command in MQL.
• Running the print connection command in MQL.
• Reading an email message sent via Matrix that includes a business object that was
routed or sent.
• Opening the revisions dialog.
• In the History of an object, other objects are sometimes referred to. The performance
impact of determining whether the current user has access to see the Type, Name and
Revision of such objects is significant and unavoidable. This performance impact will
NOT be resolved by this feature, but individual history records can be deleted using
the delete history clause of the modify businessobject or modify
connection command. This can be used in action triggers to remove such
records.
Additionally, a user who does not have show access for an object will not see references to
the object when these operations occur:
• Running the evaluate expression command in MQL.
This command evaluates an expression against either a single, named business object
or against a collection of them specified via some combination of sets, queries, and/or
expansions. In the former case, when a user does not have show access, the command
behaves as if the object does not exist. In the latter case, it simply leaves the object out
of the collection.
• Running any of the businessobject commands in MQL.
• Running various commands against a set, including the execute, modify, copy,
and expand commands. In general, a “set” command will behave as if the object
does not exist in the set.
Version 10 275
• If a user has no show access to an object, then the object is not presented as the next
or previous revision of an object to which the user does have show access. Such
objects are simply left out of (skipped from) the revision sequence. So if there are
three objects in a revision sequence with revisions 1, 2, and 3 in that order and the
user has show access only to 1 and 3, the next revision of 1 will be represented as 3.
• If the user tries to create an object that exists, but they cannot see, they will receive an
error message indicating “Access denied.”
More about Objects can be connected in desktop Matrix using drag and drop, and the relationship to
Connection use may be chosen from the connect bar. You can use the same technique to connect a new
Accesses object and remove an old object in one step. When replacing an object using drop connect,
if you drop onto a child object to replace it, Matrix keeps the same relationship that was
already there rather than using the relationship shown in the connect bar. You are actually
modifying one end of the connection, not deleting the relationship and creating a new one.
This means that to/fromconnect and to/fromdisconnect accesses are checked only on the
end of the connection that is changing.
You could create a relationship rule to control this behavior by limiting modify access to
those who should be allowed to do so. Alternatively, a trigger program could control the
ability to perform the replacement.
The left column of this table lists goals you may have for controlling user access to
information and tasks. The right column summarizes what you need to do to accomplish
the goal.
Version 10 277
278 MQL Guide
11
Working With Users
Kinds of Users .............................................................................................. 280
Integrating with LDAP and Third-Party Authentication Tools.................. 281
System-Wide Password Settings ................................................................ 282
Encrypting Passwords .................................................................................... 285
Working with Persons .................................................................................. 286
Defining a Person ........................................................................................... 286
Copying and/or Modifying a Person Definition.......................................... 301
Copying (Cloning) a Person Definition............................................................ 301
Modifying a Person Definition ......................................................................... 301
Deleting a Person ......................................................................................... 304
Determining When to Create a Group, Role, or Association.................... 305
Working with Groups and Roles ................................................................. 307
Establishing Group and Role Hierarchy.......................................................... 307
Defining a Group or Role ................................................................................ 308
Modifying a Group or Role Definition.............................................................. 312
Deleting a Group or Role Definition ................................................................ 312
Working with Associations.......................................................................... 315
Uses for Associations ..................................................................................... 315
Defining an Association .................................................................................. 316
Copying (Cloning) an Association Definition................................................... 319
Modifying an Association Definition ................................................................ 319
Deleting an Association .................................................................................. 320
Role-Based Visuals ...................................................................................... 321
Sharing Visuals............................................................................................... 321
Version 10 279
Kinds of Users
Business Modeler contains four kinds of administrative objects that represent individual
users and sets of users: persons, groups, roles, and associations. The primary function of
these objects is to allow you to control the information users can see and the tasks they can
perform. This chapter explains the circumstances under which you should define these
administrative objects and describes how to define each. Before reading this chapter, you
should read Chapter 10, User Access for an overview of how these objects allow you to
control user access and how they work with other administrative objects that control
access, such as policies and rules.
Matrix integrates with Lightweight Directory Access Protocol (LDAP) services, so you
can use an LDAP service, such as openLDAP or Netscape Directory Server, as a
repository to store information about users. The Matrix integration uses a toolkit from
openldap.org (http://www.openldap.org/) for the underlying access protocols and is
compliant with LDAPv3. The integration lets you authenticate users based on the users
defined in the LDAP database. The integration lets you specify the user information to
retrieve from the LDAP service, including address, comment, email, fax, fullname,
groups, password, phone, and roles.
Matrix also lets you authenticate users (persons, groups, or roles) with an external
authentication tool such as Siteminder, instead of authenticating through Matrix. Matrix
provides Single Signon when external authentication is used. This means when a user
attempts to access Matrix (by logging into a MatrixOne application or the Web version of
Matrix Navigator; external authentication does not apply to the Desktop version) after
having been authenticated externally, Matrix allows the user access and does not present a
separate login dialog.
Be aware of the following limitations related to LDAP integration and/or external
authentication:
• MatrixServletCORBA does not support external authentication.
• External authentication using LDAP integration is not supported for loosely-coupled
databases.
• LDAP integration is not supported on SGI IRIX or Compaq True 64 operating
systems.
• The integration works with LDAP version 2 servers but version 3 features, such as
TLS/SSL, will not work when running on a version 2 server. MatrixOne recommends
using version 3 servers.
• LDAP user names and passwords can contain special characters, but do not use the
following: “ , ‘ * (that is, double quote, comma, single quote, asterisk), since they are
used within Matrix as delimiters. The local operating system of the LDAP directory
may have further character restrictions.
For details on how to set up integration with an LDAP service and/or an external
authentication tool, see the Matrix Installation Guide.
Version 10 281
System-Wide Password Settings
Before defining users, you should consider what your company’s password policies are
and set system-wide password settings to enforce them. One setting allows you to deny
access in the current session to a user who makes repeated failed login attempts. Other
settings allow you to control the composition of passwords. For example, you can require
that users change their passwords every 90 days, that passwords be at least six characters,
and that reusing the old password be prohibited.
The system-wide password settings apply to:
• Every person defined in the database, except users whose person definition includes
either the No Password or Disable Password clause
• Every attempt at setting a context, whether the attempt be in Matrix Navigator, the
Business Modeler, the System application, or MQL
• Only passwords that are created or changed after the setting is defined, except for the
expiration setting which affects all passwords. For example, suppose you set the
minimum password size to 4 characters. From that point on, any password entered in
a user’s person definition and all new passwords defined by the user in Matrix
Navigator must be at least 4 characters. Any existing passwords that contain less than
4 characters are unaffected. (Tip: You can make passwords for existing users conform
to new system-wide password settings by making users change their passwords. Do
this for all users by using the expires clause, or per user by using the
passwordexpired clause.)
The following statement allows you to set or change system-wide password settings.
set password PASSWORD_ITEM {PASSWORD_ITEM};
maxsize NUMBER
lockout NUMBER_OF_TRIES
expires NUMBER_OF_DAYS
[!|not]allowusername
[!|not]allowreuse
[!|not]mixedalphanumeric
[!|not]minsize
[!|not]maxsize
[!|not]lockout
[!|not]expires
cipher CIPHER_NAME
Minsize
The Minsize clause of the Set Password statement requires that all passwords be at least a
certain number of characters. To remove a minimum size password setting, use the
keywords !minsize or notminsize.
Defining a minimum password size of at least 1 ensures that users actually create a
password when changing their password. If there is no minimum password size, a user
could leave the new password boxes blank when changing passwords, resulting in the user
having no password.
Maxsize
The Maxsize clause of the Set Password statement sets an upper limit on the number of
characters a password can contain. To remove a maximum size password setting, use the
keywords !maxsize or notmaxsize.
For example, to require that users’ passwords are least 6 characters and not more than 15,
use:
set password minsize 6 maxsize 15;
Lockout
The Lockout clause of the Set Password statement prevents a user from logging in after
s/he has entered an incorrect password n number of times during a session.
After being locked out, the user’s person definition is changed to “inactive.” The only way
for the user to log in again is to contact the Matrix Business Administrator to have the
setting changed.
In the event that all Business Administrators are locked out, it is possible to resort to the
use of SQL to access the database.
To remove a lockout setting, use the keywords !lockout or notlockout.
For example, the following statement allows the user three tries to provide the correct
password:
set password lockout 3;
Expires
The Expires clause of the Set Password statement requires that users create a new
password every n number of days. After the specified number of days has elapsed, the
system requires users to create a new password in order to log in. To remove the setting,
use the keywords !expires or notexpires.
Version 10 283
For example, use the following statement if you want users to provide a new password
every month:
set password expires 30;
When you turn on password expiration, passwords that were created prior to version 8
will expire the next time users attempt to log in.
Allowusername
The Allowusername clause of the Set Password statement allows users to create a
password that is the same as their username. This is the default. To prevent users from
having the same username and password, use the following:
set password notallowusername;
Allowreuse
The Allowreuse clause of the Set Password statement allows users to enter the same
password as their old password. This is the default. To prevent users from keeping the
same password, use the following:
set password notallowreuse;
Mixedalphanumeric
The Mixedalphanumeric clause of the Set Password statement requires that passwords
contain at least one number and at least one letter. To remove the setting, use the keyword
!mixedalphanumeric or notmixedalphanumeric.
Cipher
The Cipher clause of the Set Password statement specifies the algorithm used to encrypt
passwords.
set password cipher CIPHER_NAME;
CIPHER_NAME is the cipher to be used. It must be one of the LDAP supported ciphers:
crypt, md5, sha, smd5, ssha. The default is crypt, which uses only the first eight
characters for encryption and comparison.
Setting a new cipher for password encryption does not affect existing passwords. That is,
only passwords created or changed after the cipher is specified with the above command
will be stored using the new encryption algorithm. To make use of the new cipher,
existing users must change their password. Business Administrators can include the
Expires clause when setting the cipher to ensure that all users redefine their password.
For example:
set password cipher ssha expires 1;
After the above statement is issued, existing user passwords will expire in one day, forcing
users to enter a new password. Newly defined passwords will be encrypted using the ssha
cipher.
Encrypting For LDAP environments, the following MQL command encrypts a password using the
Passwords same algorithm used for encrypting the Matrix bootstrap file password. After executing
the command, MQL outputs the encrypted text string. Copy and paste it to the file or
location where you want to save it.
encrypt password PASSWORD_STRING
For example, to encrypt the password “secret”, enter:
encrypt password secret
For details on LDAP authentication, see the Matrix Installation Guide.
Version 10 285
Working with Persons
A person is someone who uses any Matrix application, not only Matrix Navigator,
Business Modeler, System Manager, and MQL, but also, applications that are part of the
eservices application suites available from MatrixOne, as well as those written with the
Matrix ADK. The system uses the persons you define to control access, notification,
ownership, licensing, and history.
Two persons are defined when Matrix is first installed:
• creator This person has full privileges for all Matrix applications.
• guest This definition exists for people who use Matrix infrequently.
You, as the Business Administrator, should first add yourself as a person (Business
Administrator) in Matrix. You should then add a person defined as a System
Administrator. (The Business and System Administrators may or may not be the same
person.)
You can also define persons who are not users of the system. This is useful for sending
notifications to people outside the Matrix system or for maintaining history records
associated with people who no longer work in the organization.
To improve workflow, you may also want to define a person that doesn’t represent a real
person. For example, you could define a person to represent the company. When objects
reach the end of their lifecycle and are no longer actively worked on, you can have the
system reassign the objects to this person. Having the company person own inactive
objects allows standard users to perform owner-based queries that return only objects that
currently require the users’ attention. (The Corporate person in Matrix application suites
serves this purpose.)
After you define a person, you can assign the person to user categories (groups, roles, and
associations). Use the user categories in policies and rules to control user access.
Defining a Person There are many parameters that you can enter for a person. While only a name is required,
you can use the other parameters to further define the person’s relationship to existing user
categories, assign accesses, establish security for logging in, as well as provide useful
information about the person.
Matrix users are defined with the Add Person statement:
add person NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the person you are creating. All persons must have a unique person
name assigned. This name cannot be shared with any other user types (groups, roles,
persons, associations). This name will appear in all windows where persons are listed.
You could use the system login, if available. In this way you can link the user’s context
and vault which are associated with the system login. Then, when the person starts a
Matrix session, s/he will automatically begin in his/her context with the specified vault.
The person name is limited to 127 characters. For additional information, see Business
Object Name in Chapter 35.
ADD_ITEM is an Add Person clause that provides more information about the person you
are defining. While none of the clauses is required to make the person usable, they define
address VALUE
comment VALUE
certificate FILENAME
email VALUE
enable email
disable email
fax VALUE
fullname VALUE
[!|not]hidden
icon FILENAME
enable iconmail
disable iconmail
vault VAULT_NAME
site SITE_NAME
password VALUE
no password
disable password
[!|not]passwordexpired
phone VALUE
Each clause and the arguments they use are discussed in the sections that follow.
Access Clause
The access clause of the Add Person statement specifies the maximum amount of access a
person will be allowed. When this clause is used, you can select from many different
forms of access. Each access is used to control some aspect of a business object’s use.
With each access, other than all and none, you can either grant the access or explicitly
deny the access. You deny an access by entering not (or !) in front of the access mask in
the statement.
Version 10 287
Business objects are governed by a policy. The policy defines who has access and when.
Depending on the business object’s state and the person involved, a user may have full,
limited, or no access. Generally, the policy that governs the object restricts the access by
role or group name. In some cases, that may mean that more access is granted than you
might desire for a particular person.
If you want to prevent a person from ever having a form of access, you may do so by
denying that access in the person’s definition. For example, assume you have a user who
continually overrides the signature requirements for business objects. This can be done
with an access clause such as:
add person George
access all, notoverride;
Even if George is granted override access via a policy, the access will be denied.
For more information on user access, see Chapter 10, User Access. For more information
on how access is controlled, see Working With Policies in Chapter 17.
Access can be assigned or denied using one of two methods:
• all—The person has access to all functions except those listed.
• none—The person has access to only the functions listed.
The method you use will depend on whether most access will be permitted or denied. The
default is None.
Using All:
access all, notchangeowner, notcheckout, notdisconnect, notdelete,
notdemote, notdisable, notenable, notoverride, notschedule
Using None:
access none, checkin, connect, create, promote, lock, unlock, modify, read
If the amount of access being permitted or denied is about the same, the method does not
matter. However, when the amount of access being permitted or denied is heavily
weighted toward one or the other, the method you choose can save you time (and typing!).
If the access clause is not included all is assumed.
Admin Clause
Users defined as Business and System Administrators can be assigned access to the
definitions for which they are responsible. For example, one Business Administrator may
be responsible for adding and modifying users; another for the business definitions of
attributes, types, policies, etc.; and a third for the programs, wizards, report and forms. All
administrators will be able to view all definitions, but create and modify access is
controlled by the settings in the Administration Access of the person.
Administration Accesses
association attribute form format
group inquiry location menu
person policy portal process
program property relationship report
role rule server site
store table type vault
wizard
You can type not or ! at the beginning of an access to explicitly deny the access; for
example, !policy or notserver.
Administrative access can be assigned or denied using all or none in the same manner
as when User access is assigned. For example:
add person George type business
access all, notoverride admin type attribute
policy;
If a person’s type is business or system, and the admin clause is not included all is
assumed.
Address Clause
The Address clause of the Add Person statement specifies an address for the person. This
address could be a mail stop, a street address, or an electronic address. Although this
clause is not required, it is helpful to reach the person. An address is limited to 255
characters.
For example, you could assign an address to a user named Wolfgang using either of these
statements:
add person wolfgang
address “43 Hill Brook Ave, Shelton CT 06484”;
Or:
add person wolfgang
address “Mail Stop ES3-A5”;
Although each example shows a different address, you can include only one Address
clause in a person’s definition. Remember, though, that the value can be any length. You
could include all associated addresses in the value of the Address clause. If you do this,
remember to place the most important addresses first and to keep it to a minimum to
improve readability.
Assign Clause
The Assign clause of the Add Person statement associates the person you are defining
with one or more Matrix roles or groups. (Roles are described in Working with Groups
Version 10 289
and Roles later in this chapter. Although it is not necessary to assign a person to a group or
role, it is commonly done to provide easy access to business objects and access privileges.
The Assign clause uses the following syntax:
assign [group GROUP_NAME] [role ROLE_NAME]
Assigning a Role
To assign a role, use the Assign Role variation of the Assign clause. The key to
determining whether a person should be assigned to a role is the job s/he performs. The
role identifies the person’s need to access particular business objects, the amount of access
required to do the job, and when the access is needed.
Access to business objects and the files they contain is governed by a policy. The policy
can define the groups, roles, and persons that do or do not have access to the business
objects (see Working With Policies in Chapter 17). The access and amount of access for
these classifications can change at various stages of the project life cycle. In many cases, it
is easier to specify the roles or groups that should have access in a policy rather than list
individual users. If personnel changes during some stage of the project, you do not have to
edit every policy to change person names.
To assign a person to a role in the Add Person statement, you use the Assign Role clause:
assign role ROLE_NAME
ROLE_NAME is the name of a previously defined role. If that role was not previously
defined, an error message is displayed.
You can assign a user to a role in two ways, depending on how you are building your
database:
• In the person definition, as described here.
• With the Assign Person clause in the Add Role statement described in Defining a
Group or Role.
If you choose to define the persons first, you can assign them to the role later. If you
choose to define persons last, you can make the role assignment in the Add Person
statement. Regardless of where you define it, the link between the role and person will
appear when you later view either the role definition or the person definition.
In this definition, the defined person is assigned two roles. While the roles are similar,
there are distinctions between the Lead ER Doctor and other doctors. Therefore both role
assignments are made. Remember that a single person may play many roles in a project. If
the role is associated with a policy, it is easier to move a person from one role to another
than to edit the policy for each person’s name.
Assigning a Group
Persons can be assigned to groups by using the Assign Group variation of the Assign
clause. As with assigning roles to a person, assigning a group is not required. However,
assigning a group to a person is often the simplest way to assign access privileges to a new
user.
In Matrix, a group identifies a set of users who should share access to selected business
objects. In an engineering environment, it might be everyone who is working on a
particular project. They would need to have access to drawings and documentation at
different stages of the project in order to perform their jobs.
In Matrix, you can specify which groups have access to business objects and when they
have access by using the group name in the policy definition.
As stated in the previous section, access to business objects is governed by a policy. When
a group is listed as a valid user in the policy, every person associated with that group has
access to all business objects governed by the policy. If you know that a person will work
with a group of people in the same function or project, it is easier to assign the person to
the group than to edit the policy to add the person’s name as a valid user.
To assign a person to a group in the Add Person statement, you use the Assign Group
clause:
assign group GROUP_NAME
GROUP_NAME is the name of a previously defined group. If this name was not previously
defined, an error message is displayed.
You can assign a user to a group in two ways, depending on how you are building your
database:
• In the person definition, as described here.
• With the Assign Person clause in the Add Group statement described in Defining a
Group or Role.
If you choose to define the persons first, you can assign them to the group later. If you
choose to define persons last, you can make the group assignment in the Add Person
statement. Regardless of where you define it, the link between the group and person will
appear when you later view either the group definition or the person definition.
Assume you entered the following Add Person statement:
add person sheila
comment “Assesses Training Needs and Implements Classes”
assign role “Training Coordinator”
assign group “Corporate Training”
assign group “Customer Service”;
Version 10 291
In this definition, the person is associated with two groups and one role. The person needs
access to the customer service objects in order to work with customers who require
training. The person also needs access to the business objects used by the training group.
Each of these categories implies different access capabilities.
Since the Training Coordinator role is related to the Corporate Training group, this
definition could be simplified by assigning the role with the related group. The following
example rewrites the definition using the role and group combination:
add person sheila
comment “Accesses Training Needs and Implements Classes”
assign group “Corporate Training” role “Training Coordinator”
assign group “Customer Service”;
Remember to determine which objects a person will need access to and when that access
is required. The answer to those questions can guide you when assigning groups and roles
to a person.
Comment Clause
The Comment clause of the Add Person statement provides general information about the
person’s function and the required privileges. You can have only one Comment clause in
any person definition.
There is no limit to the number of characters you can include in the comment. However,
keep in mind that the comment is displayed when the mouse pointer stops over the person
in the User chooser. Although you are not required to provide a comment, this information
is helpful when a choice is requested.
There may be subtle differences in the access privileges required by different users. You
can use the Comment clause as a reminder of why this person is defined a certain way. If a
person is assigned the wrong group or role, s/he may not be able to fully access the types
of business object at the proper times in the object life cycle or may have inappropriate
access to an object. Therefore, it is important to completely distinguish all persons.
For example you could have two quality control persons. One person performs testing of
component assemblies and the other performs testing of the final machine. While they
may belong to the same group (Quality Control) and there are similarities in their roles
(Quality Testing), they are unique persons.
To distinguish between persons, you should include any descriptive comments meaningful
to you to determine the person to contact when services are required.
For example, in the statements that follow, you can clearly identify the person you would
call if you were interested in upgrading your personal computer.
add person sandy
comment “Provides PCs sales support”;
add person amed
comment “Provides Apple product sales support”;
add person miquel
comment “Provides workstations and mainframes sales support”;
As you can see, each person provides sales support. However, the types of products they
serve are different. These clauses enable another Matrix user to distinguish the persons.
The clauses enable you to determine if a person needs access to business objects.
Mail options
When mail is sent, the sender does not know how it is being delivered. The recipient’s
person definition establishes how it is received—as IconMail, email, both IconMail and
email, or neither IconMail nor email.
eMail Clause
The Email clause of the Add Person statement specifies an external electronic mail
address. This is an address that is used by the user’s non-Matrix electronic mail utility to
connect him/her to other users in the system. Since this address is highly dependent upon
the external mail utility, there can be a wide variation in the style and content of the email
address. This clause is required if email is enabled (as described below). The email size
limit is 127 characters.
The following is an example of an Email clause:
add person harriet
email [email protected];
This email address does not affect the Matrix internal mail system (IconMail). The Matrix
mail utility uses the person’s defined name, role, or group as the address.
Enable Email (Distribution of Mail) Clause
The Enable Email clause of the Add Person statement enables an external electronic mail
address for email. The email address specified in the person definition (using the Email
clause described above) is used to deliver mail outside of Matrix. This address is used by
the system (not the Matrix mail utility, IconMail) to connect the user to other users in the
system.
You can specify that outgoing messages are sent to email or IconMail (as described for the
Enable Iconmail Clause) or both.
The following is an example of an Enable Email clause:
add person harriet
email [email protected];
enable email
Since this address is dependent upon the system’s mail utility, there can be a wide
variation in the style and content of the email address. This address does not affect the
Matrix internal mail system (IconMail). IconMail uses the person’s defined name, role, or
group as the address.
When a Person is cloned or created with email enabled but no email address has been
specified, the following warning is received:
Warning: #1900296: Person 'NAME' has email enabled, but no
email address. Use of a fully qualified email address is
recommended.
The warning is also shown when a person's email setting is enabled during modification.
If an existing Person has email enabled with no address specified, no warning is given if
Version 10 293
only other settings are modified. Warnings are also not given when Person's are created
during import.
Matrix IconMail uses the person’s defined name, role, or group as the address.
Fax Clause
The Fax clause of the Add Person statement associates a fax number with the person. You
can include additional information with the fax number. The Fax clause is limited to 64
characters. For example, the following are valid uses of the Fax clause:
add person shandrika
fax “(203) 987-5584”;
add person “A-1 Consulting Agency”
fax “(617) 535-9857 please call before faxing”;
Fullname Clause
The Fullname clause of the Add Person statement specifies the full name of the person
you are defining. This name could be the name of the person as it appears in personnel
records or the person’s signature name. Often when defining a person, the name is
abbreviated or shortened. You can include the person’s full name as well with the
Fullname clause. The full name is limited to 127 characters.
All persons must have a named assigned. When you create a person, you should assign a
name that has meaning to both you and the user. If the number of users is small, you may
want to use only the first or last name as the person name. If there are larger numbers of
Matrix users, you may want to use the full name or a name and initial to help distinguish
users. For example, each of the following is valid person name:
Pat M.
Patty
Patricia L. Melrose
Hidden Clause
You can specify that the new person object is “hidden” so that it does not appear in the
User chooser in Matrix. Users who are aware of the hidden person’s existence can enter its
name manually where appropriate. Hidden objects are accessible through MQL. For
example:
add person patty hidden;
Icon Clause
Icons help users locate and recognize items by associating a special image with a person,
such as a picture of the individual you are defining. You can assign a special icon to the
new person or use the default icon. The default icon is used when in view-by-icon mode.
Any special icon you assign is used when in view-by-image mode. When assigning a
unique icon, you must use a GIF image file. Refer to Icon Clause in Chapter 1 for a
complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Password Options
The use of passwords is similar to the way that passwords work on most systems.
Passwords are an effective means of preventing unauthorized access to business objects.
Without passwords, any Matrix user could set their context to that of any other Matrix
user. This would essentially make policies and states meaningless since you could easily
bypass access restrictions by pretending to be someone else. Therefore, a password should
be required in order to ensure that the person who is logging in is indeed that person. In
particular you should thoroughly consider the option of passwords for Business and
Systems Administrators.
There are three clauses that use passwords to restrict access to a person’s context:
• Password clause assigns a Matrix password to the person you are defining (as
described below).
• Disable Password clause restricts access to the user whose system ID or login
matches the person ID (as described in Disable Password Clause).
• No Password clause specifies that no password is required to set context. (as
described in No Password Clause).
Only one password-related clause (Password, Disable Password, or No Password) should
be given.
add person dave
no password
access checkin, create, delete, read, modify, checkout,
connect;
Version 10 295
Each user can redefine his/her own password by using the Matrix Preferences (password)
option in Matrix Navigator.
Password Clause
The Password clause assigns a Matrix password to the person you are defining. The
password will be required whenever someone wants to access this person’s business
objects. When a password is assigned, anyone who knows the password can set their
context to this person.
For example, the following statement defines a person with a password value:
add person chris
password SaturnV;
If anyone wanted to set her/his context to Chris, s/he would need to know the password
SaturnV.
The defined password is not visible to anyone. As a Business Administrator, you can
change a password without seeing or knowing it. The password can contain up to 127
characters, including spaces.
No Password Clause
The No Password clause specifies that no password is required to access the person’s
business objects. When No Password is specified, other Matrix users can set their context
to that of the person you are defining. Once the context is set to the person, the Matrix user
can act as that person with all applicable access privileges.
The No Password clause generally is not recommended since removing the password
requirement permits other Matrix users to set context as that user. However, if a person
leaves the company, for example, or if you are setting up a guest account, you may want to
remove the password requirement.
Passwordexpired Clause
When the Passwordexpired clause is included in a person’s definition, the system requires
the person to define a new password the next time s/he attempts to log in. The system will
not allow the person to log in without entering a new password. After the user defines a
new password, the clause is removed from the person definition.
This option allows you to require users to establish a password without requiring you to
assign them one now. Having users establish their own passwords helps them remember
their password. It also prevents you from having to enter an initial password for every new
user, which you would then have to communicate to users. You can also use this clause if
you suspect that a person’s password has been compromised.
Phone Clause
The Phone clause of the Add Person statement associates a telephone number with the
person you are defining. This number could be an internal extension number, business
phone number, car phone number, or home phone number. The Phone clause is restricted
to 64 characters.
For example, you could assign a phone number as follows:
add person andrea
phone “business: x433, home: (203) 987-6543”;
Notice that you can include additional information about the number to guide those who
might reference it.
Property Clause
Integrators can assign ad hoc attributes, called Properties, to the person. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add person NAME
property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Using INI Settings as Properties
Many of the settings in the matrix.ini file are intended for use in a desktop client
environment to allow a user to set personal preferences. However, in a client-server
environment, the single ematrix.ini file read by the Collaboration Server cannot fulfill this
role for all users connected as clients. So, you can use properties on person objects to
provide values for .ini settings that are intended to express a personal preference.
Only a few .ini variables are appropriate to set as person properties for the Web version of
Matrix Navigator and MatrixOne application users. They are:
MX_DECIMAL_SYMBOL
MX_SITE_PREFERENCE
MX_ALIASNAME_PREFERENCE (see Enabling Aliases in Chapter 24)
MX_LANGUAGE_PREFERENCE (see Enabling Aliases in Chapter 24)
Version 10 297
Site Clause
A site is a set of locations. It is used in a distributed environment to indicate the file store
locations that are closest to the group. The Site clause specifies a default site for the person
you are defining. Consult your System Administrator for more information.
To write a Site clause, you will need the name of an existing site. If you are unsure of the
site name or want to see a listing of the available sites, use the MQL List Site statement.
This statement produces a list of available sites from which you can select. (Refer to
Defining Sites in Chapter 6.)
Sites may be set on persons, groups and roles, as well as on the Collaboration server (with
MX_SITE_PREFERENCE). The system looks for and uses the settings in the following
order:
• if using a Collaboration Server, the MX_SITE_PREFERENCE is used.
• if not using a Collaboration Server, or the MX_SITE_PREFERENCE is not set on the
server, if there is a site associated with the person directly, it is used.
• if no site is found on the person, it looks at all groups to which the user belongs. If any
of those groups have a site associated with it, the first one found is used.
• if no sites are found on the person or their groups, it looks at all roles the person is
assigned. If any of those roles have a site associated with it, the first one found is
used.
Type Clause
The Type clause specifies the type of Matrix user the person you are defining will be.
There are four basic types of users. Each type has a level of access to Matrix:
Application User A licensed user that can access the Matrix Database only through the Matrix
Collaboration Server or MQL. All other active users have Application User privileges
automatically.
Full User A licensed user with normal user access.
Business Administrator A licensed user with access to the Business Administrator functions.
When a person is defined as a Business Administrator, s/he may have the privilege of
being able to set context to any defined person without a password depending on the
system setting for privilegedbusinessadmin. Refer to Privileged Business Administrators
in Chapter 3 for more information.
System Administrator A licensed user with access to the System Administrator functions.
Inactive A defined user who does not currently have access to Matrix.
Trusted A licensed user for whom read access is not checked.
TYPE_ITEM assigns or denies the privileges associated with each of the five user types.
There are twelve TYPE_ITEMs. Six of the items assign the user type and six remove a
user type assignment:
When you define a person, Matrix automatically assigns the person a type of Application
User and Full User. This means that the user is defined as:
type full, application
If you want a type that is different from this, you need to write a Type clause. For
example, the following statement defines a person who is both a Full User and a Business
Administrator:
add person rodolph
type full, business;
If you want the person’s type to be something other than Full and Application, be sure to
use the ‘not’ prefix on any types defined by default. For example, to define a consultant
named Feng that is a full user but not and application user, use the following:
add person Feng
type notapplication;
Of all the person types, the Inactive type seems unnecessary. If a person is not allowed to
access Matrix, why have that person defined within the database? One answer has to do
with business object creation and ownership. Let’s assume that you have an employee
who worked for some time within the Matrix system. After that person left the company,
you still have many business objects that were created and controlled by the person.
Rather than change object ownership, you may want to maintain the old ownership so that
you have a record of the original creator. By making the person inactive, you remove that
person’s ability to access Matrix while maintaining the status of all business objects the
Version 10 299
person created. Although access for other users remains as defined, if an owner is inactive
the Business Administrator may want to reassign ownership to another person.
Vault Clause
The vault clause specifies a default vault for the person you are defining. It is similar to
setting a default directory in your operating system. When a person invokes Matrix, the
context dialog fills in this vault as the default. The vault should be the one most commonly
used by the person. Although the person may change to a different vault once Matrix is
started, it is helpful to set the vault that the person should start within.
To write a Vault clause, you will need the name of an existing vault. If you are unsure of
the vault name or want to see a listing of the available vaults, use the MQL List Vault
statement. This statement produces a list of available vaults from which you can select.
To reduce network loads, vaults are often created locally, serving selected groups of
Matrix users. When you are assigning the vault, you should determine if there is a vault
local to the person you are defining. If there is more than one local vault, determine which
is better suited for the person based on the type of work or objects used.
For example, the following person definition assigns the engineer to a vault related to the
types of projects she will work on:
add person mcgivern
fullname “Jenna C. McGivern”
assign role Engineer
assign group “Building Construction”
vault “High Rise Apartments”;
Copying (Cloning) After a person is defined, you can clone the definition with the Copy Person statement.
a Person This statement lets you duplicate person definitions with the option to change the value of
Definition clause arguments:
copy person SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Modifying a After a person is defined, you can change the definition with the Modify Person statement.
Person Definition This statement lets you add or remove defining clauses and change the value of clause
arguments:
modify person NAME [MOD_ITEM {MOD_ITEM}];
Version 10 301
Modify Person Clause Specifies that…
email VALUE A valid electronic mail address is set for the person. This address must
be in a form understood by the user’s e-mail utility.
enable email Incoming messages are sent to the e-mail address specified with the
Email clause.
enable iconmail Incoming messages are sent to IconMail.
fax VALUE The person’s fax number is changed or is set to the value entered.
fullname VALUE The full name of the person is changed or is set to the value entered.
hidden The hidden option is changed to specify that the object is hidden.
icon FILENAME The image is changed to the new image in the file specified.
name VALUE The current person name is changed to the new name
no password When setting context, there is no password required to access this
person’s context.
nothidden The hidden option is changed to specify that the object is not hidden.
password VALUE When setting context, the password is changed to the value entered.
passwordexpired When setting context, a person must define a new password.
phone VALUE The person’s phone number is changed or is set to the value entered.
property NAME [to ADMINTYPE The named property is modified.
NAME] [value STRING]
remove assign all The person is removed from all groups and roles. Any links the person
has with any groups or roles is dissolved.
remove assign [group GROUP_NAME] The person is removed from the specified group or role.
[role ROLE_NAME]
remove certificate FILENAME The named certificate file is removed from the person definition.
remove property NAME [to The named property is removed.
ADMINTYPE NAME] [value STRING]
revoke certificate FILENAME The current certificate is revoked.
type TYPE_ITEM {, TYPE_ITEM} The person is assigned or denied the privileges associated with the listed
user types. Values for TYPE_ITEM can be found in the Type Clause
section.
vault vault_NAME The current vault is changed to the new vault.
As you can see, each modification clause is related to the clauses and arguments that
define the person. For example, assume you want to alter the address and phone number of
a person who moved. You could do so by writing a Modify Person statement similar to the
following:
modify person roosevelt
address “White House, Pennsylvania Ave, Washington”
phone “Unlisted”;
This statement changes the address to that of the White House and designates the current
phone number as “Unlisted.”
When modifying a person:
• The roles or groups that you assign to the person must already be defined within the
Matrix database. If they are not, an error will display when you try to assign them.
Version 10 303
Deleting a Person
If a person leaves the company or changes jobs so that s/he no longer needs to use the
Matrix database, you can delete that person by using the Delete Person statement:
delete person NAME;
After this statement is processed, the person is deleted and you receive an MQL prompt
for another statement.
If many users need access to a type of business object, you should consider creating a
group, role, or association to represent the set of users. Creating a user category saves you
the trouble of listing every user in the policy or rule definition. Instead, you just list the
user category.
To decide which kind of user category you should create, consider what the users have in
common and why they need some of the same accesses.
• Groups—A collection of people who work on a common project, have a common
history, or share a set of functional skills.
In a group, people of many different talents and abilities may act in different jobs/
roles. For example, an engineering group might include managerial and clerical
personnel who are key to its operation. A documentation group might include a
graphic artist and printer/typesetter in addition to writers. While the groups are
centered on the functions of engineering or documentation, they include other people
who are important for group performance. They all need access to common
information.
• Roles—A collection of people who have a common job type: Engineer, Supervisor,
Purchasing Agent, Forms Adjuster, and so on.
• Association—A combination of groups and roles, or other associations. The members
an association have some of the same access requirements based on a combination of
the roles users play in the groups in which they belong. For example, perhaps a
notification that an object has reached a certain state should be sent to all Managers in
an Engineering department. Or maybe, only Technical Writers who are not in
Marketing are allowed to approve a certain signature.
Groups, roles, and associations can be used in many ways to identify a set of users.
• As recipients of IconMail sent manually or sent automatically via notification or
routing of an object as defined in its policy.
• As the designated Approver, Rejecter, or Ignorer of signatures in the lifecycle of an
object.
• In the user access definitions in the states of a policy.
• As object owners, through reassign.
There are just a few differences between the three categories:
• Users can grant their accesses to objects to persons and groups, but not to roles and
associations.
• Persons can be assigned directly to groups and roles. Groups and roles make up
associations. So a person belongs to an association by virtue of belonging to a group
or role that is assigned to the association.
• Groups and roles can be hierarchical. A group or role can have multiple parents and
multiple child groups/roles. Associations are not hierarchical.
The key to determining who should be in which group depends on:
• Whether the user requires access to the business objects.
• How much access is required for the user to do his/her job.
Version 10 305
• When access is needed.
For example, suppose a company is manufacturing a new product, called product ABC.
Depending on where the project is in its lifecycle, different people will work on the
project, require access for different tasks, or use information related to it:
Establishing Groups are frequently hierarchical. In hierarchical groups, access privileges that are
Group and Role available to a higher group (parent group) are available to all of the groups below it
Hierarchy (subgroups or child groups).
For example, in the figure below, the Field Service group is the parent of the Field
Support, Technical Documentation Services, and In-House Customer Support groups. The
Technical Documentation Services group is also a parent of the Documentation and
Training groups.
PARENT
Field Service
CHILD CHILD
Documentation Training
Roles are often similarly hierarchical. For example, in the figure below, the Assembly
Manager role is the parent of the Apprentices and Master Assembler roles. The Master
Assembler role is also a parent of the Component Assembler and Subassembly Assembler
roles.
PARENT
Assembly Manager
CHILD CHILD
Component Assembler Subassembly Assembler
Version 10 307
A child group or role can have more than one parent. Child groups/roles with more than
one parent inherit privileges from each of the parents. You can establish group and role
hierarchy using the procedures in this chapter.
Defining a Group The clauses for defining groups and roles are almost identical. While only a name is
or Role required, the other parameters can further define the relationships to existing users, as well
as provide useful information about the group or role.
Groups and Roles are created and defined with one of following MQL commands:
add group NAME [ADD_ITEM {ADD_ITEM}];
add role NAME [ADD_ITEM {ADD_ITEM}];
ADD_ITEM is a clause that provides more information about the group or Role you are
creating. While none of the clauses are required to create the group or role, they are used
to assign specific users and roles to the group or users and groups to the role. The
ADD_ITEM clauses are:
description VALUE
icon FILENAME
parent GROUP_NAME{,GROUP_NAME} (For Group)
parent ROLE_NAME{,ROLE_NAME} (For Role)
child GROUP_NAME{,GROUP_NAME} (for Group)
child ROLE_NAME{,ROLE_NAME} (for Role)
assign person PERSON_NAME [role ROLE_NAME] (for Group)
assign person PERSON_NAME [group GROUP_NAME] (for Role)
site SITE_NAME
[!|not]hidden
property NAME [to ADMINTYPE NAME] [value STRING]
Each clause and the arguments they use are discussed in the sections that follow.
If you are creating a group that will be used within a MatrixOne application you must
register the group with the AEF as described in the Application Exchange Framework
Guide.
The icon assigned to a group or role is also considered the ImageIcon of the object. When
an object is viewed as either an icon or ImageIcon, the GIF file associated with it is
displayed.
Description Clause
A description provides general information about the function of the group or role and
applicable privileges.
There is no limit to the number of characters you can include in the description field.
However, keep in mind that the description appears when the mouse pointer stops over the
group or role in the User Chooser. Although you are not required to provide a description,
this information is helpful when a choice is requested.
For example, you could have two Technical Writing groups. One group edits user manuals
and the other produces the finished book. Some people may work in both groups and there
may be similarities in their skills. However, they are unique groups. For example:
add group “Technical Writing Editors” description “Editors who mark-up user manuals.”;
add group “Desktop Publishing” description “Desktop publishing editors who implement
final edits for production.”;
Additionally, you could have two types of engineering roles: Hardware and Software.
While they are both engineers and will use some of the same business objects in their
work, there are differences in the type of work they do. Even among Hardware Engineers,
you may have levels based on experience and specific skills. What is the difference
between the Associate Engineer and the Principal Engineer? The answer should be
reflected in the role descriptions. For example:
add role “Associate Software Engineer” description “Has limited direct experience &
technical background in the dev. of software applications.”;
add role “Principal Software Engineer” description “Has direct experience & technical
background in developing software applications.”;
Version 10 309
Of course, the group or role named as the parent or child must be previously defined.
Refer to Establishing Group and Role Hierarchy for more information.
Assign clause
The Assign Person clause assigns specific users to the group or role. A group or role can
have no users, or they could have many. Groups or Roles with no users may be defined to
show a hierarchical relationship between groups or roles. In that case, the defined group or
role acts as a parent for other groups or roles.
Most groups and roles will have users assigned to them. When assigning users, the
number is limited only by the maximum number defined in the database. Use the Assign
Person clause to assign a person to a group or role:
assign person PERSON_NAME [role ROLE_NAME]
assign person PERSON_NAME [group GROUP_NAME]
When this statement is processed, the role of “Trade Show Support” is assigned to four
persons. After this statement is executed, you can examine the person definitions to see a
role assignment included in the definition.
Site Clause
A site is a set of locations. It is used in a distributed environment to indicate the file store
locations that are closest to the group. The Site clause specifies a default site for the group
or role you are defining. Consult your System Administrator for more information.
To write a Site clause, you will need the name of an existing site. If you are unsure of the
site name or want to see a listing of the available sites, use the MQL List Site statement.
This statement produces a list of available sites from which you can select. (Refer to
Defining Sites in Chapter 6.)
Sites may be set on persons, groups and roles, as well as on the Collaboration server (with
MX_SITE_PREFERENCE). The system looks for and uses the settings in the following
order:
• if using a Collaboration Server, the MX_SITE_PREFERENCE is used.
• if not using a Collaboration Server, or the MX_SITE_PREFERENCE is not set on the
server, if there is a site associated with the person directly, it is used.
• if no site is found on the person, it looks at all groups to which the user belongs. If any
of those groups have a site associated with it, the first one found is used.
• if no sites are found on the person or their groups, it looks at all roles the person is
assigned. If any of those roles have a site associated with it, the first one found is
used.
Hidden Clause
You can use the hidden clause in an add group or add role command so that it does not
appear in the User Chooser in Matrix. Users who are aware of the hidden object’s
existence can enter its name manually where appropriate. Hidden objects are listed with
the MQL list command.
Version 10 311
Property Clause
Integrators can assign ad hoc attributes, called properties, to the group or role. Properties
allow associations to exist between administrative definitions that aren’t already
associated. The property information can include a name, an arbitrary string value, and a
reference to another administration object. The property name is always required. The
value string and object reference are both optional. The property name can be reused for
different object references, that is, the name joined with the object reference must be
unique for any object that has properties.
add role NAME property NAME [to ADMINTYPE NAME] [value STRING];
For more information, refer to Working With Administration Properties in Chapter 23.
Modifying a Group After you establish a group or role definition, you can add or remove defining values.
or Role Definition Refer to the description of Modify Statement in Chapter 1.
When modifying a group or role, it is important to consider how accesses are shared
between parent and children. If you do not want a child to assume the same accesses to
business objects as the parent, you will have to modify the policy so the privileges for the
child role are specified. If a role is not specifically referenced in a policy, Matrix will look
for access hierarchically. For example, if the role has a parent and the parent is named in
the policy, the child shares the parent’s privileges.
If you remove a parent or child, you might inadvertently remove access privileges from
the children. Make sure that you consult the policies you have created when you alter the
hierarchy of defined groups and roles.
Deleting a Group If a group or role is no longer required, you can delete it. Refer to the description in Delete
or Role Definition Statement in Chapter 1.
When deleting a group or role, the elimination of linkages may affect another group’s or
role’s access to business objects. For example, suppose you have four roles: Assembly
Manager, Master Assembler, Component Assembler, and Subassembly Assembler.
Assembly Manager is the parent of Master Assembler which is the parent of both
Component Assembler and Subassembly Assembler (see the figure below).
According to the Manufacturing policy, a role of Assembly Manager has read access to all
business objects of type Assembly. Since all child roles of Assembler inherit the access
abilities of their parent (unless specified otherwise), the Master Assembler, Component
Assembler, and Subassembly Assembler roles also have read access. But what if you
delete the Master Assembler role?
Original hierarchy. The Master Assembler role is deleted. The Component Assembler and
Subassembly Assembler no longer
inherit access from the Assembly
Manager or Master Assembler.
If the Master Assembler role is deleted, the linkages disappear between Master Assembler
and the other roles. Component Assembler and Subassembly Assembler become
stand-alone roles and lose the read access they inherited from the Master Assembler role.
If this access was critical to performing their jobs, you can re-establish the linkages by
modifying the role definition for Master Assembler. Simply define Master Assembler as
having two child roles named Component Assembler and Subassembly Assembler (see
the figure below).
Before After
PARENT
Assembly
Assembly Manager
Manager
CHILD CHILD
Component Subassembly
Component Subassembly
Assembler Assembler
Assembler Assembler
Version 10 313
You could also define both Assembly Manager and Master Assembler as parents of both
Component Assembler and Subassembly Manager. Then if either of the roles is
eliminated, the children still retain privileges inherited from the other.
PARENT
Assembly Manager
If users from a combination of different groups and roles will need access to a business
object or set of objects, you should create an association.
Associations allow defining signature definitions such as “a Manager in the Products
group AND a member of the Engineering group OR a member of the Design group OR a
Vice-President.”
Notify
The Notification facility sends messages to a group of people when a business object
enters a new state.
Suppose you want to remind all Quality Assurance people associated with the testing of
Assembly 101 that the customer requested an extra test.
You could accomplish this by notifying the entire Quality Assurance Group, but the
message would unnecessarily go out to people who did not work on Assembly 101.
Version 10 315
You could also accomplish this by notifying the entire Assembly 101 Group, but the
message would unnecessarily go out to people who do marketing, documentation, etc. for
Assembly 101.
The association feature allows you to more effectively control the recipients of the
notification message. You can send the message to only the desired set of people by using
the following association definition: Quality Assurance and Assembly 101.
The only people who receive the message are those in both the Quality Assurance and
Assembly 101 Groups.
Defining an Associations are created and defined with the MQL Add Association statement:
Association add association NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the association you are creating. All associations must have a named
assigned. When you create an association, you should assign a name that has meaning to
both you and the user. This name cannot be shared with any other user types (groups,
roles, persons, associations). The association name is limited to 127 characters. For
additional information, refer to Business Object Name in Chapter 35.
After the name is defined, it will appear whenever association names are listed. For
example, each of the following is a valid association name:
Managers and Administrators for Project A
ADD_ITEM is an Add Association clause that provides more information about the
association you are creating. While none of the clauses are required to make the
association usable, they are used to define the association’s relationship to existing
groups, roles, and associations, as well as provide useful information about the
association. The Add Association clauses are:
description VALUE
icon FILENAME
definition DEF_ITEM
[!|not]hidden
property NAME [to ADMINTYPE NAME] [value STRING]
Each clause and the arguments they use are discussed in the sections that follow.
Description Clause
The Description clause of the Add Association statement provides general information for
you and the user about the function of this association. There may be subtle differences
between some associations. The Description clause enables you to point out the
differences to the user.
There is no limit to the number of characters you can include in the description. However,
keep in mind that the description is displayed when the mouse pointer stops over the
Icon Clause
Icons help users locate and recognize items by associating a special image with an
association, such as simplified pictures of the associations you are defining. You can
assign a special icon to the new association or use the default icon. The default icon is
used when in view-by-icon mode. Any special icon you assign is used when in
view-by-image mode. When assigning a unique icon, you must use a GIF image file.
Refer to Icon Clause in Chapter 1 for a complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Definition Clause
The definition clause of the Add Association statement defines which groups(s), role(s),
and association(s) are included in the new association. The definition must be enclosed in
quotes.
definition “USER_ITEM [{OPERATOR_ITEM USER_ITEM}]”
Version 10 317
To create a definition using the AND operator
The AND operator requires that the person be defined in each group, role, or association
that you include in the AND definition. For example:
definition “Engineering && Management”
In order for a person to satisfy this definition, the person must be defined in both the
Engineering Group and in the Management Role.
In order for a person to satisfy this definition, the person must be defined in either the
Engineering Group or in the Senior Management Role.
Notice that single quotes are used for the two word name “Senior Management,” and that
there is no space between the name and either single quote. A space between the second
single quote and the double quote is optional.
In order for a person to satisfy this definition, the person must be defined in the
Management role, but not in the Engineering Group.
Hidden Clause
You can specify that the new association is “hidden” so that it does not appear in the User
chooser in Matrix. Users who are aware of the hidden association’s existence can enter its
name manually where appropriate. Hidden objects are accessible through MQL.
Property Clause
Integrators can assign ad hoc attributes, called Properties, to the association. Properties
allow associations to exist between administrative definitions that aren’t already
associated. The property information can include a name, an arbitrary string value, and a
For more information, refer to Working With Administration Properties in Chapter 23.
Copying (Cloning) After an association is defined, you can clone the definition with the Copy Association
an Association statement. This statement lets you duplicate defining clauses with the option to change the
Definition value of clause arguments:
copy association SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Modifying an After an association is defined, you can change the definition with the Modify Association
Association statement. This statement lets you add or remove defining clauses and change the value of
Definition clause arguments:
modify association NAME [MOD_ITEM {MOD_ITEM}];
As you can see, each modification clause is related to the clauses and arguments that
define the association.
Version 10 319
For example, assume you want to alter the definition for the Drivers First Shift association
to reflect the addition of a new group. You might write this statement:
modify association “Drivers First Shift“
definition “RR#6 && ‘West Side’ && RR#15”;
This statement redefines the groups that are included in the association.
When modifying an association:
• The roles, groups, or associations that you assign to the association must already be
defined within the Matrix database. If they are not, an error will display when you try
to assign them.
• Remember that altering the group or role access affects all persons included in the
association that contains those groups or roles. If it is a singular case of special access,
you may want to assign that person to the policy directly or define a role that is
exclusively used by the person in question.
Deleting an If an association definition is no longer required, you can delete it with the Delete
Association Association statement:
delete association NAME;
After this statement is processed, the association is deleted and you receive an MQL
prompt for another statement.
Visuals (Filters, Tips, Cues, Toolsets, Tables, Views) are generally defined by users for
their own personal use. They serve to set up a user’s workspace in a way that is
comfortable and convenient. Visuals can be used for many purposes, including
organizing, prioritizing tasks, providing reminders, or streamlining access to information.
Each user can define Visuals in a way that is most helpful to that person.
Visuals can also be defined and shared among users who are assigned to a role. For
example, every person belonging to the role Accountant can have access to the same
Visuals. This not only makes the work environment easier for a person just joining the
department, but also facilitates communication among persons within a group.
For example, suppose there is a role called Manager. At a weekly manager’s phone
conference, each person sitting in front of a computer can, with the click of a mouse,
switch Visuals so that the whole group is looking at the same thing. One could then
suggest a filter to view a particular subset of objects, or look at a table, or refer to “all
objects highlighted in red....”
The person setting up Visuals to be shared must have Business Administrator privileges.
Sharing Visuals There are two methods to share visuals so that members of a group, role or association can
use the visuals:
• A Business Administrator can copy the visuals from one user (person, group, role or
association) to another using MQL commands.
• A Business Administrator can use the set workspace statement to to change the
Workspace currently active so that the Workspace of some other User (person, group,
role or association) is active, and then create visuals within that new context. See
Setting the Workspace for details.
Copying Visuals
After Visuals are defined within a session context, users with Business Administrator
privileges can copy the definition. If you don’t have Business Administrator privileges,
then you need to be defined in the group, role, or association in order to copy from it to
yourself.
The Copy statement lets you duplicate defining clauses with the option to change the
value of clause arguments:
copy VISUAL SRC_NAME DST_NAME [fromuser USER] [touser USER] [overwrite] [MOD_ITEM
{MOD_ITEM}];
VISUAL can be any one of the following: filter, tip, cue, toolset, table,
view.
SRC_NAME is the name of the visual definition (source) to copied.
DST_NAME is the name of the new definition (destination).
USER can be the name of a person, group, role, or association.
Version 10 321
Overwrite replaces an existing visual (or member, in the case of views) in the
destination user.
The order of the fromuser, touser and overwrite clauses is irrelevant, but
MOD_ITEMS, if included, must come last.
MOD_ITEMs are modifications that you can make to the new definition. MOD_ITEMs vary
depending on which visual you are copying. A complete list can be found in the sections
that follow.
For example, you can copy a cue definition using the following statement:
copy cue RedHiLite RedHiLite fromuser purcell touser Engineer
This statement copies a Cue named RedHiLite from the person purcell to the role
Engineer.
If an error occurs during the copying of a Visual, the database will be left intact.
This command affects the behavior of all commands to which Workspace objects are
applicable, including:
• all commands specific to Workspace objects (for example, add/modify/delete filter)
• expand bus (affects what filters are used to control output)
USERNAME is the name of a person, group, role or association.
When users (other than Business Administrators) set their Workspace to that of a group,
role, or association, they cannot use commands that modify the Workspace, that is, the
add, modify, and delete commands for Workspace objects. This restriction enforces
the rule that only Business Administrators are permitted to change the Workspace of a
group, role or association.
Note that set context user USERNAME will change the context to that of
USERNAME regardless of an earlier invocation of set workspace.
Version 10 323
Assigning Attributes to Objects and
Relationships
You must be a Business Administrator to add or modify attributes. (Refer also to your
Business Modeler Guide.)
Assigning In Matrix, objects are referred to by type, name, and revision. Object types are defined by
Attributes to the attributes they contain. When an object is created, the user specifies the object type
Objects and then Matrix prompts for values for that object instance.
In Matrix, you assign an attribute as a characteristic of a type of object. For example,
assume the object is clothing. It might have attributes such as article type (for example,
pants, coat, dress, shirt, and so on), size, cost, color, fabric type, and washing instructions.
Now assume you are creating a new article of clothing. When you create this object,
Matrix prompts you to provide values for each of the assigned attributes. You might
assign values such as jacket, size 10, $50, blue, wool, and dry clean.
The specific value for each attribute can be different for each object instance. However, all
objects of the same type have the same attributes.
Assigning Like business objects, a relationship may or may not have attributes. Since a relationship
Attributes to defines a connection between two objects, it has attributes when there are characteristics
Relationships that describe that connection.
For example, an assembly could be connected to its components with a relationship called,
“component of,” which could have an attribute called, “quantity.” When the component
and the assembly are connected, the user would be prompted for the quantity or number of
times the component is used in the assembly.
The same attributes could apply to either the objects or the relationship. When an object
requires additional values for the same attribute in different circumstances, it is easier to
assign the attributes to the relationship. Also, determine whether the information has more
meaning to users when it is associated with the objects or the relationship.
Before types and relationships can be created, the attributes they contain must be defined
as follows:
add attribute NAME [ADD_ITEM {ADD_ITEM} ];
NAME is the name you assign to the attribute. Attribute names must be unique. The
attribute name is limited to 127 characters. For additional information, refer to Business
Object Name in Chapter 35.
ADD_ITEM is an Add Attribute clause that provides additional information about the
attribute you are defining. The Add Attribute clauses are:
type {date|integer|string|real|boolean}
default VALUE
description VALUE
icon FILENAME
rule NAME
range RANGE_ITEM
[!|not]multiline
[!|not]hidden
Type Clause The Type clause of the Add Attribute statement is always required. It identifies the type of
values the attribute will have. An attribute can assume five different types of values. When
determining the attribute type, you can narrow the choices by deciding if the value is a
number or a character string.
Type Description
String One or more characters. These characters may be numbers, letters, or any special symbols (such as $ % ^
* &). Although numbers can be part of a character string, you cannot perform arithmetic operations on
them. To perform arithmetic operations, you need a numeric type (Integer or Real).
String attributes (as well as description fields) have a limit of 2,048 KB. If you expect to handle more
data in an attribute, consider re-designing the schema to store the data in a checked-in file instead.
Version 10 325
Type Description
Real A number expressed with a decimal point (for example, 5.4321). The range of values it can assume
depends on the local system architecture. Matrix supports both 32-bit or 64-bit floating point numbers.
Since real values are stored in the name format of the local system architecture, the precision and range of
values varies from architecture to architecture. To obtain the exact range for your system, see your system
manual.
Integer A whole number whose range is defined by the local architecture. Matrix supports all CPU architectures
with the exception of signed 8-bit integers. Depending on the system architecture, an attribute with the
integer type may assume a value within the following ranges:
Date and Any collection of numbers or reserved words that can be translated into an expression of time. Times and
Time dates can be expressed using the formats listed below. This includes the year, month, day, hour, minute,
and/or second. Abbreviations or full-words are acceptable for the day of the week and month.
In the following example, the day of the week is optional.
Wed Feb 15, 1999
Another way to enter this date is:
2/15/99
The time of day. In the following example, the meridian and time zone information are optional:
01:30:00 PM EST
Another example is:
13:30:00
When you enter both the date and time, the time should follow the date. For example:
February 1, 1999 12:52:30 GMT
The actual date/time is calculated based on the current time and date obtained from your system clock.
The date range is January 1, 1902 to December 31, 2037.
Consult the Matrix Installation Guide “Configuring Date and Time Formats” section for details.
Once a type is assigned to an attribute, it cannot be changed. The user can associate only
values of that type with the attribute.
For any field with a date format, even if you have a date setting in your initialization file
(matrix.ini or ematrix.ini) and you input any date without a year, the date is accepted and
converted to Sat Jan 01, 0000, 12:00:00 AM. Dates should be input as the full date,
including the year.
Default Clause The Default clause of the Add Attribute statement defines a default value for the attribute.
When a business object is created and the user does not fill in the attribute field, the
default value is assigned. When assigning a default value, the value you give must agree
with the attribute type. If the attribute should contain an integer value, you should not
assign a string value as the default.
If the user does not assign a value for the Label Color, “yellow” is assigned by default.
Description The Description clause of the Add Attribute statement provides general information for
Clause you and the user about the function of the attribute. There may be subtle differences
between attributes; the Description clause points out the differences to the user.
The description can consist of a prompt, comment, or qualifying phrase. There is no limit
to the number of characters you can include in the description. However, keep in mind that
the description is displayed when the mouse pointer stops over the attribute in the
Attribute chooser. Although you are not required to provide a description, this information
is helpful when a choice is requested.
Although a Description clause is not required, it can clarify an expected value or the
information presented when editing or viewing the attribute. For example, when defining
an attribute named Label, you might use one of these Description clauses:
add attribute Label
description “Shipping Destination Label”
type string;
add attribute Label
description “Is ship-to label required?”
type string;
add attribute Label
description “Enter the shipping label number”
type integer;
The information assigned to the Label attribute differs significantly in these statements. In
the first statement, the attribute might be a shipping address. In the second statement, it
might have a value of yes, no, or unknown. In the third statement, a number is required.
Icon Clause Icons help users locate and recognize items by associating a special image with the
attribute. You can assign a special icon to the new attribute or use the default icon. The
default icon is used when in view-by-icon mode. Any special icon you assign is used when
in view-by-image mode. When assigning a unique icon, you must use a GIF image file.
Refer to Icon Clause in Chapter 1 for a complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Version 10 327
Rule Clause Rules are administrative objects that define specific privileges for various Matrix users.
The Rule clause of the Add Attribute statement enables you to specify an access rule to be
used for the attribute.
add attribute NAME rule RULENAME;
Range Clause The Range clause of the Add Attribute statement defines the range of values the attribute
can assume. This range provides a level of error detection and gives the user a way of
searching a list of attribute values. If you define an attribute as having a specific range,
any value the user tries to assign to that attribute is checked to determine if it is within that
range. Only values within the defined range are allowed.
When writing a Range clause, use one of the following forms depending on the types and
amount of range values:
range RELATONAL_OPERATOR VALUE
range PATTERN_OPERATOR PATTERN
range between VALUE {inclusive|exclusive} VALUE {inclusive|exclusive}
range program PROG_NAME [input ARG_STRING]
If you have an attribute with a default value that is outside the ranges defined and you try
to create a business object without changing the attribute value, Matrix does not check the
default value against the ranges. A trigger check could be written on the attribute to force
a user to enter a value.
Each form is described below. The method and clauses you use to define a range are a
matter of preference. Select the clauses that make the most sense to you and then test the
range to be sure it includes only valid values.
A relational operator compares the user’s value to a set of possible values. Choose from
these relational operators:
Depending on the relational operator you use, you can define a range set that is very large,
or a set that contains a single value. When you use a relational operator, the value
provided by the user is compared with the range defining value. If the comparison is true,
the value is allowed and is assigned to the attribute. If the comparison is not true, the value
is considered invalid and is not allowed.
For example, assume you want to restrict the user to entering only positive numbers. In
this case, you could define the range using either of the following clauses:
range > -1
Or:
range >= 0
If the user enters a negative number (such as -1), these statements are false (-1 is not
greater than -1 and is not greater than or equal to zero). Therefore the value is invalid.
You may have an attribute with a few commonly entered values but that can actually be
any value. To provide the user with the ability to select the commonly entered values from
a menu, but also allow entry of any value, you would:
• Add the ranges of Equal values for the common values.
• Add a range of Not Equal to xxxxx.
This will allow any value (except xxxxx) and also provide a list from which to choose the
common values.
When defining ranges for character strings, remember that you can also perform
comparisons on them. By using the ASCII values for the characters, you can determine
whether a character string has a higher or lower value than another character string. For
example “Boy” is less than “boy” because uppercase letters are less than lowercase letters
and “5boys” is less than “Boy” because numbers are less than uppercase letters. For more
information on the ASCII values, refer to an ASCII table.
But what would you do if the attribute value had a second part that was to start with the
letters REV? The next form of the Range clause is available for this reason.
Patterns are powerful tools for defining ranges because they can include wildcard
characters. Wildcard characters can be used to represent a single digit or a group of
characters. This allows you to define large ranges of valid values.
Version 10 329
For example, you can define an attribute’s range as “DR* REV*” where the asterisk (*) is
a wildcard representing any character(s). This range allows the user to enter any value, as
long as the first half begins with the letters “DR” and the second half begins with the
letters “REV”.
When using a pattern to define a range, you must use a pattern operator. These operators
compare the user’s value with the pattern range. All the pattern operators allow for
wildcard comparisons. Two of them check the user’s entry for an exact match (including
checks for uppercase and lowercase).
When the user enters a character string value, Matrix uses these operators to compare that
value to the defined range pattern. If the comparison results in a true value, the user value
is considered valid and is assigned to the attribute. If the comparison is false, the user
value is considered out of range and is not valid.
Multiple Ranges
When defining the range, remember that you can use more than one Range clause. More
than one clause may be required.
range between VALUE {inclusive|exclusive} VALUE {inclusive|exclusive}
For example, if you have a situation where the attribute value can be any uppercase letter
except for I or O (since they can be confused with numbers), you could define the range
as:
range >= A range <= Z range != I range != 0
When you pass arguments into the program they are referenced by variables within the
program. Variables 0, 1, 2. . . etc. are reserved by the system for passing in arguments.
Environment variable “0” always holds the program name and is set automatically by the
system.
Arguments following the program name are set in environment variables “1”, “2”, . . . etc.
Programs should return the list of choices in the variable that has the same name as the
program name, which can be obtained through argument “0.” Be sure to use the global
keyword on your set env command when passing the list back.
See Runtime Program Environment in Chapter 18 for additional information on program
environment variables.
The following is output from a MQL session. The attribute type ‘designerName’ produces
the choices ‘Tom,’ ‘Dick,’ ‘Harry,’ ‘Larry,’ ‘Curly,’ and ‘Moe.’ Note that an attribute
type can have any number of ranges, but only one range can be of type program.
Version 10 331
} else {
# assume that it is safe to unset global RPE variable during value test
mql unset env global $output
# set the value
set value [mql get env ATTRVALUE]
# test the value
if {[lsearch -exact $names $value] == -1} {
# value not in list, return non-zero
exit 1
} else {
# value in list, return zero
exit 0
}
}
}
The following macros are available to Range Programs:
• Owning Item information macros. There are 3 scenarios:
a ) If the attribute is “owned” by a business object, the macros available are
OBJECT, TYPE, NAME, and REVISION.
b ) If a relationship instance “owns” the attribute, the RELID macro is provided.
c ) During query formulation the owner is unknown so no owner macros are
available.
• Invocation Information. INVOCATION will always equal “range”.
• Event information. EVENT and possibly ATTRVALUE. For example:
a ) When the range program is being asked to produce all legal values, EVENT will
equal “attribute choices”.
b ) When the range program is being asked to check the legality of a given value,
EVENT will equal “attribute check” and the ATTRVALUE macro will also be
provided.
• Attribute information. ATTRNAME and ATTRTYPE. For example:
ATTRNAME=designerName
ATTRTYPE=String
• Basic information. VAULT, USER, TRANSACTION, HOST, APPLICATION, and
LANGUAGE.
For additional information on macros, see the Macros Appendix in the Matrix PLM
Platform Programming Guide.
Trigger Clause Event Triggers provide a way to customize Matrix behavior through Program Objects.
Triggers can contain up to three Programs, (a check, an override, and an action program)
which can all work together, or each work alone. Attributes support the use of triggers on
the modify event. For more information on Event Triggers, refer to Overview of Event
Triggers in the Matrix PLM Platform Programming Guide. The syntax for the trigger
clause is:.
trigger modify {action|check|override} PROG_NAME [input ARG_STRING];
In this example, the argument passed into the OnApprove program is ChngChk.
When you pass arguments into the program they are referenced by variables within the
program. Variables 0, 1, 2… etc. are reserved by the system for passing in arguments.
Environment variable “0” always holds the program name and is set automatically by the
system.
Arguments following the program name are set in environment variables “1”, “2”,… etc.
See Using the Runtime Program Environment in the Matrix PLM Platform Programming
Guide for additional information on program environment variables.
Multiline Clause If you define the attribute type value as “string,” you can specify the format of the data
entry field. Use the multiline clause if you want the data entry field to consist of
multiple lines. If this clause is specified, the text wraps to the next line as the user types.
The text box is scrollable.
If multiline is not specified or if !multiline (notmultiline) is specified, then the
data entry field consists of a single line. If the amount of text exceeds the size of the field
shown, the line of text scrolls to the left as the user is typing.
Hidden Clause You can specify that the new attribute is “hidden” so that it does not appear in the
Attribute chooser or in the list of attributes for an object in Matrix. You may want to use
the hidden option if, for example, an object is under development or if it is intended only
for your personal use. Hidden objects are accessible through MQL.
In desktop Matrix Navigator, hidden attributes are displayed only in the Object Inspector.
In the Web version, hidden attributes do not appear at all.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the attribute. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add attr NAME
property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 333
Checking an Attribute
Any attribute can be checked to find out whether a specified value is within the given
range for that attribute:
check attribute NAME VALUE [businessobject TYPE NAME REV] [connection RELID];
Copying (Cloning) After an attribute is defined, you can clone the definition with the Copy Attribute
an Attribute statement. This statement lets you duplicate defining clauses with the option to change the
Definition value of clause arguments:
copy attribute SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Modifying an After an attribute is defined, you can change the definition with the Modify Attribute
Attribute statement. This statement lets you add or remove defining clauses and change the value of
Definition clause arguments:
modify attribute NAME [MOD_ITEM {MOD_ITEM}];
Version 10 335
Modify Attribute Clause Specifies that…
remove trigger modify PROG_TYPE The specified trigger program is removed. PROG_TYPE is the type of
trigger program (check, override, or action).
add rule NAME The named access rule is added.
remove rule NAME The named access rule is removed
hidden The hidden option is changed to specify that the object is hidden.
nothidden The hidden option is changed to specify that the object is not hidden.
property NAME [to ADMINTYPE The named property is modified.
NAME] [value STRING]
add property NAME [to ADMINTYPE The named property is added.
NAME] [value STRING]
remove property NAME [to The named property is removed.
ADMINTYPE NAME] [value STRING]
As you can see, each modification clause is related to the clauses and arguments that
define the attribute. For example, you would use the Default clause of the Modify
Attribute statement to modify the Default clause that you used in the Add Attribute
statement.
Assume you have the following attribute definition:
attribute Units
description "Measuring units"
type string
default "Linear Feet"
range = Quarts
range = "Linear Feet";
Now you have decided to use the attribute for measuring distances only. While it might be
faster to define a new attribute, you could modify this attribute with the following
statement:
modify attribute Units
description "Units for Measuring Distances"
remove range = Quarts
add range = "Linear Yards";
After this statement is processed, the attribute definition for the Units attribute is:
attribute Units
description "Units for Measuring Distances"
type string
default "Linear Feet"
range = "Linear Feet"
range = "Linear Yards";
If an attribute is no longer required, you can delete it by using the Delete Attribute
statement:
delete attribute NAME;
After these statements are processed, the attributes are deleted and you receive an MQL
prompt for another statement.
Version 10 337
338 MQL Guide
13
Working With Types
Type Defined ................................................................................................. 340
Type Characteristics .................................................................................... 341
Implicit and Explicit ......................................................................................... 341
Inherited Properties ........................................................................................ 341
Defining a Type ............................................................................................. 342
Description Clause.......................................................................................... 342
Icon Clause..................................................................................................... 343
Attribute Clause .............................................................................................. 343
Derived Clause ............................................................................................... 344
Abstract Clause .............................................................................................. 345
Method Clause................................................................................................ 345
Form Clause ................................................................................................... 345
Trigger Clause ................................................................................................ 346
Hidden Clause ................................................................................................ 346
Property Clause .............................................................................................. 347
Copying and/or Modifying a Type Definition ............................................. 348
Copying (Cloning) a Type Definition ............................................................... 348
Modifying a Type Definition ............................................................................ 348
Three Base Types ......................................................................................... 350
Localizing Base Types.................................................................................... 350
Deleting a Type ............................................................................................. 351
Version 10 339
Type Defined
A type identifies a kind of business object and the collection of attributes that characterize
it. When a type is created, it is linked to the (previously- defined) attributes that
characterize it. It may also have methods and/or triggers associated (refer to Working With
Programs and Working With Event Triggers in the Matrix PLM Platform Programming
Guide for more information). Types are defined by the Business Administrator and are
used by Matrix users to create business object instances.
A type can be derived from another type. This signifies that the derived type is of the same
kind as its parent. For example, a Book is a kind of Publication which in turn is a kind of
Document. In this case, there may be several other types of Publications such as
Newspaper, Periodical, and Magazine.
This arrangement of derived types is called a type hierarchy. Derived types share
characteristics with their parent and siblings. This is called attribute inheritance. When
creating a derived type, other attributes, methods, and triggers can be associated with it, in
addition to the inherited ones. For example, all Periodicals may have the attribute of Page
Count. This attribute is shared by all Publications and perhaps by all Documents. In
addition, Periodicals, Newspapers, and Magazines might have the attribute Publication
Frequency.
You must be a Business Administrators to add or modify types. (Refer also to your
Business Modeler Guide.)
Version 10 341
Defining a Type
NAME is the name you assign to the type. The type name is limited to 127 characters. For
additional information, refer to Business Object Name in Chapter 35.
ADD_ITEM is an Add Type clause which provides additional information about the type:
description VALUE
icon FILENAME
derived TYPE_NAME
abstract [true|false]
[!|not]hidden
All these clauses are optional. You can define a type by simply assigning a name to it. If
you do, Matrix assumes that the type is non-abstract, uses the default type icon, does not
contain any explicit attributes, and does not inherit from any other types. If you do not
want these default values, add clauses as necessary. You will learn more about each Add
Type clause in the sections that follow.
Performance problems may be noticed when adding a Type to a very large type hierarchy.
If you experience this, from Oracle, turn off “cost-based optimization” and the situation
should improve. Refer to Oracle documentation for more information.
Description The Description clause of the Add Type statement provides general information for you
Clause and the user about the function of the type you are defining. There may be subtle
differences between types; the Description clause enables you to point out the differences
to the user.
There is no limit to the number of characters you can include in the description. However,
keep in mind that the description is displayed when the mouse pointer stops over the type
in the Type chooser. Although you are not required to provide a description, this
information is helpful when a choice is requested.
If an object is assigned the wrong type, it may be inaccessible to the users or restricted
from desired connections.
This Description clause provides information to you and the user about the kinds of files
and information associated with this type. As another example, you might define a type
named “Federal Income Tax Form” with the following Description clause. It provides
qualifying information about which forms should use this type.
add type “Federal Income Tax Form”
description “Use for individual income tax forms 401 and
401A, only”;
Icon Clause Icons help users locate and recognize items by associating a special image with the type.
You can assign a special icon to the new type or use the default icon. The default icon is
used when in view-by-icon mode. Any special icon you assign is used when in
view-by-image mode. When assigning a unique icon, you must use a GIF image file.
Refer to Icon Clause in Chapter 1 for a complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Attribute Clause The Attribute clause of the Add Type statement assigns explicit attributes to the type.
These attributes must be previously defined with the Add Attribute statement. (See
Defining an Attribute in Chapter 12.) If they are not defined, an error message is
displayed.
Adding an attribute to a business type should not be included in a transaction with other
extensive operations, especially against a distributed database. This is a “special”
administrative edit, in that it needs to update all business objects of that type with a
default attribute.
For the Matrix Navigator user, the display of attributes (when creating objects or viewing
attributes) will appear in the reverse order of the programmed order. Therefore, you
should put the attribute you want first last in the MQL script.
A type can have any combination of attributes associated with it. For example, the
following Add Type statement assigns three attributes to the Shipping Form type:
add type “Shipping Form”
description “Use for shipping materials to external locations”
attribute “Label Type”
attribute “Date Shipped”
attribute “Destination Type”;
Three explicit attributes are associated with this type definition: Label Type, Date
Shipped, and Destination Type. When the user creates a business object of a Shipping
Version 10 343
Form type, s/he will be required to provide values for these attributes. For example, the
user might enter the following values at the attribute prompts:
These values are then associated with that instance along with any files the user may want
to check in.
Derived Clause Use the Derived clause to identify an existing type as the parent of the type you are
creating. The parent type can be abstract or non-abstract. A child type inherits the
following items from the parent:
• all attributes
• all methods
• all triggers
• governing policies
For example, if two policies list the parent type as a governed type, then those two
policies can also govern the child type. Note that in such a case, the child type is not
listed as a governed type in the policy definitions.
• allowed relationships
For example, if a relationship allows the parent type to be on the from end, then the
child type can also be on the from end of the relationship. The child type is not listed
in the relationship definition.
Assigning a parent type is an efficient way to define several object types that are similar
because you only have to define the common items for one type, the parent, instead of
defining them for each type. The child type inherits all the items listed above from the
parent but you can also add attributes, programs, and methods directly to the child type.
Similarly, you can (and probably will) assign the child type to a policy or relationship that
the parent is not assigned to. Any changes you make for the parent are also applied to the
child type.
For example, suppose you have a type named “Person Record”, which includes four
attributes: a person’s name, telephone number, home address, and social security number.
Now, you create two new types named “Health Record” and “Employee Record:”
add type “Health Record”
derived “Person Record”;
add type “Employee Record”
derived “Person Record”;
Both new types require the attributes in the Person Record type. Rather than adding each
of the four Person Record attributes to the new types, you can make Person Record the
parent of the new types. The new types then inherit the four attributes, along with any
methods, programs, policies, and relationships for parent.
If the user can create an object of the defined type, set the abstract argument to false. If
the user cannot, set the abstract argument to true. If you do not use the Abstract clause,
false is assumed, allowing users to create instances of the type.
For example, in the following definition of Federal Individual Income Tax Form, the user
can create an object instance because an Abstract clause was not included in the
definition:
add type “Federal Individual Income Tax Form”
derived “Federal Tax Form”;
Method Clause The Method clause of the Add Type statement assigns a method to the type. A method is a
program that can be executed from Matrix when it is associated with the selected object.
Programs selected as methods require a business object as a starting point for executing.
For example, the following adds the existing program named “calculate tax” to the Federal
Individual Income Tax Form.
add type “Federal Individual Income Tax Form”
derived “Federal Tax Form”
method “calculate tax”;
A user in Matrix could then select any Federal Individual Income Tax Form object and
execute the program “calculate tax.”
Form Clause The Form clause of the Add Type statement assigns a form design to the type. This form
must be previously defined with the Add Form statement. (See Defining a Form in
Chapter 22.) If it is not defined, an error message is displayed.
Version 10 345
A type can have any number of forms associated with it. For example, the following Add
Type statement assigns three forms to the Employee types:
add type “Employee Record”
description “employees of Acme, Inc.”
form “insurance information”
form "work history"
form “pension and savings plans;
Trigger Clause Event Triggers provide a way to customize Matrix behavior through Program objects.
Triggers can contain up to three Programs, (a check, an override, and an action program)
which can all work together, or each work alone. The Trigger clause specifies the program
name, which event causes the trigger to execute, and which type of trigger program it is.
Types support triggers for many events. For more information on Event Triggers, refer to
Overview of Event Triggers in the Matrix PLM Platform Programming Guide.
The format of the trigger clause is:
trigger EVENT_TYPE {action|check|override} PROG_NAME [input ARG_STRING{
EVENT_TYPE specifies the type of event that causes the trigger program to execute. It
can be any of the following:
PROG_NAME is the name of the program to execute when the event occurs.
ARG_STRING is a string of arguments to be passed into the program. When you pass
arguments into the program they are referenced by variables within the program.
Variables 0, 1, 2… etc. are reserved by the system for passing in arguments.
Environment variable “0” always holds the program name and is set automatically by the
system.
Arguments following the program name are set in environment variables “1”, “2”,… etc.
See Using the Runtime Program Environment in the Matrix PLM Platform Programming
Guide for additional information on program environment variables.
Hidden Clause You can specify that the new type is “hidden” so that it does not appear in the Type
chooser or in any dialogs that list types in Matrix. You may want to use the hidden option
if, for example, an object is under development or if it is intended only for your personal
use. Users who are aware of the hidden type’s existence can enter its name manually
where appropriate. Hidden objects are also accessible through MQL.
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 347
Copying and/or Modifying a Type Definition
Copying (Cloning) After a type is defined, you can clone the definition with the Copy Type statement. This
a Type Definition statement lets you duplicate defining clauses with the option to change the value of clause
arguments:
copy type SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Modifying a Type After a type is defined, you can change the definition with the Modify Type statement.
Definition This statement lets you add or remove defining clauses and change the value of clause
arguments:
modify type NAME [MOD_ITEM {MOD_ITEM}];
As you can see, each modification clause is related to the arguments that define the type.
For example, the following statement changes the name and attribute list of the Shipping
Form type:
modify type “Shipping Form” name “Shipping Label”
add attribute “Label Color”;
Version 10 349
Three Base Types
There are three base types that must be defined in order to use some basic Matrix
functions. These types are:
• Annotation
• Attachment
• Report
By creating types of these names and deriving new types from them, the number of types
available under Annotation, Attachment, and Report can be kept to a manageable number.
For example, when a new report is created in Matrix, (by selecting New> Report from the
object menu) a Report object type must be selected from the Type Chooser. Only the types
derived from Report will be displayed, eliminating types that are not appropriate for a
Report. The Attachment and Annotation types work the same way.
Note that applicable relationships and policies for these types must be defined as well, as
described in Chapter 14, Working With Relationships, and Chapter 17, Working With
Policies.
Localizing Base As stated above, the Annotation, Attachment and Report types must exist in order to use
Types these functions. However, when Matrix is in use in a non-English language, the
non-English word for these types may be used if the following variables are set in the
initialization file:
MX_ANNOTATION_TYPE sets the non-English word used for Annotations. A
Business Object Type of the name specified here must be defined in order for the
Annotation function to operate properly when used in a non-English setting. The
default is Annotation.
MX_ATTACHMENT_TYPE sets the non-English word used for Attachments. A
Business Object Type of the name specified here must be defined in order for the
Attachment function to operate properly when used in a non-English setting. The
default is Attachment.
MX_REPORT_TYPE sets the non-English word used for Reports. A Business
Object Type of the name specified here must be defined in order for the Report
function to operate properly when used in a non-English setting. The default is
Report.
In order to change the menu options for report, annotation and attachment to the
non-English words, the matrix.txt file must be translated and imported. Refer to the
System Manager Guide for more information.
Changes to matrix.txt are for desktop only and do not affect PowerWeb.
If a type is no longer required, you can delete it with the Delete Type statement:
delete type NAME:
Version 10 351
352 MQL Guide
14
Working With Relationships
Overview of Relationships........................................................................... 354
Collecting Data for Defining Relationships................................................ 355
Defining a Relationship................................................................................ 357
Attribute Clause .............................................................................................. 357
Trigger Clause ................................................................................................ 358
Description Clause.......................................................................................... 359
Icon Clause..................................................................................................... 360
To and From Clauses ..................................................................................... 360
Preventduplicates Clause ............................................................................... 368
Hidden Clause ................................................................................................ 369
Property Clause .............................................................................................. 369
Copying and/or Modifying a Relationship Definition ................................ 370
Copying (Cloning) a Relationship Definition ................................................... 370
Modifying a Relationship Definition................................................................. 370
Connection End Modifications ........................................................................ 371
Deleting a Relationship ................................................................................ 374
Working with Relationship Instances ......................................................... 375
Modifying Relationships.................................................................................. 375
Connection IDs ............................................................................................... 375
Modifying Attributes of a Connection .............................................................. 376
Freezing Connections..................................................................................... 376
Thawing Connections ..................................................................................... 376
Deleting Connections...................................................................................... 376
Printing Connections....................................................................................... 376
Version 10 353
Overview of Relationships
A relationship definition is used along with the policy to implement business practices.
Therefore, they are relatively complex definitions, usually requiring planning.
For example, in manufacturing, a component may be contained in several different
assemblies or subassemblies in varying quantities. If the component is later redesigned,
the older design may then become obsolete. In Matrix, the component objects could be
connected to the various assembly and subassembly objects that contain it. Each time
objects are connected with this relationship, the user could be prompted for the quantity
value for the relationship instance. If the component is later redesigned, the older design
may become obsolete. When a revision of the component object is then created, the
relationship would disconnect from the original and connect to the newer revision. If the
component is cloned because a similar component is available, the cloned component may
or may not be part of the assembly the original component connects to. The connection to
the original should remain but there should be no connection to the cloned component.
For the process to work in this fashion, the relationship definition would include the
attribute “quantity.” The cardinality would be “many to many” since components could be
connected to several assemblies and assemblies can contain many components. The
revision rule would be “float” so new revisions would use the connections of the original.
The clone rule would be “none” so the original connection remains but no connection is
created for the clone.
You must be a Business Administrator to define relationships. (Refer also to your Business
Modeler Guide.) Relationships are typically initially created through MQL when all other
primary administrative objects are defined. However, if a new relationship must be added,
it can be created with Business Administrator.
Version 10 355
Relationship Name _______ _______ _______ _______ _______ _______
From Clone Behavior _______ _______ _______ _______ _______ _______
To Type _______ _______ _______ _______ _______ _______
To Meaning _______ _______ _______ _______ _______ _______
To Cardinality _______ _______ _______ _______ _______ _______
To Rev Behavior _______ _______ _______ _______ _______ _______
To Clone Behavior _______ _______ _______ _______ _______ _______
Attributes _______ _______ _______ _______ _______ _______
A relationship between two business objects is defined with the Add Relationship
statement:
add relationship NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the relationship you are defining. The relationship name is limited to
127 characters. For additional information, refer to Business Object Name in Chapter 35.
ADD_ITEM is an Add Relationship clause which provides more information about the
relationship you are creating. The Add Relationship clauses are:
attribute ATTRIBUTE_NAME {, ATTRIBUTE_NAME}
trigger EVENT_TYPE TRIGGER_TYPE PROG_NAME [input ARG_STRING]
description VALUE
icon FILENAME
from ADD_SUB_ITEM {, ADD_SUB_ITEM }
to ADD_SUB_ITEM {, ADD_SUB_ITEM }
[!|not]preventduplicates
[!|not]hidden
property NAME [to ADMINTYPE NAME] [value STRING]
Only the From and To clauses are required to make a relationship usable. However, each
clause is beneficial when defining relationships. In the sections that follow, the clauses
and the arguments they use are discussed.
Attribute Clause The Attribute clause of the Add Relationship statement associates one or more attributes
with a relationship. To assign an attribute to a relationship, it must be previously defined.
Attributes are useful in providing information specific to the connection you are making.
In some cases the information is included in the business objects; in other cases, it is more
appropriate to associate the information with the body of the connection. When making a
connection, the user will fill in the attribute values.
For example, many different Assembly objects might use a Component object. The cost
for installing the component into each assembly may differ considerably. Therefore, you
may want to define an attribute called “Installation Cost” and associate it with the
component relationship. Whenever a connection is made between a Component object and
an Assembly object, the user can insert the cost associated with that connection.
While you may originally define an attribute for use in a relationship, it can also be used in
other relationship definitions or type definitions. Therefore, it is possible for the attribute
to be contained within the object itself.
As another example, a Quantity attribute is assigned to an assembly object to track the
number of components used. You also can assign the Quantity attribute to a relationship to
track the number of times the component is required for an Assembly. Since the quantity
of the component may differ from assembly to assembly, the relationship records the
amount as part of its definition. When a specific Component object is connected to a
Version 10 357
particular Assembly object, the user automatically has a means of inserting the quantity
information.
An Add Relationship statement may have many or no Attribute clauses depending on the
types of objects being connected and why. For example, the following statement
associates three attributes with the relationship named “Assembly Relationship”:
add relationship “Assembly Relationship”
description “Identifies component objects used in an assembly object”
attribute Quantity
attribute Units
attribute “Installation Cost”
from
type Assembly
meaning “Is composed of”
cardinality n
revision float
clone none
to
type Component
meaning “Is used by”
cardinality n
revision float
clone none;
Once this statement is processed and the relationship is defined, the user can create
connections between instances of Component type objects and instances of Assembly type
objects by using the Connect Businessobject statement (as described in Making
Connections Between Business Objects in Chapter 36). These connections have three
fields where the user can define the values for the attributes: Quantity, Units, and
Installation Cost. Although the user is not required to enter values for the attributes, they
are always available.
Trigger Clause Event Triggers allow the execution of a Program object to be associated with the
occurrence of an event. The following Relationship events support Triggers:
• create
• delete
• modifyattribute
• freeze
• thaw
For example, when a relationship is instantiated (created), a trigger could check that an
attribute value is equal to a certain value, and notification of the connection could be sent
to an appropriate user. In fact, if the attribute value did not meet a specified set of criteria,
a different event could replace the original. These transactions are written into program
objects which are then called by the trigger.
Relationship Triggers use the following syntax:
trigger EVENT_TYPE TRIGGER_TYPE PROG_NAME [input ARG_STRING]
EVENT_TYPE is any of the valid events for Relationships: create, delete, modifyattribute,
freeze, thaw.
Description The Description clause of the Add Relationship statement provides general information
Clause for both you and the user about the function of the relationship. There may be subtle
differences between some relationships; the Description clause enables you to point out
the differences to the user.
There is no limit to the number of characters you can include in the description. However,
keep in mind that the description is displayed when the mouse pointer stops over the
relationship in a chooser. Although you are not required to provide a description, this
information is helpful when a choice is requested.
For example, assume you have two relationships: Comment and Annotation. Which
relationship should the user use to connect a documentation object to a drawing object? A
Description clause for each of these two relationships should:
• Provide reasons why each relationship is defined.
• Indicate the differences between them.
For example, in these statements you can determine the relationship to use:
add relationship Comment
description “Connects documentation objects to projects, plans, and specs”;
add relationship Annotation
description “Connects documentation objects to drawings and schematics”;
Version 10 359
Icon Clause The Icon clause of the Add Relationship statement associates an image with a business
object relationship. For example, you may want to use an icon that represents the types of
objects being linked. Icons help users locate and recognize items by associating a special
image with the relationship. You can assign a special icon to the new relationship or use
the default icon. The default icon is used when in view-by-icon mode. Any special icon
you assign is used when in view-by-image mode. When assigning a unique icon, you must
use a GIF image file. Refer to Icon Clause in Chapter 1 for a complete description of the
Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
To and From The To and From clauses of the Add Relationship Statement define the ends of the
Clauses connections. These clauses identify:
• The types of business objects that can have this relationship.
• The meaning of each connection end.
• The rules for maintaining the relationship.
All relationships will occur between two business objects. These objects may be of the
same type or different types. When looking at a relationship, the objects are connected TO
and FROM one another.
In some relationships, you can assign either object to either end. However, the To and
From labels help you identify the reason for the connection.
You must define the connection with one To clause and one From clause in your Add
Relationship statement. If either clause is missing or incomplete, the relationship will not
be created.
Both the To and From clauses use the same set of subclauses because they define the same
information about each connected business object. The separate values you use to define
each connection end will vary according to the type of connection you are making and the
types of objects involved.
When you define one end of a connection, only one subclause is required: type.
type TYPE_NAME {, TYPE_NAME}
type all
meaning VALUE
cardinality CARDINAL_ID
revision REVISION_RULE
clone CLONE_RULE
[!|not]propagatemodify
type defines the types of business objects the user can use for each connection end
within the relationship.
meaning (optional) helps the user identify the purpose of the objects being connected.
The meaning is limited to 127 characters.
cardinality, revision and clone (all optional) deal with the number of
relationships that the object can have on each end and how those relationships are
Type Subclause
The Type subclause specifies the types of business objects that can be used for each
connection end within the relationship. Types must already be defined in Matrix. You
must specify at least one business object type at each end in order for the relationship to be
valid.
When both ends of the connection involve a single business object type, the relationship
name can reflect the types being connected. For example, a relationship name of “Model
and Drawing” might always refer to a connection between an electronic drawing and a
physical model made from the drawing.
When a connection end can be assigned multiple business types, the name of the
relationship needs to be more generic. For example, a relationship named “Part Usage”
might have one connection end that is either an Assembly or Subassembly object type.
The other connection end is a either a Component or Subassembly object type. While you
have only one relationship, you actually have four types of connections you can make:
Version 10 361
• Component objects and Subassembly objects
• Component objects and Assembly objects
• Subassembly objects and Subassembly objects
• Subassembly objects and Assembly objects
This enables you to relate all components and subassemblies to their larger subassemblies
and assemblies without defining a relationship for each connection type.
A variation of the Type subclause uses the keyword all in place of one or more type names
(type all). When this keyword is used, all business object types defined within Matrix are
allowed with the named relationship. This means that the specified relationship end can
have any object type. Be aware that any additional object types added at a later date will
be allowed within the relationship. This can create problems if the new object types are
incompatible with the relationship ends. Therefore, you should use the type all
subclause with care.
Meaning Subclause
An end’s meaning is a descriptive phrase that identifies how the connection end relates to
the other end (when viewed from the other end). The meaning helps the user identify the
purpose of the objects being connected. Although the Meaning clause is not required, its
use is strongly recommended.
In the example statement on the previous page, the Meaning clauses identify the
arrangement when a Subassembly object is connected to another Subassembly object. The
Meaning clauses identify the order.
Even when both objects are equivalent, inserting a Meaning clause is helpful. It tells the
user that the order does not matter. For example, assume you wrote a relationship
definition to link equivalent components. In the following definition, the Meaning clause
states that both objects have the same meaning. While the user might guess the meaning
from the relationship name and description, the Meaning clause eliminates doubt.
add relationship “Alternative Components”
description “Identifies interchangeable components”
from
type Component
meaning “Can be used in place of”
cardinality 1
revision none
clone none
to
type Component
meaning “Can be used in place of”
cardinality 1
revision none
clone none;
Cardinality Subclause
Cardinality refers to the number of relationships that can simultaneously exist between the
two instances of business objects. The Cardinality subclause defines this number. When
you define the cardinality, it can have one of these values:
• One or 1—The object can only have one connection of this relationship type at any
time.
1 to n Or: n to 1
Object Object
D C
Object Object
D C
One-to-One
In a One-to-One relationship, the object on each end can be connected to only one other
object with this type of relationship. An example of this type of cardinality might apply
with a Change Order object connected to a Drawing object. Only one Change Order can
be attached to the Drawing at any time and only one Drawing object can be attached to a
Change Order.
In another example, you might have only one Customer object connected to a Flight
Reservation object. The same customer cannot be on two flights simultaneously and two
Version 10 363
paying customers cannot occupy the same seat on a flight. Even a mother with a baby is
contained in a single Customer object since she still represents a single paying customer.
One-to-Many Or Many-to-One
In a One-to-Many or Many-to-One relationship, the object on the “many” side can be
attached to many other objects with this relationship type while the object on the “one”
end cannot. An example of this type of relationship is a training course with multiple
course evaluations. In an evaluation relationship, a single Training Course object can have
many Course Evaluation objects attached to it. Therefore, the side of the relationship that
allows the Training Course type needs a cardinality of One so that each Course Evaluation
object can be connected to only one Training Course. On the other hand, the side of the
relationship that allows the Course Evaluation type needs a cardinality of Many to allow
many of them to use this kind of relationship to attach to the Course object.
Tip: Think of how many objects will typically exist on each end of the relationship. If it is
one, the cardinality is ONE. If it is more than one, the cardinality is MANY.
Many-to-Many
In a Many-to-Many relationship, objects on both ends of the relationship can have
multiple simultaneous connections of this relationship type. This type of cardinal
relationship is evident in a relationship between Component and Assembly objects. One
Component object may be simultaneously connected to many different Assembly objects
while one Assembly object may be simultaneously connected to many different
Component objects. Both sides of the relationship are defined with a cardinality of Many
since both can have more than one connection of this type at any time.
Revision Subclause
When you are defining the cardinal value for a connection end, one factor that you must
consider is revision. What will happen to the relationship if one of the connection ends is
revised? Will you shift the relationship to the revised object, create a second new
relationship with the revised object, or simply maintain the status quo by retaining a
relationship with the unrevised object? The answer is specified by the revision rule
associated with each connection end, as described in the following paragraphs.
The Revision subclause identifies the rule for handling revisions of the connection object.
There are three revision rules for handling revised connection ends: None, Float, and
Replicate (as illustrated below).
Object Object
B B
Object Object
B B
Object Object
B B
A new connection is made to the revised object. The original connection is left intact.
None
When a connection end uses the None rule, nothing happens to the established connection
when the end object is revised. The revised object does not automatically have a
relationship attached to it after it is created. If you wanted to connect the revised object to
the same object as the unrevised one, you would have to manually connect it with the
Connect Business Objects statement (see Making Connections Between Business Objects
in Chapter 36).
Version 10 365
Using the None rule is useful when an object revision removes the need for the
connection. For example, when you have a connection between a Training Course object
and a Course Evaluation object, the connection may no longer be required or useful if the
Training Course object is revised. While you may want to maintain the connection
between the old version of the Training Course and the evaluation, the evaluation does not
apply to the new version of the Training Course object. Therefore the connection end
occupied by the Training Course object would use the None rule. But what of the other
connection end?
If the Evaluation object is revised, it is still useful to the Training Course object. The
revised object should remain connected to the Training Course object but the unrevised
object no longer applies. To handle this situation, you would define the Course Evaluation
end with the Float rule.
Float
The Float rule specifies that the relationship should be shifted whenever the object is
revised. When the Float rule is used, the unrevised (or older version of the) object loses
the connection with its other end. In its place the other end is automatically connected to
the revised object. Now the older version of the object will be unattached while the newer
version will have the relationship. This floating of the connection ensures that the latest
versions of the object(s) are linked together.
But what if you want to maintain the old relationship while still creating a relationship
with the new version? This would actually produce two connections: one between the
unrevised object and its other end and one between the revised object and its other end. In
this case, you would use the Replicate rule.
Replicate
The Replicate rule automatically creates new relationships whenever a connection end is
revised. This results in a connection end that may have more than one simultaneous
relationship of the same relationship type. For this reason, any connection end that uses
the Replicate rule must also use a cardinality of “n,” as described in section Cardinality
Subclause. If a cardinality value of 1 (one) is used, Replicate can not work.
The Replicate rule is useful when you want to keep track of former relationships. Since the
old relationships are maintained while new ones are created, a user can easily see all
versions that are related to a connected object. For example, you might have a relationship
between a Specification object and a Specification Change object. As the Specification
object is revised, you want to maintain the relationship so that you know that this
Specification Change applied to this version of the Specification.
However, you also want the relationship to exist between the revised Specification and the
Specification Change. This new relationship enables you to trace the history of the
changes made and the reasons for them. In this situation, the Specification object should
use the Replicate revision rule while the Specification Change object might use the Float
or Replicate rule.
Note that the two connection ends have different revision rules and cardinality. Remember
that these values should be determined for each connection end based upon the needs and
requirements for that object as it relates to the connection being made. Since you may
want only the latest version of the Specification Change Notice to be attached to the
Specification, Float is the best choice for the revision rule. If you wanted to keep track of
all notices that were attached to the Specification, you could change the revision rule to
Replicate.
Clone Subclause
Just as you must define what should happen to the relationship if one of the connection
ends is revised, you must define what should happen if one of the connection ends is
cloned. The same three rules available for revisions are available for clones: None, Float,
and Replicate.
Most business rules require a clone to be treated much differently than a revision, so you
may often select a different rule for clones than for revisions. For example, the None rule
is often useful when a connection end is cloned. Consider a Specification Change Notice
object that is connected to a Specification object. If the Specification is cloned for a new
product that is very similar, it’s unlikely that the Specification Change Notice applies to
the cloned Specification. So the original connection between the Specification Change
Notice object and Specification object should remain but no new connection is needed for
the cloned Specification object.
Version 10 367
For example:
add relationship BOM
attribute Quantity
to
type Component
from
type Assembly
propagatemodify;
Using the relationship above, changes in the quantity of the component in the assembly
will be reflected in the modification date of the Assembly.
Preventduplicates A flag can be set in the relationship definition that will prevent duplicates of the
Clause relationship type to exist between the same two objects. The default is that duplicates are
allowed.
For example, to prevent duplicates of the relationship Documents, use the following
command:
add relationship Documents
preventduplicates
The preventduplicates flag will NOT prevent a second relationship between two
objects if it points in the opposite direction. For example, given BusObjA connected
ONCE to BusObjB with preventduplicates, connecting BusObjA with
preventduplicates to BusObjB will fail. Connecting BusObjB with
preventduplicates to BusObjA will succeed.
Hidden Clause You can specify that the new relationship is “hidden” so that it does not appear in the
Relationship chooser in Matrix. You may want to use the hidden option if, for example, an
object is under development or if it is intended only for your personal use. Hidden objects
are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the relationship. Properties
allow associations to exist between administrative definitions that aren’t already
associated. The property information can include a name, an arbitrary string value, and a
reference to another administration object. The property name is always required. The
value string and object reference are both optional. The property name can be reused for
different object references, that is, the name joined with the object reference must be
unique for any object that has properties.
add relationship NAME
property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 369
Copying and/or Modifying a Relationship
Definition
Copying (Cloning) After a relationship is defined, you can clone the definition with the Copy Relationship
a Relationship statement. This statement lets you duplicate defining clauses with the option to change the
Definition value of clause arguments:
copy relationship SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Modifying a After a business object relationship is defined, you can change the definition with the
Relationship Modify Relationship statement. This statement lets you add or remove defining clauses
Definition and change the value of clause arguments.
modify relationship NAME [MOD_ITEM {MOD_ITEM}];
As you can see, each modification clause is related to the clauses and arguments that
define the relationship. When you modify a business object relationship, you first name
the relationship to be changed and then list the modifications. For example, to change the
name of the Alternative relationship and add an attribute and a trigger, you might write
this statement:
modify relationship Alternative
name "Component Alternative"
add attribute "Cost Comparison"
add trigger create check "Cost Check"
add trigger create override "Use Alternate Relationship"
add trigger create action "Notify John";
Connection End When you are modifying the connection ends of the relationship, the MOD_SUB_ITEM
Modifications clause is similar to the clauses used to define the end objects:
Connection End
Modification Clause Specifies that…
add type all All defined Matrix types are allowed to be associated with this relationship
end.
add type TYPE_NAME The object type(s) listed here are allowed to be associated with this
{,TYPE_NAME} relationship end.
remove type all All object types are removed from this relationship end.
remove type TYPE_NAME The object type(s) listed here are removed from this relationship.
{,TYPE_NAME}
meaning VALUE The current meaning, if any, changes to the value entered.
cardinality CARDINAL_ID The value for cardinality is set to the value entered.
revision REVISION_RULE The revision rule changes to the value entered.
clone CLONE_RULE The clone rule changes to the value entered.
Version 10 371
Connection End
Modification Clause Specifies that…
propagatemodify The modification timestamp of the object on the specified end will be
updated when the relationship’s attribute values are modified.
[!|not]propagatemodify The modification timestamp of the object on the specified end will not be
updated when the relationship’s attribute values are modified.
propagateconnection The modification timestamp of the object on the specified end will be
updated during connect/disconnect operations.
[!|not]propagateconnection The modification timestamp of the object on the specified end will not be
updated during connect/disconnect operations.
These clauses are used within the To and From clauses as they are used in the Add
Relationship statement. Assume you have the following definition:
add relationship Comment
description “Associates comment with related object”
from
type Comment
meaning “Provides comment about ”
cardinality n
revision none
clone none
propagatemodify
!propagateconnection
to
type Assembly, Document, Specification, Layout
meaning “Is commented in ”
cardinality n
revision none
clone none
propagatemodify
!propagateconnection;
To this definition, you might want to add a new object type that can connect to Comment
objects, and you want objects on the from end to propagate modifications of the
relationship to the business object. You also want to save all revised comments and
include them in all revisions with the commented object. To make these changes, you
might write the following Modify Relationship statement:
modify relationship Comment
to
revision replicate
from
add type “Process Plan” propagatemodify;
Version 10 373
Deleting a Relationship
If a relationship is no longer desired between business objects, you can delete it with the
Delete Relationship statement:
delete relationship NAME;
After this statement is processed, the relationship is deleted and you receive an MQL
prompt for another statement.
Once you have defined Relationship types, as described in the sections above, connections
can be made between specific business objects. Refer to Making Connections Between
Business Objects in Chapter 36, for the MQL commands for connecting objects. These
relationship instances can be accessed by MQL in two ways:
• by specifying the business objects on each end
Or:
• by specifying its connection ID.
The first method will work only if exactly one of a particular relationship type exists
between the two listed objects. Therefore, if relationships are to be programmatically
modified, the second method, using connection IDs, is the safer approach.
Modifying Relationship instances can be accessed so that operations, such as modifying attributes,
Relationships can be performed. A relationship instance can be specified by its defined name together
with the objects on both connection ends as follows:
modify connection businessobject OBJECTID to|from businessobject OBJECTID
relationship REL_TYPE ATTR_NAME ATTR_VAL,[ATTR_NAME ATTR_VAL];
If the object is connected to another object by more than one instance of the specified
relationship type, the above command generates an error message. If this message occurs,
in order to make modifications, the relationship ID must be specified.
Connection IDs To obtain the relationship IDs of all connections, select the relationship ID item in an
expand businessobject select statement; for example:
expand bus Assembly 50402 B select relationship id;
The following is the result that could be saved to a file if an output clause is used in the
above-referenced command:
1 Drawing from Drawing 50402 A
id = 19.24.5.16
1 Process Plan from Process Plan 50402-1 C
id = 19.26.6.6
Refer to Displaying and Searching Business Object Connections in Chapter 36 for more
information on the expand statement.
Version 10 375
Modifying The returned list of IDs can be used to make attribute changes to any of the listed
Attributes of a connections, using the following syntax:
Connection modify connection ID ATTR_NAME ATTR_VAL [ATTR_NAME ATTR_VAL];
Freezing Connections can be frozen (locked) to prevent configurations from being modified.
Connections Relationships that are frozen cannot be disconnected, and their attributes cannot be
modified. A user would only be allowed to freeze a relationship if they have freeze access
on the objects on both ends.
freeze connection ID;
When objects are cloned or revised, their existing relationships are either floated,
replicated, or removed. When a frozen relationship is floated, the new relationship
instance is frozen as well. Replicated relationships take on the thawed state.
Thawing A frozen relationship can be thawed (unlocked) by using the following syntax:
Connections thaw connection ID;
Users must have thaw access on the objects on both the to and from end of the
relationship.
Deleting Connections can be deleted using the disconnect command with the connection ID:
Connections disconnect connection ID;
Users must have todisconnect access on the to object and fromdisconnect access on the
from object.
Printing Users can print the description of a connection using the print connection command. For
Connections example
print connection 19.24.5.16;
OBJECTID is the OID or Type Name Revision of the business object. It may also include
the in VAULTNAME clause, to narrow down the search.
Note that the result of print connection with object ends specified will be ambiguous
when multiple relationships between the two objects exist.
It is also possible to list only certain items to be printed about relationships. To obtain the
selectable list for relationship instances, use:
print connection selectable;
Use of print relationship selectable will fail. The selectable items for
connections are shown below:
print connection selectable;
connection selectable fields:
name
type.*
attribute[].*
businessobject.*
to.*
from.*
history[].*
isfrozen
propagatemodifyto
propagatemodifyfrom
id
Refer to Viewing Business Object Definitions in Chapter 35 for more information about
the use of selectables. Also refer to the Select Expressions appendix in the Matrix PLM
Platform Programming Guide.
Version 10 377
378 MQL Guide
15
Working With Formats
Overview of Formats .................................................................................... 380
Defining a Format ......................................................................................... 381
Description Clause.......................................................................................... 381
Creator and Type Clauses.............................................................................. 382
View, Edit, and Print Clauses ......................................................................... 382
Icon Clause..................................................................................................... 383
Suffix Clause................................................................................................... 383
Mime Clause................................................................................................... 384
Version Clause ............................................................................................... 384
Hidden Clause ................................................................................................ 384
Property Clause .............................................................................................. 385
Copying and/or Modifying a Format Definition.......................................... 386
Copying (Cloning) a Format Definition............................................................ 386
Modifying Format Definitions .......................................................................... 386
Deleting a Format ......................................................................................... 388
Version 10 379
Overview of Formats
You must be a Business Administrator to add or modify formats. (Refer also to your
Business Modeler Guide.)
Format definitions are created using the MQL Add Format statement. This statement has
the syntax:
add format NAME [ADD_ITEM {ADD_ITEM}]
NAME is the name of the format you are creating. The format name is limited to 127
characters. For additional information, refer to Business Object Name in Chapter 35.
ADD_ITEM is an Add Format clause which provides more information about the format.
They also provide information on how a file with that format should be processed. The
Add Format clauses are:
description VALUE
creator NAME
type NAME
edit PROGRAM_OBJECT_NAME
icon FILENAME
print PROGRAM_OBJECT_NAME
suffix VALUE
mime VALUE
version VALUE
view PROGRAM_OBJECT_NAME
[!|not]hidden
Each clause and the arguments they use are discussed in the sections that follow.
Description The Description clause of the Add Format statement provides general information for both
Clause you and the user about the types of files associated with this format and the overall
function of the format. There may be subtle differences between formats; the Description
clause enables you to point out these differences to the user.
There is no limit to the number of characters you can include in the description. However,
keep in mind that the description is displayed when the mouse pointer stops over the
format in a chooser. Although you are not required to provide a description, this
information is helpful when a choice is requested.
When a user has a file to check in, the description guides the user as to which format will
properly process the file. If the file is assigned the wrong format, the user may be unable
to fully access or process the file once it is in the database.
For example, assume you have two types of word processing programs commonly used to
create text documents. You want to distinguish between the file formats created by the
programs. So, you create two formats: one for each word processing program. Each
Version 10 381
format will define the word processing program used to view, edit, and print a file that was
originally created with that program.
When you create the formats, you should assign names that have meaning to both you and
the user. In this example, you could use the names of the programs: TextTYPE and
BestBooks. Then you can provide more information by including a Description clause in
each definition:
add format “TextTYPE”
description “Use for text documents created with TextTYPE”;
add format “BestBooks”
description “Use for text documents created with BestBooks”;
Creator and Type The Creator and Type fields are Macintosh file system attributes (like Protection and
Clauses Owner on UNIX systems). They should not be confused with Matrix users or types. The
following is an example Creator clause of the Add Format statement:
creator ‘MPSX’
This would identify a script file created by the Macintosh toolserver. Both fields are four
bytes in length and are generally readable ASCII. If you specify a value for only one of the
two clauses, the other clause assumes the same value. The values for creator and type are
registered with Apple for each Macintosh application. When a file is checked out to a
Macintosh, these attribute settings will be applied. If Macintoshes are not used, the fields
can be left blank.
View, Edit, and The View, Edit, and Print clauses specify the program to use to view (open for view), edit
Print Clauses (open for edit), or print files checked into the format. When you specify the program, you
are actually specifying the name of the program object that represents the program.
For Windows platforms, if you want to open files for view, edit, or print based on their file
extensions and definitions in the Windows Registry, you can leave out the corresponding
clause. For example, by default Windows uses MS Paint to open files with a file extension
of .bmp. Keep in mind that each user’s PC contains its own Windows Registry database,
which is editable; the databases are not shared between computers. If you want to provide
a more complex and flexible format that will use the file association mechanism of
windows, refer to Format Definition Example Program in Chapter 19.
Syntax
The View, Edit, and Print clauses of the Add Format statement use this syntax:
view PROGRAM_OBJECT_NAME
edit PROGRAM_OBJECT_NAME
print PROGRAM_OBJECT_NAME
For example, the following is a sample format definition for CADplus, a computer aided
design system:
add format CADplus
description “CADplus Computer Aided Design System"
version 10
suffix “.cad"
view CADview.exe
edit CADedit.exe;
After this format is defined, Matrix can open a file checked in with this format using
CADview for viewing or using CADedit for editing.
Icon Clause The Icon clause of the Add Format statement associates a special image with the format. If
you defining a format for text files, you might associate an icon that shows a text page to
distinguish word processing formats from image files, mail files, report files, and so on.
Icons help users locate and recognize items by associating a special image with the format.
The default icon is used when in view-by-icon mode. Any special icon you assign is used
when in view-by-image mode. When assigning a unique icon, you must use a GIF image
file. Refer to Icon Clause in Chapter 1 for a complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Suffix Clause The Suffix clause of the Add Format statement specifies the default suffix for the format.
If an object is selected that contains no files, “open for edit” generates the name of the file
from the object name. Matrix attempts to open a file with that name and the default format
suffix.
Assume you want to add a note to a business object. You might use the TextTYPE or
BestBooks word processing programs to create the note. TextTYPE uses a default file
suffix of .text for document files and BestBooks uses .bb. These suffixes enable users
to quickly identify file types. For example:
add format “TextTYPE"
description “For documents created with TextTYPE"
version 3.1
suffix “.tex";
add format “BestBooks"
description “For documents created with BestBooks"
version 6.0
suffix “.bb";
Version 10 383
After these definitions are made, any file that uses a TextTYPE format will have a suffix
of .tex and any file that uses a BestBooks format will have a suffix of .bb.
The suffix specified in the Format is not used in the launching mechanism—the file itself
is passed to the operating system and its extension (or suffix) is used to determine what
application should be opened.
Mime Clause You can specify the MIME (Multi-Purpose Internet Mail Extension) type for a format.
MIME types are used when files are accessed via a Web browser. To specify a MIME
type, use the mime clause in the format definition:
creator VALUE
VALUE is the content type of the file. The format of VALUE is a type and subtype
separated by a slash. For example, text/plain or text/jsp.
The major MIME types are application, audio, image, text, and video. There are a variety
of formats that use the application type. For example, application/x-pdf refers to Adobe
Acrobat Portable Document Format files. For information on specific MIME types (which
are more appropriately called “media” types) refer the Internet Assigned Numbers
Authority Website at http://www.isi.edu/in-notes/iana/assignments/media-types/. The
IANA is the repository for assigned IP addresses, domain names, protocol numbers, and
has also become the registry for a number of Web-related resources including media
types.
To find the MIME types defined for a particular format, use the following command:
print format FORMAT_NAME select mime;
Version Clause The Version clause of the Add Format clause identifies the version number of the software
required to process the file. The software version is useful when tracking files created
under different software releases. Upward and downward compatibility is not always
assured between releases. If you install a new software release that cannot process existing
files, you can create a new format for the new release and leave the old format in place.
The old format automatically references the older version of the software while the new
format references the new version.
Matrix does not check the version number against the software you are using. You can
enter any value. However, you should use the actual version number or identifier if
possible. For example:
add format ASCII version Standard;
add format “TextTYPE” version 3.1;
Hidden Clause You can specify that the new format is “hidden” so that it does not appear in the checkin/
checkout list of formats in Matrix. You may want to use the hidden option if, for example,
an object is under development or if it is intended only for your personal use. Hidden
objects are accessible through MQL.
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 385
Copying and/or Modifying a Format Definition
Copying (Cloning) After a format is defined, you can clone the definition with the Copy Format statement.
a Format This statement lets you duplicate defining clauses with the option to change the value of
Definition clause arguments:
copy format SRC_NAME DST_NAME [MOD_ITEM] {MOD_ITEM};
Modifying Format After a format is defined, you can change the definition with the Modify Format
Definitions statement. This statement lets you add or remove defining clauses and change the value of
clause arguments:
modify format NAME [MOD_ITEM] {MOD_ITEM};
As you can see, each modification clause is related to the clauses and arguments that
define the format. For example, the following statement changes the name and version of
the format named “TextTYPE Version 9.1”:
modify format “TextTYPE Version 9.1”
name “TextTYPE Version 10”
version 10.0;
When modifying a format, remember the question of upward and downward compatibility
between software versions. Since all files with the defined format are effected by the
change, you should test sample files or read the release notes to determine whether or not
old files will be negatively effected. If they will be, you may want to create a new format
for the new software version rather than modify the existing format definition.
In some cases, the suffix will be different for documents created in a new release of the
application software. Therefore, a separate format is required (at lease until all files are
updated).
Version 10 387
Deleting a Format
If a format is no longer required, you can delete it with the Delete Format statement:
delete format NAME;
After this statement is processed, the format is deleted and you receive an MQL prompt
for another statement.
Version 10 389
Rule Defined
Use rules to limit user access to attributes, forms, programs, and relationships. Unlike
policies, rules control access to these administrative objects regardless of the object type
or state. For example, a policy might allow all users in the Engineering group to modify
the properties of Design Specification objects when the objects are in the Planning state.
But you could create a rule to prevent those users from changing a particular attribute of
Design Specifications, such as the Due Date. In such a case, Engineering group users
would be unable to modify the Due Date attribute, no matter what type of object the
attribute is attached to. For a explanation of how rules work with other objects that control
access, see Which Access Takes Precedence Over the Other? in Chapter 10.
When you create a rule, you define access using the three general categories used for
assigning access in policies: public, owner, and user (specific person, group, role, or
association). For a description of these categories, see Policies in Chapter 10.
Creating a Rule Rules are defined using the Add Rule statement:
add rule NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the rule you are creating. All rules must have a name assigned. When
you create a rule, you should assign a name that has meaning to both you and the user. The
rule name is limited to 127 characters. For additional information, refer to Business Object
Name in Chapter 35.
ADD_ITEM is an Add Rule clause which defines information about the rule including the
description, icon, and access masks. The Add Rule clauses are:
description VALUE
icon FILENAME
[!|not]hidden
Some of the clauses are required and some are optional, as described in the sections that
follow.
Description The Description clause of the Add Rule statement provides general information about the
Clause types of accesses associated with the rule. Since there may be subtle differences between
rules, the Description clause enables you to point out these differences.
There is no limit to the number of characters you can include in the description. However,
keep in mind that the description is displayed when the mouse pointer stops over the rule
in a chooser. Although you are not required to provide a description, this information is
helpful when a choice is requested.
Icon Clause The Icon clause of the Add Rule statement associates an image with a rule. You can assign
a special icon to the new rule or use the default icon. The default icon is used when in
view-by-icon mode. Any special icon you assign is used when in view-by-image mode.
When assigning a unique icon, you must use a GIF image file. Refer to Icon Clause in
Chapter 1 for a complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Version 10 391
Hidden Clause You can specify that the new rule is “hidden” so that it does not appear in the chooser in
Matrix. Users who are aware of the hidden rule’s existence can enter its name manually
where appropriate. Hidden objects are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the rule. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add rule NAME
property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Assigning Access Each access form is used to control some aspect of a business object’s use. With each
access, other than all and none, you can either grant the access or explicitly deny the
access. You deny an access by entering not (or !) in front of the access in the statement.
For every administrative object (attribute, form, program, relationship) governed by a
rule, a user has access only if the rule specifically grants the user access. If the user isn’t
granted access by the rule, the user won’t have access, even if the policy grants access to
the user.
For example, suppose you don’t want anyone to modify an attribute called Priority unless
they belong to the Management role. However, everyone should be able to view the
attribute’s values. (Assume the person and policy definitions grant the appropriate
accesses.) You would create a rule that governs the Priority attribute and define the
following accesses:
Owner: read
Public: read
Management role: all
The available accesses are summarized in Accesses in Chapter 10.
It is important to keep in mind that while the complete list of access items is available
when creating rules, when they are actually used, only the applicable privileges are
checked. The table below shows the accesses each administrative type uses:
Owner Clause
The Owner Clause of the Add Rule statement specifies the maximum amount of access
the owner of a business object will be allowed. When this clause is used, you can select
from many different forms of access. For example when creating a relationship rule you
might use:
add rule DocumentsRelRule owner toconnect, fromconnect,
todisconnect, fromdisconnect, changetype;
Public Clause
The Public Clause of the Add Rule statement specifies the maximum amount of access
that all Matrix users will be allowed. When this clause is used, you can select from many
different forms of access. For example when creating a form rule you might use:
add rule RequisitionForm owner viewform, modifyform public
viewform;
User Clause
The User Clause of the Add Rule statement specifies the maximum amount of access
allowed for the specified USER_NAME, which can be any person, group, role, or
association already defined to Matrix. When this clause is used, you can select from many
different forms of access. For example when creating an attribute rule you might use:
add rule CostAttribute
owner Read
user Finance read, modify
public none;
User access lists defined on a rule can accept a filter expression in order to grant or deny
access to a specific user. If the filter expression evaluates to “true,” the specified access
will be granted; otherwise the access is denied. This provides an additional level of access
granularity, which increases security and reduces overall management problems by
reducing the number of policies or rules required.
Expression access filters can be any expression that is valid in the Matrix system.
Expressions are supported in various modules of the Matrix system, for example, query
where clauses, expand, filters defined on workspace objects such as cues, tips and filters,
Version 10 393
etc. See Working With Expression Access Filters in Chapter 10 for details on how access
filters can be used.
add rule ExportAllowed
owner read
public none
user ’Hydralic Products, Inc.’ read, modify checkin checkout
filter context.user.property[Export Allowed].value;
In this case, the selected access (read, modify, checkout, checkin) would be allowed only:
• if context user belongs to the group “Hydraulic Products, Inc.” and
• if context.user.property[Export Allowed].value is evaluated as
true.
Since you must have at least read access to the business object in order to evaluate the
filter, normal access checks must be disabled while an access filter is being evaluated.
Copying (Cloning) After a rule is defined, you can clone the definition with the Copy Rule statement. This
a Rule Definition statement lets you duplicate rule definitions with the option to change the value of clause
arguments:
copy rule SRC_NAME DST_NAME [MOD_ITEM] {MOD_ITEM};
Modifying a Rule After a rule is defined, you can change the definition with the Modify Rule statement. This
Definition statement lets you add or remove defining clauses and change the value of clause
arguments:
modify rule NAME [MOD_ITEM {MOD_ITEM}];
Version 10 395
Modify Rule Clause Specifies that…
remove user USER_NAME ACCESS The specified user access is removed. USER_NAME defines the person,
{,ACCESS} [filter EXPRESSION] group, role or association for which the rule is being modified. Values
for ACCESS can be found in the Accesses in Chapter 10.
property NAME [to ADMINTYPE The named property is modified.
NAME] [value STRING]
add property NAME [to ADMINTYPE The named property is added.
NAME] [value STRING]
remove property NAME [to The named property is removed.
ADMINTYPE NAME] [value STRING]
Once you have created Rules, you can assign them to existing administrative objects that
require them.
Each Attribute, Form, Program, and Relationship definition can refer to one Rule that
encompasses owner, public and as many different users as required. The Rule becomes
part of the definition of these kinds of objects.
Attributes, Forms, Programs, and Relationships created before version 6.0 of Matrix have
no Rules defined. By default, all existing definitions will still have no Rules, and will
remain available to all users as before. However, use the procedures below if you want to
add a Rule to an existing definition.
Version 10 397
Deleting a Rule
If you decide that a rule is no longer required, you can delete it by using the Delete Rule
statement:
delete rule RULE_NAME;
RULE_NAME is the name of the rule to be deleted. If the name is not found, an error
message will result.
When this statement is processed, Matrix searches the list of rules. If the name is found,
that rule is deleted IF there are no objects that are governed by the rule. If there are objects
that are governed by the rule, they must be reassigned to another rule or the object must be
deleted before the rule can be removed from the rule list.
To remove a rule from a specific administrative object, use the Remove Rule statement on
the object’s modify command. For example, to remove a rule from an Attribute, use the
modify attribute command:
modify attribute ATTRIBUTENAME remove rule RULE_NAME;
Rules can be removed from attributes, forms, policies, relationships, and programs. Refer
to Assigning Rules for additional information.
Version 10 399
Policy Defined
A policy controls a business object. It specifies the rules that govern access, approvals,
lifecycle, revisioning, and more. If there is any question as to what you can do with a
business object, it is most likely answered by looking at the object’s policy.
You must be a Business Administrator to add or modify policies. (Refer also to your
Business Modeler Guide.)
A policy is composed of two major sections: one describes the general behavior of the
governed objects and the other describes the lifecycle of the objects.
General Behavior The first section controls the creation of the object and provides general information about
the policy. This information includes:
• The types of objects the policy will govern.
• The types of formats that are allowed.
• The default format automatically assigned.
• Where and how checked in files are managed.
• How revisions will be labeled.
Lifecycle The second section provides information about the lifecycle of the objects governed by the
policy. A lifecycle consists of a series of connected states, each of which represents a
stage in the life of the governed objects. Depending on the type of object involved, the
lifecycle might contain only one state or many states. The purpose of the lifecycle is to
define:
• The current state of the object.
• Who will have access to the object.
• The type of access allowed.
• Whether or not the object can be revised.
• Whether or not files within the object can be revised.
• The conditions required for changing state.
When creating a policy, defining the policy states is most often the most difficult part.
How many states does the policy need? Who should have access to the object at each state
and what access should each person have at each state? Which access takes precedence
over the other? Should you allow revisions at this state? Should you allow files to be
edited? What signatures are required to move the object from one state to another? Can
someone override another’s signature? As described below, all of these questions should
be answered in order to write the state definition section of a policy.
How Many States A policy may have only one state or many. For example, you might have a policy that
are Required? governs photographic images. These images may be of several types and formats, but they
do not change their state. In general, they do not undergo dramatic changes or have stages
where some people should access them and some should not. In this situation, you might
have only one state where access is defined.
Let’s examine a situation where you might have several states. Assume you have a policy
to govern objects during construction of a house. These objects could have several states
such as:
State Description
Initial The building site is evaluated and prepared by the site excavator and
Preparation builder. After the site is reviewed and all preparations are completed, the
excavator and builder sign off on it and the site enters the second state,
Framing.
Framing Carpenters complete the framing of the house and it is evaluated by the
builder, architect, and customer. In this state, you may want to prohibit
object editing so that only viewing is allowed. If the framing is complete
to the satisfaction of the builder, architect, and customer, it is promoted
to the third state, Wiring.
Wiring The electrician wires the house. However, the electrician may sign off
on the job as completed only to have the builder reject it. When approval
is rejected, promotion to the next state is prevented from taking place.
As the house progresses through the building states, different persons would be involved
in deciding whether or not the object is ready for the next state.
When determining how many states an object should have, you must know:
• What are the states in an object’s life.
• Who requires access to the object.
• What type of access they need.
Once a policy is defined, you can alter it even after business object instances are created
that are governed by it.
Who Will Have There are three general categories used to define who will have access to the object in
Object Access? each state:
Version 10 401
• Public—refers to everyone in the Matrix database. When the public has access in a
state, any defined Matrix user can work with the business object when it is in that
state.
• Owner—refers to the specific person who is the current owner of the object instance.
When an object is initially created in the database, the person who created it is
identified by Matrix as the owner of the object. This person remains the owner unless
ownership is transferred to someone else.
• User—refers to a specific person, group, role, or association who will have access to
the object. You can include or exclude selected groupings or individuals when
defining who will have access.
For additional information on access privileges, including which access takes precedence
over the other, see User Access in Chapter 10.
Is the Object In each state definition are the terms Versionable and Revisionable. The term Versionable
Versionable or in Matrix indicates whether or not it is possible to check files into the object when it is in
Revisionable? that state. The term Revisionable indicates whether a new Revision of the object can be
made.
You can decide when in the object’s lifecycle these operations are allowed by setting the
switches ON or OFF in each state definition. These settings are independent of who
(which person, role or group) has access to perform the operations.
How Do You Most often a change in state is controlled by one or more persons, perhaps in a particular
Change From One role or group. For example, during the construction of a house, the customer and the
State to the Next? builder might control the change in state. If you break the building stage down into smaller
states, you might have the object’s transition controlled by the site excavator, foundation
expert, electrician, or plumber. As the house progresses through the building states,
different persons would be involved in deciding whether the object is ready for the next
state. You certainly would not want the carpenters to begin working before the foundation
is done.
In Matrix, signatures are a way to control the change of an object’s state. Signatures can
be associated with a role, group, person, or association. Most often, they are role-related.
When a signature is required, a person must approve the object in order for the object to
move on to the next state. If that person does not approve it, the object remains in the
current state until the person does approve or until someone with higher authority provides
approval.
More than one signature can be associated with the transition of an object. Lifecycles can
be set up such that the signature that is approved determines which state is the next in the
object’s life.
A signature can be approved or rejected. For example, an electrician could say a job is
done only to have the builder reject it. When approval is rejected, promotion to the next
state is prevented from taking place.
Filters can be defined on a signature requirement to determine if it is fulfilled. If the filter
evaluates to true, then the signature requirement is fulfilled. This is useful for adding
required signatures that are conditional, dependent on some characteristic of a business
object.
Version 10 403
Defining an Object Policy
NAME is the name of the policy you are creating. All policies must have a name assigned.
When you create a policy, you should assign a name that has meaning to both you and the
user. The policy name is limited to 127 characters. For additional information, refer to
Business Object Name in Chapter 35.
For example, you might have two policies that control the development of software
programs for new and existing product lines. These policies might be named “Old
Software Dev. Process” and “New Software Dev. Process.” While these are descriptive
names, they are somewhat ambiguous. Does the “Old Software Dev. Process” identify a
previously used process or a process for handling existing products? In this case, you
could either include descriptions or assign more descriptive names such as “Existing
Product Software Dev.” and “New Product Software Dev.”
ITEM is an Add Policy clause which defines information such as the types of objects
governed by the policy, the types of formats permitted by the policy, the labeling sequence
for revisions, the storage location for files governed by the policy, and the states and
conditions that make up an object’s lifecycle. The Add Policy clauses are:
description VALUE
icon FILENAME
type all
format all
defaultformat FORMAT_NAME
sequence REVISION_SEQUENCE
[not]enforce
store STORE_NAME
[!|not]hidden
Some of the clauses are required and some are optional, as described in the sections that
follow.
Description The Description clause of the Add Policy statement provides general information about
Clause the types of rules associated with the policy. When a user creates a business object, this
Icon Clause The Icon clause of the Add Policy statement associates an image with a policy. For
example, you may have one policy for working with photographs and another for working
with videos. You could assign an icon of a photograph to one and an icon of a video
cassette to the other. The default icon is used when in view-by-icon mode. Any special
icon you assign is used when in view-by-image mode. When assigning a unique icon, you
must use a GIF image file. Refer to Icon Clause in Chapter 1 for a complete description of
the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Type Clause The Type clause of the Add Policy statement defines all of the business object types
governed by the policy. Just as a policy may govern many different object types, each
object type may have many different policies that govern it. (However, an object instance
can only have one policy associated at any time.)
For example, assume you have an object type named Drawing. This type may be governed
by two policies named “Engineering Drawing Process” and “Documentation Drawing
Process”. When an object of type Drawing is created, you must decide which policy will
govern the object instance. A drawing meant for documentation will have a different
review and lifecycle than a drawing of a component to an engineering assembly. By
associating one policy with the created object, you control the types of files that can be
checked in, who will use the object, and when it is used.
The Type clause is required for a policy to be usable:
type TYPE_NAME {, TYPE_NAME}
Or
type all
Version 10 405
You can list one type or many types (separated by a comma or carriage return). When
specifying the name of an object type, it must be of a type that already exists in the Matrix
database. If it is not, an error message will display.
For example, the following two statements are valid Add Policy statements that identify
object types associated with the policy:
add policy “Engineering Revision Process”
description “Quality Control Process for Engineering Revisions”
type Drawing, “Multipage Drawings”, Schematics, Manual;
add policy “Documentation Revision Process”
description “Quality Control Process for Documentation Revisions”
type Manual, “Release Notes”;
In the first statement, the user can associate the “Engineering Revision Process” policy
with object instances of four different object types: Drawing, Multi-page Drawings,
Schematics, and Manual. In the second statement, the user can associate the
“Documentation Revision Process” policy with only two object types: Manual and
Release Notes. If the user created an object named “MQL User’s Guide” of type Manual,
could he assign a policy of “Engineering Revision Process?” The answer is yes, although
the “Documentation Revision Process” policy might be more appropriate.
A variation of the Type clause uses the keyword all in place of one or more type names
(Type All). When this keyword is used, all of the business object types defined within
Matrix are allowed by the policy—the policy governs objects of all types. Use caution
when including this clause. While all of the types currently defined may apply to the
policy, what happens if a new one is created that should not apply?
If you have a policy that uses most of the defined objects, you may want to assign all of
the types rather than list them. Then you can use the Modify Policy statement to remove
the unwanted types.
Format Clause The Format clause of the Add Policy statement defines the formats permitted under the
policy for checked in files. Depending on the policy and the object created, certain files
are appropriate or inappropriate. The Format clause restricts the types of files that can be
associated with a business object.
The Format clause is required if you want to check in files under the policy:
format FORMAT_NAME {, FORMAT_NAME}
Or
format all
FORMAT_NAME is the name of a previously defined format. If the format was not
previously defined, an error message results.
For example, you could have a policy that governs photos. This policy would need
formats for processing files that contain photographic images. In this case, there may be
two file formats allowed: GIF and JPG. These formats specify the software statements
Like the Type clause, the Format clause has a variation that uses the keyword all. When
this clause is used, all of the formats defined within Matrix are allowed under this
policy—the policy governs objects of all formats. Use caution with the Format All clause.
Are there any formats that you do not want to permit under this policy? If there are, you
will need to either list all of the desired formats or edit the policy after assigning all
formats.
Defaultformat The Defaultformat clause of the Add Policy statement is required in order to check any
Clause files in unless the Checkin clause specifies the format. If only one format is specified in
the Format clause, it is automatically the default.
The Defaultformat clause has the syntax:
defaultformat FORMAT_NAME
FORMAT_NAME can be any previously defined format that is listed in the Format clause of
the Add Policy statement. The Format clause identifies all formats permitted by the
policy.
For example, the following Add Policy statement defines the default format as a text file
that uses BestWord to process it:
add policy “Proposals”
description “Process for generating, reviewing, and releasing proposals”
type Proposal, Plan
format ASCII, “BestWord”, Drawing
defaultformat “BestWord”;
If an object does not have any files checked into its default format, execution of a View,
Edit, or Print command will check its other formats and open files found there.
Sequence Clause The Sequence clause of the Add Policy statement defines a scheme for labeling revisions.
With this clause, you can specify the pattern to use when an existing object is revised. This
pattern can include letters, numbers, or enumerated values. For example, you could have
revisions labeled “1st Rev,” A, or 1.
To define a scheme for labeling revisions, you must build a revision sequence. This
sequence specifies how objects should be labeled, the type of label to be used, and the
Version 10 407
number of revisions allowed. When you create a revision sequence, use the following
syntax rules:
Rule Example
Hyphens denote range. A-Z signifies that all letters from A through Z inclusive are to be used.
Commas separate enumerated types. Rev1,Rev2,Rev3,Rev4 is a sequence with four revision labels. Rev1 will
be assigned before Rev2, which will be assigned before Rev3, and so on.
Square brackets are used for repeating [A-Z] signifies that the sequence will repeat after Z is reached. When it
alphabetic sequences. repeats, it returns to the front of the label list and doubles the labels so
that the next sequence is AA, AB, AC, and so on.
Rounded brackets are used for repeating (0-9) signifies a regular counting sequence. (When 9 is reached it will
numeric sequences. repeat and add a 1 before the symbol). If (0-5) was used, when 5 was
reached it will repeat and add a 1: 0, 1, 2, 3, 4, 5, 10, 11, 12, etc.
A trailing ellipses (…) means a continuing A,B,C,… signifies the same thing as A-Z.
sequence. 0,1,2,… signifies the same thing as (0-9)
These rules offer flexibility in defining the revision labeling sequence. Although you
cannot have two repeating sequences in a single definition, you can include combinations
of enumerated values and ranges within a repeating sequence. For example, the following
revision sequence definition specifies that the first object should be labeled with a hyphen
and the first revision should be labeled I, the second II, the third III, etc. After the fifth
revision, all revisions will have numeric sequencing.
-,I,II,III,IV,V,(0-9)
If your location requires a numeric value, for example, for pre-released revisions, and then
an alphanumeric scheme after that, the approach should be to change the policy at the
point when the revision scheme should change. A separate policy is created and applied to
a new revision, providing different states, signatures, etc. as well as a different revision
scheme. For example, if a revision sequence is defined as:
0,1,2,...,-,[A-H,J-N,P,R,T-W,Y]
the automatic sequencing will never get beyond the number counting, so the entries after
that are ignored. Two policies should be established for the object type with revision
sequences defined as follows:
0,1,2,...
and
-,[A-H,J-N,P,R,T-W,Y]
After you define your revision sequence, simply insert it into the Sequence clause using
the following syntax:.
sequence REVISION_SEQUENCE
In this statement, when a file named “Proposed Solar Vehicle” is checked into an object of
type Proposal, it is named in the window as Proposal, “Proposed Solar Vehicle”,
Unrevised. After the first revision, the object is given a revision label of “1st Rev” (in
place of Unrevised). As it is further defined, Matrix will progress through the enumerated
sequence values until it reaches “4th Rev.” Since this sequence is non-repeating, no
further revisions are allowed.
Enforce Clause The enforce clause is optional and can be used to prevent one user from overwriting
changes to a file made by another user. When an object is governed by a policy that has
enforce locking turned on, the only time a user can check in files that replace existing files
is when:
• the object is locked
and
• the user performing the checkin is the locker
To ensure that the person who locked the object is the person who checked out the file,
enforce locking disables the manual lock function (lock businessobject
OBJECTID;). The only way to lock an object that is governed by a policy that enforces
locking is by locking it when checking out the file (for example: checkout bus
OBJECTID lock;).
Version 10 409
When checking in files that do not replace existing files (for example, if you check files
into a format that contains no files or you append files), as long as the object is unlocked,
you can check in new files. When an object is locked, no files can be checked into the
object until the lock is released, even if the file does not replace the checked-out file that
initiated the lock. This means that attempts to open for editing, as well as checkin, will
fail. Files can be checked out of a locked object and also opened for viewing.
Enforce locking ensures that when a user checks out a file and locks the object, signifying
that the user intends to edit the file, no other user can check in a file and overwrite the files
the original user is working on. When the original user checks the file back in, the user
should unlock the object.
Be aware that the manual unlock command (unlock businessobject
OBJECTID;) is available for users who have unlock access, but users should avoid using
the command for objects that have enforce locking. For example, suppose Janet checks
out a file and locks the object with the intention of editing the file and checking it back in.
Steve, who has unlock access, decides he needs to check in an additional file for the object
so he unlocks the object manually. When Janet attempts to check in her edited file,
replacing the original with her updated file, the system won’t allow her to because the
object isn’t locked. In order to check in the file, Janet has several options:
• she can check in the edited file in such a way that it won’t replace existing files; for
example, change the name of the edited file and append it or delete the original file
and check in the edited file
• she can check out the original file again and lock the object, taking care not to replace
the edited file on her hard drive with the older file she is checking out, and then check
in the edited file
For more information on unlock access, see Accesses in Chapter 10.
A user would end up in a situation similar to the one described above if the user forgets to
lock the object when checking out a file for editing. When the user attempts to check in the
edited file, the system won’t allow the checkin because the object is unlocked (or possibly
locked by another user who checked out the file after the first user).
For example, to enforce locking on the Proposals policy:
add policy “Proposals”
description “Process for generating, reviewing, and releasing proposals”
type Proposal, Plan
format ASCII, “BestWord”, Drawing
defaultformat “BestWord”
enforce;
The not enforce clause is available when modifying policies to turn the feature off.
State Clause The State clause of the Add Policy statement defines all information related to a policy
state including: who can access a business object, what type of access a user can have,
whether new revisions are allowed, and the conditions for changing from one state to
another. The State clause uses the following syntax:
state STATE_NAME [STATE_ITEM {,STATE_ITEM}]
STATE_NAME is the name of the state you are defining. All states must have a named
assigned. This name must be unique within the policy and should have meaning for both
you and the user. The state name is limited to 127 characters. For additional information,
refer to Business Object Name in Chapter 35.
check COMMAND
revision [true|false]
version [true|false]
promote [true|false]
icon FILENAME
checkouthistory [true|false]
When defining a policy, you must have at least one state defined. Within that state, you
must define some type of object access. All other information is optional. The sections
that follow describe these clauses and the arguments they use.
Action Subclause
The Action subclause of the State clause associates a program with the promotion of this
state. Once an object is promoted to this state, Matrix executes the program specified by
the clause. (Refer to the example on the next page.)
Although the Action subclause is optional, it is useful for executing procedures that might
notify non-Matrix users, generate reports, or place orders for equipment or services:
action PROGRAM
PROGRAM is the name of a program object, or method, that has been or will be defined by
the Business Administrator.
Version 10 411
Check Subclause
The Check subclause of the State clause associates a verification procedure with the
promotion of the object out of the state. The procedure is specified as a program which is
executed when a person tries to promote the object. When executed, the procedure returns
a true or false value. If the value is true, the object is promoted. If the value is false, the
promotion is denied. Refer also to Overview of Programs in Chapter 19.
Use the following syntax to write a Check subclause:
check PROGRAM
PROGRAM is the name of a program object, or method, that has been or will be defined by
the Business Administrator.
Notify Subclause
The Notify Subclause sends a message to selected users once a business object has entered
the state. The message might provide special instructions or notify users that an object is
ready for a particular action. The notification message is limited to 255 characters.
Use the following syntax to write an Notify subclause:
notify USER_NAME {,USER_NAME} message VALUE
Or:
notify signer message VALUE
Route Subclause
The Route subclause automatically reassigns ownership when an object enters a business
state. Since ownership implies greater access privileges and responsibility, changing
ownership can be an effective means of controlling an object. The Route subclause is also
used to notify the new owner of the reassignments. The route message is limited to 255
characters.
For example, assume you have a manual that was just completed by a writer. The manual
is promoted into a state called “Formatting and Editing” in which an editor takes charge of
the manual. The editor prepares the document for review and oversees any changes
required to prepare it for publication. Since the writer is no longer involved, you may want
to assign the manual’s ownership to the editor. While the editor might be among the users
notified that the manual is finished, the editor should receive special notification that the
manual now “belongs” to him/her. After the manual is published, you might again change
the ownership to that of the company librarian. When changes in ownership occur, the
new owner should be notified.
The Route subclause is an optional subclause that is very similar to the Notify subclause
(described in Notify Subclause.
route USER_NAME {,USER_NAME} message VALUE
USER_NAME is the name of a person, group, or role who will receive ownership of the
business object.
VALUE is the text of the message to be sent to the new owner(s)
For example, the following subclause notifies the editor that ownership of a manual was
transferred to him/her:
route Editor
message “Ownership of this manual has been transferred to you.”
Version 10 413
defined as any Matrix group, role, or person who is using the business object. In the
Public, Owner, and User subclauses, you are essentially defining the object access:
owner ACCESS_ITEM {,ACCESS_ITEM}
public ACCESS_ITEM {,ACCESS_ITEM}
user USER_NAME ACCESS_ITEM {,ACCESS_ITEM} [filter EXPRESSION]
Here a filter Expression is being applied to the User Access called “Training” in the
state “Started” of the policy named “Production1”.
Without the expression access filter, the selected access (read, modify and checkin)
would have been allowed:
• if context user belongs to the group “Training” and
• business object being accessed is in the state “Started”
With this feature, the selected access (read, modify, checkin) would only be allowed:
• if context user belongs to the group “Training” and
• the business object being accessed is in the state “Started” and
• if filter expression (attribute[Target Weight] == 35.2) is evaluated as true for the
business object being accessed.
Note that in this situation “Target Weight” is an attribute of the business object being
accessed. If the “Target Weight” attribute doesn’t exist for the business object being
accessed, the read, modify and checkin access would not be allowed for the context
user via this user access.
Since you must have at least read access to the business object in order to evaluate the
filter, normal access checks must be disabled while an access filter is being evaluated.
Version 10 415
Summary of Access Items
In this definition, each user has a different level of access. As defined in the Public
subclause, the public has checkout access only when an object is in this state. This is an
example of the inclusion method of defining access. While the keyword “none” is not
specified, it is implied and is used as the default value. Another example of the inclusion
method is seen in the User subclause. The “Product Group Supervisor” is assigned the
ability to reassign ownership and to promote the object to the next state. No other
privileges have been assigned. Now examine the Owner subclause. It shows an example
of the exclusion method for assigning access. The Owner is assigned all privileges and
then excluded from using the promote privilege. This means the Owner will not be able to
promote the object to the next state. That privilege is reserved for the supervisor.
When you define a state, you should define some access for one of the three access
categories. If you are unsure of what access to assign, use the Public subclause. This will
allow any user in the system to create, modify, and manipulate an object under the policy.
If you do not want the public to have complete access over an object you create, you
should include an Owner subclause in the state definition. Then you can restrict public
access while allowing the owner complete control. For example, the following allows the
public to create and read objects only, while the owner has complete access:
state Proposed
revision false
version true
public create, checkout
owner all
user “Product Group Supervisor” changeowner, promote
Signature Subclause
The Signature Subclause of the State clause specifies who can control the promotion or
rejection of a business object. When an object is promoted, it moves to the next defined
state and is subject to the access rules associated with that state. When an object is
rejected, it remains in the current state until it meets the criteria for promotion.
The Signature subclause has the syntax:
signature SIGN_NAME [SIGNATURE_ITEM {,SIGNATURE_ITEM}
SIGN_NAME identifies the type of signature. Try to use a name that identifies what the
signature represents. For example, the signature might represent initial acceptance,
completion, or final sign-off. Each of these terms could be used for a SIGN_NAME. The
signature name is limited to 127 characters. For additional information, refer to Business
Object Name in Chapter 35.
SIGNATURE_ITEM identifies the type of state change that will occur when a group, role,
or person signs off on an object. Use any of the following:
approve USER_NAME {,USER_NAME} Specifies that the object may be promoted to the next state.
reject USER_NAME {,USER_NAME} Specifies that the object must remain in the current state until it meets with the
approval of the user.
ignore USER_NAME {,USER_NAME} Enables you to override the approval or rejection of the object. When ignore is
specified, the named user can sign in the place of others. This might be useful
to allow a senior manager the ability to sign off for a lower manager.
branch STATE_NAME Specifies what the next state will be after a signature is applied.
filter EXPRESSION Enables filtering to ensure that the promotion of an object meets certain
criteria.
which is a select field that means the signature has been approved, ignored, or overridden.
When you specify a filter, this default rule is replaced.
Approval can become dependent on any selectable field of the business object. This
includes attributes as well as states and other signatures. The real power of filters comes
Version 10 417
from the use of combinatorial logic using and’s and or’s between state information and
business object information.
For help formatting the expressions that can be entered into the Filter area, see Appendix
A, Select Expressions in the Matrix Navigator Guide.
USER_NAME is any previously defined name of a Matrix association, group, role, or
person. If the name you give is not defined, an error message will result. If you are unsure
of a user name, remember that you can obtain a complete listing of all of the user names
by entering the MQL List User statement.
For example, assume you have a state where objects are started and worked on prior to
general review. While the object is in this state, you may want two types of signatures: one
to indicate that the project is complete and another to indicate acceptance. This state
definition might appear as:
state started
revision false
public all, notenable, notdisable, notoverride
owner all, notenable, notdisable, notoverride
user Manager override
signature Complete
approve Writer
reject Writer
ignore Manager
signature Accepted
approve Manager
reject Manager
ignore “Senior Manager”
When including an Ignore Signature item in a state definition, you should not confuse this
with the override privilege. The Override privilege allows you to promote an object
without any signatures at all. The Ignore Signature item assumes that a signature is
required for object promotion. It simply allows the specified person to provide that
required signature.
When a signature has been approved, it can subsequently be rejected. But when a
signature has been rejected, ignore cannot subsequently be used to satisfy the signature.
Trigger Subclause
Event Triggers allow the execution of a Program object to be associated with the
occurrence of an event. The following lifecycle events support Triggers:
For example, when a state was scheduled, each successive state could be scheduled
automatically by a specified offset value. These transactions are written into program
objects which are then called by the trigger.
State Triggers use the following syntax:
trigger EVENT_TYPE TRIGGER_TYPE PROG_NAME [input ARG_STRING];
Refer to Designing Triggers in the Matrix PLM Platform Programming Guide, for more
information on designing Triggers.
Revision Subclause
The Revision subclause of the State clause specifies whether or not revisions of the object
are allowed while the object is in this state.
This subclause uses two arguments: true and false.
revision [true|false]
When the revision argument is set to true, revisions of the object are allowed. If the
revision argument is set to false, no revisions are allowed.
For example, the following Revision subclause prohibits the creation of a new revision
while the object is in this state:.
state “Tax Return Completed”
revision false
public none, read
owner none, read, demote
user Manager none, read, promote
Version 10 419
In this example, you have a state for completed tax forms. In this state, you do not want
anyone to revise the objects containing the finished tax returns. If further modification is
required, a change in state must occur. The owner can demote the object to its former state
to make changes and the manager can promote the object into the audit state.
The Revision subclause is optional. Matrix will assume that revisions are allowed if no
subclause or argument is used. Use the false keyword to turn off the ability to create
revisions.
Version Subclause
The Version subclause of the State clause indicates whether or not any file can be checked
in while the object is in the state.
Like the Revision subclause described above, this subclause uses two arguments: true and
false.
version [true|false]
When the version argument is set to true, files can be checked in. If the argument is set
to false, no new files are allowed.
In the following state definition, the Customer or the builder/owner can check in files (that
might contain room layouts, exterior views, or electrical plans, for example).
state “House Design Phase”
revision false
version true
public none, read
owner all
user Customer none, read, checkin, modify
The Version subclause is optional. Matrix assumes files can be checked into the object
while the object is in the state if no subclause or argument is used. Use the false
keyword to turn off the ability to check in files.
Promote Subclause
The Promote subclause of the State clause specifies whether or not Matrix will
automatically test the business object for promotion.
This subclause uses two arguments: true and false.
promote [true|false]
If the keyword true is used and all signature and check requirements are satisfied,
Matrix will promote the business object automatically. The Promote subclause is optional.
Matrix will assume that promotions are not automatic if no subclause or argument is used.
Use the false keyword to turn auto-promotion off.
Icon Subclause
The Icon Subclause of the State clause associates a special icon with a state. While this
subclause is optional, it can assist a user in identifying a policy state. The user could tell at
a glance which state the object is in when viewing the object’s lifecycle in a window.
Store Clause The Store Clause of the Add Policy statement identifies where files checked in under the
policy are stored. All files must be stored as ingested, captured, or tracked files. (For more
information on file stores, see Store Defined in Chapter 5.) If you intend to associate files
with business objects that are governed by the policy, you must include a Store clause in
the policy definition:
store STORE_NAME
STORE_NAME is the name of a previously defined file store. If the name you provide is
not defined, an error message will result.
For example, assume you have a policy for proposing and presenting drawings for review.
These drawings may be of various types and formats. However, all information about the
drawings can be contained in one file store. This file store identifies how the drawing files
are managed and where they are stored. If you were to examine this policy, it might appear
similar to the following:
add policy “Proposed Drawings”
description “Policy for Drawing Proposal and Presentation”
type Drawing, Layout, Schematic, Sheet
format Cadra-III, Rosetta-preView, CCITT-IV
defaultformat Cadra-III
sequence “A,B,C,...”
store Drawings
state planned
public all
owner all
state started
public all, notenable, notdisable, notoverride
owner all, notenable, notdisable, notoverride
user Employee enable, disable
user Manager override
signature Complete
approve Manager
reject Employee
ignore Designer
signature Accepted
approve Manager
reject Manager
ignore Manager
state presented
public all, notdelete
owner all;
Version 10 421
In this example, the policy governs four types of business objects and uses three different
file formats. However, when a file is checked into a business object governed by this
policy, that file is managed and stored according to the definition of the Drawings file
store.
MQL users and programmers may override the store specified in the policy, by including
the store in the checkin command.
For information on changing the store for a policy, see Modifying a Policy Definition.
Hidden Clause You can specify that the new policy is “hidden” so that it does not appear in the Policy
chooser in Matrix. You may want to use the hidden option if, for example, an object is
under development or if it is intended only for your personal use. Users who are aware of
the hidden policy’s existence can enter its name manually where appropriate. Hidden
objects are also accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the policy. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add policy NAME
property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Copying (Cloning) After a policy is defined, you can clone the definition with the Copy Policy statement.
a Policy Definition This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy policy SRC_NAME DST_NAME [MOD_ITEM] {,MOD_ITEM};
Modifying a Policy After a policy is defined, you can change the definition with the Modify Policy statement.
Definition This statement lets you add or remove defining clauses and change the value of clause
arguments:
modify policy NAME [MOD_ITEM] {MOD_ITEM};
Version 10 423
Modify Policy Clause Specifies that…
add state STATE_NAME [before The named state is added to the policy with the state definitions listed. If
STATE_NAME] [STATE_ITEM you do not want the new state added after the existing states, you must
{,STATE_ITEM}] specify which existing state the new state should precede.
If a state is added to an existing policy which already governs objects, all
object instances will be affected.
If an object is in a state that precedes the new state, a state is added, as
desired, in the object’s lifecycle. However, if the object’s current state is
beyond where the new state is added, the object will never reach that
state except through demotion. In some cases, this is not a concern; but,
states should be added to existing policies with care.
remove state STATE_NAME The named state is removed from the policy if there is at least one state
remaining after the removal. Removing a state from a policy that is
governing objects is not recommended.
An alternate approach is to clone the policy and then remove the state
from the clone. There is the notion that “from this point on” the policy
will control these types of objects. New objects should use the new
policy and older objects can change to the new policy, if desired.
name VALUE The current state name is changed to that of the new name.
sequence REVISION_SEQUENCE The revision sequence is changed to the sequence entered.
state STATE_NAME [STATE_MOD_ITEM The named state is changed according to the state modification clauses
{STATE_MOD_ITEM}] entered.
store STORE_NAME The file store is changed to use the file store named.
Keep in mind that if you change the store for a policy, files that are
already checked into objects governed by the policy will still reside in
the old store. If these objects are revised or cloned, the new revision/
clone references the original file in its storage location and thus the clone
or revision will be placed in the old storage location. When the time
comes for the file reference to become an actual file (as when the file list
changes between the 2 objects) the file copy is made in the same store
the original file is located in.
However any new files that are checked in will be placed in the new
store. For more details, see the Implications of Changing Stores in
Chapter 6.
checkouthistory true The generation of history information on the checkout event is enabled.
checkouthistory false The generation of history information on the checkout event is disabled.
hidden The hidden option is changed to specify that the object is hidden.
nothidden The hidden option is changed to specify that the object is not hidden.
property NAME [to ADMINTYPE The named property is modified.
NAME] [value STRING]
add property NAME [to ADMINTYPE The named property is added.
NAME] [value STRING]
remove property NAME [to The named property is removed.
ADMINTYPE NAME] [value STRING]
Each modification clause is related to the clauses and arguments that define the policy. For
example, assume you want to modify the policy for proposing, presenting, and releasing
drawings. It has been decided to use the policy for only CAD drawings while a new policy
is defined for handling non-CAD drawings. To customize the existing policy for CAD
These changes leave only the states to be modified. But how is that done? Just as the
Modify Policy clauses resemble the Add Policy clauses, the subclauses that modify states
resemble those that define them. These are described in the following sections.
Modifying Policy The following subclauses are available to modify the existing states in a policy:
States
Version 10 425
Modify Policy State Subclause Specifies that…
revision false Revisions are not allowed in this state.
add route USER_NAME {,USER_NAME} The user(s) listed is/are added to those who will receive ownership of the
[message VALUE] business object when the object is promoted to this state. If a message
value is entered, the message changes to the new value.
remove route USER_NAME The user(s) listed is/are removed from the list of users who receive
{,USER_NAME} ownership of the object when it is promoted to this state.
route message VALUE The message sent to users who receive ownership of the business object
when the object is promoted to this state changes to the value entered.
add signature SIGN_NAME The name(s) listed can promote, reject, or ignore the business object.
[SIGNATURE_ITEM
{,SIGNATURE_ITEM}]
remove signature SIGN_NAME The entered signature is removed from the list of signatures required to
alter the object’s state.
signature SIGN_NAME The named signature is modified according to the modification clause(s)
[SIGNATURE_MOD_ITEM listed.
{SIGNATURE_MOD_ITEM}]
add trigger EVENT_TYPE The specified trigger is added or modified for the listed event.
TRIGGER_TYPE PROG_NAME
remove trigger EVENT_TYPE The specified trigger type is removed from the listed event.
TRIGGER_TYPE
add user USER_NAME ACCESS_ITEM One or more access items are added to the user access list. This list
{,ACCESS_ITEM} specifies the access privileges the named user has when the governed
object is in this state.
remove user USER_NAME The listed access item(s) is/are removed from the named user’s access
ACCESS_ITEM {,ACCESS_ITEM} list.
version true New versions are allowed in this state.
version false New versions are not allowed in this state.
When modifying the states of a policy, the state modification clauses are similar to those
used to define states. For example, assume you had the following state definition:
state “In Progress”
revision false
version true
public all
owner all
Now you want to have a Manager oversee the work in progress. Rather than let the owner
or public promote the object into the next state, you want to give that privilege to the
Manager only. To make these changes, you might write a statement such as:
modify policy “Manual Release”
state “In Progress”
add public notenable, notdisable, notoverride, notpromote
add owner notenable, notdisable, notoverride, notpromote
add user Manager promote, enable, disable, override;
Modifying If you want to alter the signature requirements within a state, you must use a Signature
Signature subclause within the State subclause:
Requirements signature SIGN_NAME [SIGNATURE_MOD_ITEM {SIGNATURE_MOD_ITEM}]
Version 10 427
Now you want to allow the editor to approve or reject the object. You also want to add a
second signature that shows the manual has been accepted by the editor. To make these
changes, you could write a Modify Policy statement similar to the following:
modify policy “Manual Release” state “In Progress”
signature Complete
add approve Editor
add reject Editor
signature Accepted
add approve Editor
add reject Editor
add ignore Manager;
If you decide that a policy is no longer required, you may delete it by using the Delete
Policy statement:
delete policy NAME;
NAME is the name of the policy to be deleted. If the name is not found, an error message
will result.
When this statement is processed, Matrix searches the list of policies. If the name is found,
that policy is deleted IF there are no objects that use the policy. If there are objects that use
the policy, they must be reassigned or deleted before the policy can be removed from the
policy list.
For example, you might enter this statement to delete the policy named “Performance and
Salary Review:”
delete policy “Performance and Salary Review”;
Version 10 429
430 MQL Guide
18
Working With
Business Wizards
Overview of Business Wizards.................................................................... 432
What is a Frame? ........................................................................................... 432
What is a Widget?........................................................................................... 433
Runtime Program Environment ...................................................................... 434
Using ${} Macros ............................................................................................ 435
Planning the Wizard........................................................................................ 435
Creating a Business Wizard ........................................................................ 436
Code Clause ................................................................................................... 436
Description Clause.......................................................................................... 437
Wizard Program Type (External or MQL) ....................................................... 437
File Clause...................................................................................................... 437
Icon Clause..................................................................................................... 437
Needs Business Object Clause ...................................................................... 437
Downloadable Clause..................................................................................... 438
Execute Clause............................................................................................... 438
Hidden Clause ................................................................................................ 439
Property Clause .............................................................................................. 439
Frame Clause ................................................................................................. 439
Programming Business Wizards................................................................. 450
Strategy for Creating Business Wizards ......................................................... 450
Program Environment Variables..................................................................... 451
Loading Complex Widgets.............................................................................. 454
Using Spaces in Strings.................................................................................. 454
Using ${} Macros ............................................................................................ 454
Using Eval Statements ................................................................................... 457
MQL Download/Upload Commands............................................................ 458
Download Command ...................................................................................... 458
Upload Command........................................................................................... 458
Upload Command vs. Widget Upload Option ................................................. 459
Running/Testing the Business Wizard ....................................................... 461
.Command Line Interface ............................................................................... 461
Matrix Interface ............................................................................................... 461
Invoking a Wizard from a Program ................................................................. 462
Copying and/or Modifying a Business Wizard Definition ......................... 464
Copying (Cloning) a Wizard Definition............................................................ 464
Modifying a Wizard Definition ......................................................................... 464
Modifying Wizard Frames ............................................................................... 465
Modifying Widgets .......................................................................................... 466
Deleting a Business Wizard......................................................................... 467
Version 10 431
432 MQL Guide
Overview of Business Wizards
Business Wizards allow you to create a user interface to simplify repetitive tasks
performed by Matrix users.
A wizard is a program which asks the user questions and executes a task based on the
information received. It consists of a one or more dialog boxes, called frames, which are
presented sequentially to the user. Generally, each frame provides some explanation or
asks a question, then requires that the user either type a response or make a choice from a
list. When all information has been collected, the wizard program performs an action
based on the information.
When you create a Business Wizard, you choose the number of frames and define the
contents of each frame, customizing the wizard for a specific purpose relating to your
database.
Suppose, for example, that a number of users are required to check reports into the
database on a weekly basis. A wizard could ensure that reports are named according to a
standard report naming convention, prevent the accidental replacement of existing files,
and track which users have submitted a report, even sending IconMail or email to the
manager who reads the reports to advise that the reports have been checked in.
A wizard is a type of Program object. This means that a wizard can be launched most of
the places that a Program can be launched, for example, stand-alone, or as a method.
However, due to the graphical nature of wizards, they cannot be executed using MQL.
Wizards are composed of frames. Each frame contains one or more widgets. Each term is
explained in detail below.
What is a Frame? A frame is a dialog box that contains instructions and/or asks for information from the
user. The information gathered in one frame can be checked for correctness before moving
to the next frame and will often dictate the choices loaded into the next frame.
Frames are designed by the Business Administrator using a layout editor. The basic layout
of a frame consists of a fixed title in the title bar at the top, a fixed set of three active
command buttons along the bottom, and a dynamic region (sub-frame) in the middle. Only
the dynamic region can change from one frame to the next.
In order to be effective, a wizard should gather information over a series of simple steps
with each step responsible for a single piece of information. This allows for focused
activity during each frame and eliminates the need for large complex dialogs.
The frame-specific dynamic region typically has a multiple-line text box near the top that
describes the step being performed. The rest of the region is set up to gather the
information needed for the step to be completed. The region is called “dynamic” because
choices provided in the region can be filled during run time.
Version 10 433
The following shows a frame whose dynamic region contains a multiple-line textbox
which explains the format for the name of a report. It also provides an input field where
the user can type the report name:
.
Title bar
Dynamic region
Command buttons
For most frames, three command buttons are available: Back, Next, and Cancel. After
providing information or making a selection, the user clicks the Next button to proceed to
the next frame. Clicking the Back button returns to the previous frame, where changes can
be made to the information supplied. Clicking the Cancel button exits the wizard. The
first frame of any wizard has a deactivated (grayed-out) Back button. The final frame of
the sequence has a Finish button in the place of the Next button. When a user selects the
Finish button in the final frame, the task is carried out by executing the code associated
with the Business Wizard. A single optional status frame may be used to return feedback
to the user about the task just performed (or provide the reason for the task not being
performed).
What is a Widget? Anything that is included in the dynamic region of a frame is called a widget. The designer
of the wizard chooses how many and what types of widgets will be included in each
frame.
A frame can include any number of widgets, but it is most effective to limit their numbers
in order to reduce the complexity of each frame.
There are ten different types of widgets. The following tables lists the widget types, which
are explained in more detail in Widget Subclause.
Widget Description
label a non-editable text field
command button a button which, when clicked, executes a program
text box a text field, which can be defined to be either editable or non-editable
image a picture file containing a GIF image
list box a list of items from which a single or multiple selections can be made
combo box a combination of an editable text box and a list box—users can type their choice or select from the
list
radio button a group of one or more mutually exclusive options, each with a circle beside it; only one can be
selected
check box a group of one or more options, each with a check box beside it; multiple options can be selected
Runtime Program Business Wizards require a mechanism for passing information between the Program
Environment objects that can be used within the wizard. The Runtime Program Environment (RPE) is
provided to hold program environment variables. The RPE, which is a dynamic heap in
memory that is used to hold name/value pairs of strings, makes it possible to pass
parameters between internal programs and scripts.
For Business Wizards, the RPE allows information to be passed between frames, between
programs that control the individual widgets, and to the wizard program that processes the
information gathered from the user. For example, after all data-gathering frames have
been displayed, you may want to present a summary frame where the user can check for
errors. Also, if the user clicks the Back button, you would want the frames to display just
as they did when the user clicked the Next button, including the choices the user made.
See Runtime Program Environment for additional information on the RPE.
Note that all of the programs listed above (except for the actual wizard code) must be
defined as independent program objects before they can be used by a Business Wizard.
You can edit existing programs while defining a wizard but you cannot create a new
program object while editing a wizard.
Version 10 435
Business wizard internal programs should not launch external applications, such as a
word processing program. Attempts to do so will cause unexpected results, including
crashing the wizard.
Using ${} Macros Macros provide a relatively easy way to work with variables. The main limitation to
macros however is that they are available only for the program that calls them. When
working with nested programs, the RPE enables you to pass values between programs.
${} macros are placed into the RPE so that they can be used by nested programs. Just
remember to drop the “${}” characters when referencing the macro variable in the RPE.
Macros that are specific to Business Wizards are shown in the Macros Appendix in the
Matrix PLM Platform Programming Guide.
Planning the Before you start creating a Business Wizard, you should plan what the wizard will
Wizard accomplish and how you want it to look.
• Decide which task(s) the Business Wizard will perform, for example, checking in a
report.
• Determine what information is needed to perform the task, for example, user name,
department name, report name, etc.
• Based on the amount of information that needs to be collected, decide how many
frames are needed and how each frame should look.
• Decide what platform from which users will be running the Wizard. The wizard
should be designed with the lowest screen resolution in mind and the Master Frame
should be sized to fit the screen. Also, if the wizard will be executed from the Web, it
is recommended that default fonts and colors are used. The font.properties file
located in the browser’s directory specifies what fonts are displayed, but this file is
generally used for specifying fonts for alternate character sets for Asian languages.
For more information on the font.properties file, and setting fonts on the web, see
http://java.sun.com/products/jdk/1.1/docs/guide/intl/fontprop.html. Also refer to
Programming for the Web in the Matrix PLM Platform Programming Guide.
Creating a Business Wizard involves setting up basic Wizard parameters, defining frames
and widgets (the components of frames), and specifying the underlying program code.
Wizards are defined using the Add Wizard statement:
add wizard NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the wizard you are creating. All wizards must have a name assigned.
When you create a wizard, you should assign a name that has meaning to both you and the
user. The wizard name is limited to 127 characters. For additional information, refer to
Business Object Name in Chapter 35.
ADD_ITEM is an Add Wizard clause which provides additional information about the
wizard. The Add Wizard clauses are:
code CODE
description VALUE
external|mql
file FILENAME
icon FILENAME
[!|not]needsbusinessobject
[!|not]downloadable
execute immediate|deferred
[!|not]hidden
All of these clauses are optional. You can define a wizard by simply assigning a name to
it. You will learn more about each Add Wizard clause in the sections that follow.
Code Clause The Code clause of the Add Wizard statement defines the commands for the wizard. The
code provides the instructions to act on the information collected from the user during the
execution of the frames belonging to the Business Wizard.
Include MQL/Tcl program commands if you specify MQL as the wizard program type.
If you specify external as the wizard program type, include the command necessary to
start the external program. Include path information, if necessary. For example:
c:\matrix\programs\buswiz3.exe
Because Business Wizards are made up of a number of programs, there must be a way to
pass information between the programs. The method used is the Runtime Program
Environment (RPE), a dynamic heap in memory that is used to hold name/value pairs of
strings. See the Runtime Program Environment section for additional information.
Version 10 437
Description The Description clause of the Add Wizard statement can provide general information
Clause about the purpose of the wizard. Since there may be subtle differences between wizards,
the Description clause enables you to point out these differences.
There is no limit to the number of characters you can include in the description. However,
keep in mind that the description is displayed when the mouse pointer stops over the
wizard in the Program chooser. Although you are not required to provide a description,
this information is helpful when a choice is requested.
Wizard Program You can specify the source of the code as MQL or external. An MQL program can be
Type (External or run from any machine with Matrix installed; it is not necessary for MQL to be available on
MQL) the machine.
add wizard NAME mql;
An external wizard program consists of commands in the command line syntax of the
machines from which they will be run. Since MQL can be launched from a command line,
MQL code could be specified in an external program. This would spawn a separate MQL
session that would run in the background. In this case, MQL would have to be installed on
every machine which will run the wizard.
add wizard NAME external;
File Clause Specify the file that contains the code for the wizard. The code provides the instructions to
act on the information collected from the user during the execution of the frames
belonging to the Business Wizard.
This is an alternative to use the Code clause to define commands for the wizard.
Icon Clause The Icon clause associates a special image with a wizard. When a user searches for a
wizard, the icon can help identify the object to select. You can assign a special icon to the
new wizard or use the default icon. The default icon is used when in view-by-icon mode.
Any special icon you assign is used when in view-by-image mode. When assigning a
unique icon, you must use a GIF image file. Refer to Icon Clause in Chapter 1 for a
complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Needs Business You can specify that the wizard must function with a business object. This selection
Object Clause assumes that you will be adding the Business Wizard to a business Type as a method.
For example, you would select this option if the wizard promotes a business object. If,
however, the wizard creates a business object, the wizard is independent of an existing
object and this option would not apply.
add wizard NAME needsbusinessobject;
Downloadable If the wizard includes code for operations that are not supported on the Web product (for
Clause example, Tk dialogs or reads/writes to a local file) you can include the downloadable
clause. If this is included, this program is downloaded to the web client for execution (as
opposed to running on the Collaboration Server). For wizards not run on the Web product,
this flag has no meaning.
add wizard NAME downloadable;
Execute Clause Use the execute clause to specify when the wizard should be executed. If the execute
clause is not used, immediate is assumed.
Immediate execution means that the program runs within the current transaction, and
therefore can influence the success or failure of the transaction, and that all the program’s
database updates are subject to the outcome of the transaction.
Deferred execution means that the program is cued up to begin execution only after the
outer-most transaction is successfully committed. A deferred program will not execute at
all if the outer transaction is aborted. A deferred program failure only affects the new
isolated transaction in which it is run (the original transaction from which the program
was launched will have already been successfully committed).
However, there are a number of cases where deferring execution of a program does not
make sense (like when it is used as a trigger check, for example). In these cases the system
will execute the program immediately, rather than deferring it until the transaction is
committed.
There are four cases where a program’s execution can be deferred:
• Stand-alone program
• Method
• Trigger action
• State action
There are six cases where deferred execution will be ignored:
• Trigger check
• Trigger override
• State check
• Range program
Version 10 439
• Wizard frame prologue/epilogue
• Wizard widget load/validate
There is one case where a program’s execution is always deferred:
• Format edit/view/print
A program downloaded to the web client for local execution (see Downloadable Clause)
can be run only in a deferred mode. Therefore, if you use the downloadable option, the
program is automatically deferred.
Hidden Clause You can specify that the new wizard is “hidden” so it does not appear in the Program or
Methods choosers in Matrix, which simplifies the end-user interface. A wizard can
contain a number of programs which are not intended to be executed as stand-alone
programs (such as the load and validate programs for widgets) and users should not be
able to view these program names in the Matrix Program chooser. Users who are aware of
a hidden program’s existence can enter its name manually where appropriate. Hidden
objects are also accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the wizard. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add wizard NAME
property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Frame Clause A Business Wizard is composed of one or more frames. Each frame is a window that
requests and stores information in order to complete a task. You can include any amount
of information in a frame, but in order to be effective, each frame should be responsible
for gathering a single piece of information, for example, a department name or the name
of an object in the database.
The Frame clause of the Add Wizard statement defines all information related to a wizard
frame including: units and color of the frame, prologue and epilogue programs, status, and
widget types. The Frame clause uses the following syntax:
frame FRAME_NAME [FRAME_ITEM {FRAME_ITEM}]
FRAME_NAME is the name of the frame you are defining. All frames must have a named
assigned. This name must be unique within the wizard and should have meaning for both
you and the user. The frame name is limited to 127 characters. For additional information,
Department Name
Get Codeword
Get Filename
Availability Choices
status [true|false]
icon FILENAME
The sections that follow describe these clauses and the arguments they use.
Units Subclause
The Units subclause of the Frame clause specifies the units of frame measurement. There
are three possible values: picas, points, or inches.
units picas
Or:
units points
Or:
units inches
Matrix will automatically assume a picas value if you do not use a Units clause.
Picas are the most common units of page measurement in the computer industry. Picas use
a fixed size for all characters. Determining the size of a field value is easy when using
picas as the measurement unit. Simply determine the maximum number of characters that
will be used to contain the largest field value. Use that value as your field size. For
example, if the largest field value will be a six digit number, you need a field size of six
picas. This is not true when using points.
Points are standard units used in the graphics and printing industry. A point is equal to 1/
72 of an inch or 72 points to the inch. Points are commonly associated with fonts whose
print size and spacing varies from character to character. Unless you are accustomed to
working with points, measuring with points can be confusing and complicated. For
example, the character “I” may not occupy the same amount of space as the characters “E”
or “O.” To determine the maximum field size, you need to know the maximum number of
characters that will be used and the maximum amount of space required to express the
largest character. Multiply these two numbers to determine your field size value.
Version 10 441
Inches are common English units of measurement. While you can use inches as your unit
of measurement, be aware that field placement can be difficult to determine and specify.
Each field is composed of character string values. How many inches does each character
need or use? If the value is a four-digit number, how many inches wide must the field be to
contain the value? How many of these fields can you fit on a frame? Considering the
problems involved in answering these questions, you can see why picas are a favorite
measuring unit.
When planning the wizard, consider the operating systems of the those who will use the
wizard. The wizard should be designed with the lowest screen resolution in mind and the
Master Frame should be sized to fit the screen.
Color Subclause
The Color subclause of the Frame clause specifies color values used as the default
foreground and background for the frame.
color [FOREGROUND] [on BACKGROUND]
FOREGROUND is the name of the color for the foreground printed information (any
vertical or horizontal lines of information).
BACKGROUND is the name of the color used as an overall background for the frame. Note
that the word on is required only if a background color is specified.
For a list of available colors, refer to:
• Windows— \$MATRIXHOME\lib\winnt\rgb.txt.
• UNIX— /$MATRIXHOME/lib/ARCH/rgb.txt.
$MATRIXHOME is where the Matrix application is installed.
ARCH is the UNIX platform.
Size Subclause
The Size subclause of the Frame clause defines the dimensions of the frame. A frame can
be any size.
To define a frame size, you need two numeric values. One represents the width
(COL_SIZE) and one represents the length (ROW_SIZE). Both of these values must be
provided and entered according to the following syntax:
size ROW_SIZE COL_SIZE
The values reflect the Units value defined for the frame (picas, points, or inches). For
example, for an 7 by 5 inch frame, the following are equal:
size 66 30 Measured in picas.
When selecting a frame size, keep in mind the monitor sizes of the users who will be
running the wizard. For example, a wizard frame does not display the same amount of
information on a screen with a resolution of 640x480 as it does on a screen with a
resolution of 1280x1024. Use the lowest common denominator of screen resolution to
design wizards and the master frame should be fit to size.
ARG_STRING defines arguments to be passed into the program. The arguments can be
referenced by variables within the program. Variables 0, 1, 2… etc. are reserved by the
system for passing in arguments.
• Environment variable “0” always holds the program name and is set automatically by
the system.
• Arguments from ARG_STRING are set in environment variables “1”, “2”,… etc.
See Runtime Program Environment for additional information on program environment
variables.
One common use of the prologue program is to skip a frame within a wizard. If a frame’s
prologue exits with a non-zero return code, that frame will be skipped. This works either
going forward or backward within a wizard. In the following example, the user is looking
at Frame C and tries to click the Back button. You don’t want the user to be able to go
back to Frame B until certain information has been filled in on Frame C.
To accomplish this, you could include the following code in the prologue for all frames
before Frame C (in this case, Frame B and Frame A, since you don’t want to go back to
either).
tcl;
eval {
set sFrameMotion [string toupper [ mql get env FRAMEMOTION ] ]
if { $sFrameMotion == "BACK" } {
set iExitCode 1
} else {
set iExitCode 0
}
exit $iExitCode
}
Since a frame’s prologue is executed before the frame displays, if it returns an exit code of
1, the frame is skipped. In this case, the user would continue to see Frame C.
Version 10 443
Epilogue Subclause
The frame’s epilogue is a program which is executed whenever a frame is closed. The
epilogue program can be used to undo what the prologue program did, and perform any
other cleanup activity. Since data is passed between frames using RPE, you can use the
epilogue program to clean up widget variables before moving on to the next frame.
If an epilogue program returns non-zero after pressing the Next button, the current frame
is redisplayed. Thus, even if all of the widget validate programs return zero, the epilogue
program can still keep the next frame from appearing. Although the epilogue program
runs when the Back button is pressed, the return code is not checked.
When the epilogue program for the last frame in the frame sequence has been executed,
programmatic control of the wizard is then handled by the wizard code, defined on the
Code tab of the Business Wizard. SeeCode Clause for additional information.
The following syntax is used:
epilogue PROG_NAME [input ARG_STRING]
ARG_STRING defines arguments to be passed into the program. The arguments are
referenced by variables within the program. Variables 0, 1, 2… etc. are reserved by the
system for passing in arguments.
• Environment variable “0” always holds the program name and is set automatically by
the system.
• Arguments from ARG_STRING are set in environment variables “1”, “2”,… etc.
See Runtime Program Environment for additional information on program environment
variables.
Status Subclause
Each wizard can have an optional status frame, which is generated after the user has
clicked the Finish button and the Business Wizard code has been executed. This option
can be applied to the last frame of the sequence only.
The status frame returns feedback to the user about the task just performed or provides the
reason why the task was not performed. The status frame contains a single Close button in
place of the three regular frame buttons (Back, Next, Cancel). The dynamic region would
typically contain only a multiline text box, though it could also contain image or label
widgets.
Status frame processing includes executing the prologue and the load programs, but no
input from the user is accepted or processed. The status frame programs should not
perform any database operations.
The status subclause uses two arguments: true and false:
status [true|false]
When the status argument is set to true, the frame is used as a status frame. If the status
argument is set to false (this is the default), no status frame is generated at the
conclusion of the Business Wizard.
Widget Subclause
The term widget refers to any component of the frame. The Widget subclause of the Frame
clause uses the following syntax:
widget WIDGET_TYPE WIDGET_ITEM {WIDGET_ITEM}
WIDGET_TYPE refers to one of ten types of fields that make up the dynamic region of the
frame. Widget types include the following:
font FONT_NAME
Version 10 445
autoheight [false|true]
autowidth [false|true]
drawborder [false|true]
multiline [false|true]
edit [false|true]
scroll [false|true]
password [false|true]
upload [false|true]
Value Subclause
The Value subclause of the Widget subclause identifies the contents of the widget. The
Value subclause has the following syntax:
value VALUE [selected value|input ARG_STRING]
For all widgets except the image and command button widget types, VALUE specifies the
text that will be included in the widget, for example, the string of characters to be included
as a label. For textbox or listbox widgets, VALUE is the default text that is included in the
box. For combobox, checkbox, or radiobutton, VALUE is the text included in the group.
Several widgets need two pieces of information: a list of choices and one or more
selections. Selected value is an optional argument which identifies the item you
want selected or highlighted. For example, if you have a radio group that contains the days
of the week and you want “Wednesday” to be selected by default, use the following
syntax:
value Monday Tuesday Wednesday Thursday Friday selected value Wednesday
For the image widget type, VALUE is the name of the .gif file used to represent the image.
For example:
value hands.gif
Load Subclause
The load program, if defined, contains code to load values into the widget field. Load is
an option for all widgets except for label and image. The load program can also be used to
define alternate values for the widget depending on the context, information gathered in a
prior frame, etc. The following syntax is used:
load PROG_NAME [input ARG_STRING]
ARG_STRING defines arguments to be passed into the program. The arguments are
referenced by variables within the program. Variables 0, 1, 2… etc. are reserved by the
system for passing in arguments.
• Environment variable “0” always holds the program name and is set automatically by
the system.
• Environment variable “1” always holds the widget name and is also set automatically
by the system.
• Arguments from the Input field are set in environment variables “2”, “3”,… etc.
If a command button program returns non-zero, the frame is refreshed. This means that all
widgets in the frame will have their load program run. This allows a command button
program to modify variables in the RPE and then force the widgets in the current frame to
reload themselves.
Validate Subclause
Validate programs check if the values added by the user (to an input field, for example)
are within an acceptable range of parameters. Validate is an option for all widgets
except for label and image.
The validate program, if defined, is used to test the validity of the widget's state. By
returning a non-zero value, the validate program causes the system to redisplay the frame
and place focus on the offending widget. It is good style to have the validate program
additionally display a message box that explains the error.
Validate programs are normally used for editable text box widgets and combo box
widgets.
Note that the validate program does not execute when the user clicks the Back button.
ARG_STRING defines arguments to be passed into the program. The arguments are
referenced by variables within the program. Variables 0, 1, 2… etc. are reserved by the
system for passing in arguments.
• Environment variable “0” always holds the program name and is set automatically by
the system.
• Environment variable “1” always holds the widget name and is also set automatically
by the system.
• Arguments from the Input field are set in environment variables “2”, “3”,… etc.
Version 10 447
Observer Subclause
The Observer subclause of the Widget subclause defines a program to be executed when
the user makes a selection from a wizard list box, check box, or radio button.
The following syntax is used:
observer PROG_NAME [input ARG_STRING]
ARG_STRING defines arguments to be passed into the program. The arguments are
referenced by variables within the program. Variables 0, 1, 2… etc. are reserved by the
system for passing in arguments.
• Environment variable “0” always holds the program name and is set automatically by
the system.
• Arguments from ARG_STRING are set in environment variables “1”, “2”,… etc.
See Runtime Program Environment for additional information on program environment
variables.
For example, the selection of Type “Part” from the ListBox1 calls an observer program
that populates the Business Objects in ListBox2, as illustrated below.
ListBox1 ListBox2
The observer program has all the side effects of clicking a button within a wizard; that is,
it is executed immediately and if it exits with a return code of 1, each of the widgets in the
current frame has its values (re)read and (re)populated by the RPE variables associated
with the frame. The INVOCATION macro is populated with the value “observer.” If the
widget was a multi-selection list box, then mql get env <widget name> returns a
space-delimited string containing current values.
Performance is an important consideration. When calling an observer program, every
widget on a frame is examined to get the current value of that widget. For a frame with
many widgets, this could be time consuming. Also, since the observer program is actually
run on the server, there is lag time associated with the round trip from client to server and
back. The developer of an observer program needs to evaluate whether the time it takes for
the observer program to complete is acceptable for a user to wait.
Color Subclause
The Color subclause of the Widget subclause specifies color values used as the default
foreground and background for the widget.
color [FOREGROUND] [on BACKGROUND]
FOREGROUND is the name of the color for the foreground printed information (any
vertical or horizontal lines of information).
BACKGROUND is the name of the color used as an overall background for the widget. Note
that the word on is required only if a background color is specified.
Start Subclause
The Start subclause of the Widget subclause is used to define the placement of the widget
in the frame. The syntax is:
widget WIDGET_TYPE start XSTART YSTART
The XSTART (horizontal) and YSTART (vertical) coordinates identify the widget’s
starting point—where the first character of the field value is displayed. For example, to
place a label widget in the upper left corner of the frame, the starting position would be 0,
0:
widget label start 0 0
Size Subclause
The Size subclause of the Widget subclause is used to define the size of the widget.
Specify height and width values to define the widget size. The syntax is:
widget WIDGET_TYPE size WIDTH HEIGHT
The widget’s size is dependent on the Units (picas, points or inches) specified for the
widget. The width value defines the horizontal size of the widget. The height value
defines the vertical size of the widget. For example, to define a textbox widget 12 picas
long by 3 picas high, use:
widget textbox units picas size 12 3
Font Subclause
Use the Font subclause to specify the font in which the text of a widget field appears. This
option is available for all widget types except for the image widget. The syntax is:
widget WIDGET_TYPE font FONT_NAME
Although it is possible to change the fonts used in wizards, it is best to let a wizard use the
default font and colors which have been set up by the end user, particularly if they will be
used across the Web (for example, in using wizards with Info Central). See the discussion
Wizard Fonts on the Web in the Business Modeler Guide.
Drawborder Subclause
Use the drawborder subclause to include a border around the field. This option is
available for the text box, image, check box, radio button, file text box, and directory text
box widget types. The syntax is:
widget WIDGET_TYPE drawborder [false|true]
Version 10 449
Multiline Subclause
Use the multiline subclause to have text displayed on more than one line in a text box
or to allow more than one choice to be selected in a list box. The syntax is:
widget WIDGET_TYPE multiline [false|true]
Edit Subclause
Use the edit subclause to allow the user to change the value while viewing the frame.
This option is available only for the text box widget type. The syntax is:
widget WIDGET_TYPE edit [false|true]
Scroll Subclause
Use the scroll subclause to have scroll bars displayed so that the user can scroll text up
and down. This option is available only for the text box widget type. The syntax is:
widget WIDGET_TYPE scroll [false|true]
Password Subclause
Use the password subclause to have all text the user types into the field masked with the
asterisk character. This option is available only for the text box widget type. The syntax is:
widget WIDGET_TYPE password [false|true]
Upload Subclause
Use the upload subclause to allow the user to select a client-side file and copy it to the
server. This option is available only for the file text box widget type. See Upload
Command vs. Widget Upload Option for additional information. The syntax is:
widget WIDGET_TYPE upload [false|true]
In creating a Business wizard, you will need to write at least one program, which will
perform the database transaction(s) for which the wizard is created. You can also write
programs to control the loading of frames and widgets and to check the validity of widget
values.
Before you begin to create a Business wizard, you should be familiar with the information
contained in Overview of Programs in Chapter 19, including information about the
Runtime Program Environment (RPE).
As you plan the project, keep in mind that a wizard has three stages:
• Stage 1 — Information. This stage consists of a series of frames, which gather
information from the user. The information is stored in the RPE, which is used to pass
data between frames. No database updates should be performed during this stage.
This is important so that the Cancel function can work properly.
• Stage 2 — Database transaction. The wizard code, defined in the New Wizard dialog
box Code tab, is executed. This stage uses the information from Stage 1 to perform all
necessary database transactions. Results can be placed in the RPE for use by the
optional Status Frame.
• Stage 3 — Feedback. A single status frame is displayed to inform the user of the
status of the transaction performed by the wizard. This stage is optional. It is
important to note that this stage follows stage 2 and is not part of the sequence of
frames in Stage 1.
Start Done
...
1 2 3 N Code Status
...
Strategy for The following is one strategy that can be used in creating a Business wizard. The order of
Creating Business the steps can, of course, be changed according to your own programming style.
Wizards 1. Plan the project. Decide what questions you want to ask the user and what format
they will use to supply answers. Will they type in their answers, or choose from a list
or group? Input fields provide the most flexibility, but it is easier to control the user’s
choices and prevent errors by having them make a selection from a fixed number of
items.
Version 10 451
2. Design the wizard. Decide the number of frames and the layout of the widgets in
each frame. It is most effective to have each frame request a single piece of
information.
The frame sequence should only be used for the task of gathering information from
the user, deferring any database work until the internal code of the wizard is executed.
3. Design the master frame. Master frames allow you to easily create a polished look
for the Business wizard by making each frame the same size with the same color
scheme. You can also add widgets that you want to appear in each frame, for example
a logo or a horizontal rule. These default attributes can be overridden, as needed, on a
frame-by-frame basis.
4. Create the wizard, positioning widgets on the frames. As you add frames, they
inherit the characteristics of the master frame. If, however, you subsequently make
changes to the colors or the dimensions of the master frame, these changes will not be
reflected in any frames already added. Therefore, be sure to set up the master frame
before adding any new frames.
5. Write code to load and validate widgets, if the widgets require load or validate
programs.
6. Write code for prologue and epilogue programs, if frames require prologue or
epilogue programs.
7. Add program names (for load, validate, prologue, epilogue) on the Edit Widget and
Edit Frame dialog boxes of the Business wizard you created.
8. Write code to execute the task based on the information collected in the wizard.
Include the code on the New Wizard dialog box of the Business wizard.
Program Because business wizards are made up of a number of independent programs that may
Environment need to share data, there must be a way to pass information between the programs. The
Variables method used is the Runtime Program Environment (RPE), a dynamic heap in memory that
is used to hold name/value pairs of strings.
In using the RPE to pass data between program objects, careful attention must be paid to
the naming of program environment variables and to the cleaning up of these variables.
All data is passed in the form of strings. Here are some guidelines:
• The program name is automatically associated with a variable named “0”.
• The widget name is automatically associated with a variable named “1”.
• Program input parameters are named “1”, “2”, etc. except within a load or validate
program for a widget. Since the variable “1” is reserved for the widget name, program
input parameters are named starting with the number “2”.
• The calling program can manually place the expected local variables into the RPE
(using the naming scheme above) before executing the called program, or simply add
them to the end of the execute command; the system will automatically place them in
the RPE with the proper names.
• Programs should return their data in a variable with the name identified with the 1st
input parameter.
• Lists should be returned using a Tcl form (space separated, with curly braces used to
surround items that contain spaces or special characters).
Version 10 453
4. If the Back button is pressed, the current frame’s epilogue function is called
(performing any necessary cleanup), and steps 1 through 3 are repeated for the
previous frame.
5. If the Cancel button is pressed, the Business wizard immediately ends.
6. If the Next or Finish button is pressed, each widget (except Labels and Graphics)
belonging to the frame executes its validate function. After each save function is
executed, the exit code is checked and if it is non-zero, the frame remains displayed
and focus is placed on the offending widget. This should happen only with an editable
text box or combo box widget since all other widgets should provide the user only
with legal choices. The current frame’s epilogue function is called, and if there is a
next frame, steps 1 through 3 are repeated for that frame.
7. If the Finish button is pressed, then the body of the Business wizard code is executed.
If a status frame is defined, it is displayed after the code is executed and only steps 1
and 2 are performed (the user will need to press the Close button to remove the frame
from the screen –essentially step 5).
Frame Sequence
Start Done
Repeat Loads
Cmd Repeat
Update RPE Wait
Back Next/
Finish
Update RPE
Validates
0 1
Epilogue Epilogue 0
Loading Complex Several widgets need two pieces of information: a list of choices, and one or more
Widgets selections from the list. For example you might have a check box group with the choices
Weekdays, Saturday, and Sunday, and want the choice Weekdays to be selected
by default.
Choices and selections can be defined on the Edit Widget dialog box in the fields Choices
and Selected. List choices (and selections) in a single string with a space used as a
separator.
When using MQL, set the widget’s stored database value to the following:
VALUE Weekdays Saturday Sunday SELECTED Weekdays
As it reads from the database, the system will load choices into the widget until it finds
selected. It then assumes that the tokens that follow are default selections.
Another approach is to use a load program. By convention, the choices go into an RPE
variable whose name is the same as the load program (obtained through argument 0) and
the selections go into an RPE variable whose name is the same as the widget name
(obtained through argument 1). Remember that the widget variable in the RPE holds its
state, and the state of a complex widget is its current selections. So the load program has
identified the state of the widget by loading the variable associated with the argument 1.
Using Spaces in Lists of widget choices and selections are given in a single string with spaces used as
Strings separators. This means that any choice containing spaces should be quoted.
However, due to the extensive use of the Tcl language for manipulating lists, the Tcl
notation for lists is recognized by the system. Therefore curly braces can be used to quote
single list items. This is true for all arguments being passed into program objects and all
values returned by program objects. The system also does a better job of supporting nested
use of curly braces than it does with quote characters.
Using ${} Macros For compatibility, ${} macros continue to be supported. ${} macros are placed into the
RPE so that they can be used by nested programs. Just remember to drop the “${}”
characters when referencing the macro variable in the RPE.
Version 10 455
The following macros are used in wizards:
Macro Meaning
WIZARDNAME Name of the Business wizard.
FRAMENAME Name of the current frame.
FRAMENUMBER Number of the current frame in the frame sequence (excluding master and status frames). Frame
numbers begin with 1. The status frame returns a value of 0.
FRAMETOTAL Total number of frames in the frame sequence (excluding master and status frames).
Although the operating system determines the valid syntax of the commands, the typical
syntax used is:
command ${MACRO 1} ${MACRO 2} ...
Version 10 457
Using Eval You can wrap the code in an eval statement to prevent the Matrix output window from
Statements popping up. Placing tcl code in an eval statement causes output to be suppressed when
executed within Matrix.
The download and upload MQL commands are available for use in programs to be
executed by a Web client through a Collaboration Server. They allow client-side files and
directories to be manipulated by server-side programs (and vice versa). Generally the
download and upload commands would be used in conjunction with a wizard ‘file text
box’ widget. See Widget Subclause for details.
Download Use the download command to download files to the client that are created by wizards
Command on the server, or when a file resides on a server that must be processed by a client-side
program.
download sourcefile SOURCE targetfile TARGET [[!|not]delete] [[!|not]overwrite];
SOURCE specifies the directory path and filename of the file to be downloaded from the
server, relative to WORKSPACEPATH. Refer to Using ${} Macros for more information on
WORKSPACEPATH. Note that when used in a desktop environment, the file is moved from
one location to another on the same machine.
TARGET specifies the full path and filename on the client. If the specified directories do
not exist, Matrix will create them.
When delete is specified, the source file is deleted on the server after the download.
The default is TRUE.
When overwrite is specified, if TARGET filename already exists, the downloaded file
replaces it. The default is FALSE.
For example:
download sourcefile report.doc targetfile reports/report.doc !delete overwrite;
Upload Command Use the upload command when a file resides on a client and must be processed by a
server side program. Refer Upload Command vs. Widget Upload Option for more
information.
upload sourcefile SOURCE targetfile TARGET [[!|not]delete] [[!|not]overwrite];
SOURCE specifies the full path and name of the file to be uploaded from the client.
TARGET specifies the destination path and file name on the server, relative to
WORKSPACEPATH. If the specified directories do not exist, Matrix will create them.
Refer to Using ${} Macros for more information on WORKSPACEPATH.
When delete is specified, the source file is deleted on the client after the upload. The
default is FALSE.
When overwrite is specified, if TARGET file name already exists, the uploaded file
replaces it. The default is TRUE.
Note that the defaults for the delete and overwrite options are different between upload
and download in order to maintain consistency with the default behavior of checkin/
checkout.
Version 10 459
For example:
upload sourcefile /reports/report.doc targetfile report.doc delete;
Upload Command The upload file widget option and the upload command are intended to solve two
vs. Widget Upload different problems:
Option • The file chooser with upload flag allows the user to upload one file before the
server-side wizard programs are run. The file would generally contain data to be
parsed and used by the wizard. For example, you could populate an object’s attributes
or even a wizard list box based on a file selected by the wizard user.
• The upload command allows the user to upload one or more files for server side
processing. For example, you could preserve the client directory structure during file
checkin so that a checkout on a different client would maintain the same relative
directories (such as for use with CAD files that generally contain an inherent
directory hierarchy). This could be achieved by parsing the directory structure and list
of files from a user selected text file (using a wizard file chooser with upload option),
and then uploading the files for the server-side checkin.
When running a wizard with Matrix Web Navigator, control passes between the applet
running on the client (drawing frames, accepting user input) and the Collaboration Kernel
running on the server (executing wizard programs and their embedded MQL commands).
The frame transition programs (load, validate, epilogue, prologue) run on the server, and
control is not returned to the client until they have all been run. Since the upload/download
commands are client-side tasks that need to be controlled from the client, they are not
processed synchronously within the execution of the wizard program. Rather, they are
processed when control next returns to the client; that is, after all the frame transition
programs have run to completion. Consider the following scenarios, illustrated below:.
Scenario 2
Asynchronous upload
begins
• Scenario 1: File_Chooser widget has the upload flag set so, before the frame
transition programs are run, the file selected on Frame 1 is uploaded and available to
these programs.
• Scenario 2: File_Chooser widget does NOT have the upload flag set. Instead, the
Epilogue has the command “mql upload …”. In this case, after ALL the frame
transition programs are run, an asynchronous task, running in the background, is
launched to upload the file selected on Frame1, so it is NOT guaranteed to be
available for Frame 2.
Version 10 461
Running/Testing the Business Wizard
Any Matrix user with appropriate access can run a wizard program from within Matrix
Navigator or from the system command line, including from a Windows desktop icon. A
wizard can also be launched from within a program.
MQL trace can be used to test timing and debug wizard programs. For information, see
Server Diagnostics in the Matrix PLM Platform Installation Guide.
A wizard can be run from within Matrix by any of the following methods:
• including its name in a Matrix Toolset (see Toolsets Defined in Chapter 43)
• executing the wizard as a Method, which requires an object as its starting point
• executing the wizard from within a program, using the appl command
.Command Line From the system command line, the syntax of the command to run a wizard program is:
Interface matrix -wizard NAME
Matrix Interface A wizard can also be run from within Matrix Navigator by either including its name in an
eMatrix Toolset or by executing the wizard as a Method, which requires an object as its
starting point.
When a program or wizard is added as a method to a type, then that program or wizard
needs a business object in order to execute even if the Needs Business Object option was
not enabled for that program/wizard.
To include a wizard name within a toolset definition, see Creating Toolsets in Chapter 43.
The Toolset button will appear in the Matrix Navigator toolbar only when the Toolset is
defined as active (the default).
Version 10 463
for more information). Additional values can be passed as program arguments (such as
attribute values.) For Relationshipattributes and Relationshiphistory dialogs, only
CONNECTIONID is populated.
Limitations
The appl wizard command can be invoked only from top level programs or methods
(including the wizard code that is executed from the finish button), and never from within
user-defined transaction boundaries. Invoking a wizard from another program or from
within an active transaction will produce an error. The reasons for these limitations are:
• To prohibit implementations from encouraging user interaction while a transaction is
open. This is important because when a transaction is open, there are likely to be rows
or tables in the database that are locked by the transaction until it is completed
(committed or aborted). During this time, other users’ activities could be put in a wait
mode awaiting the release of the locks, which could be an indefinite time.
• To prevent nesting of wizards. This would add significant complexity to the
processing of wizards, such as in determining which wizard’s frame is next. The
capability of linking wizards end-to-end provides significant power and flexibility
without unnecessary complexity.
• To provide well-defined RPE behavior. A wizard launched by appl wizard
receives the same RPE as it would if it were launched directly from the toolbar or as a
method. This is guaranteed since the launch of the invoked wizard has been explicitly
delayed to occur after the calling program has exited and its local RPE has been
cleared, so that there is NO sharing of local RPE values between the program that
launches the wizard and the wizard itself. If information needs to be passed from the
calling program to the wizard, it must be passed via the wizard arguments or the
global RPE.
With these considerations in mind, appl wizard is allowed only if the following are
true. All other cases will generate an error.
• There is no transaction open.
• INVOCATION must be one of the following: method, program, or action, as long as
the action is also deferred so that it is outside the transaction. (The “body” code of a
wizard has an INVOCATION value of “program” or “method” depending on how it
was launched.)
It follows then, that INVOCATION cannot be any of the following: format, check,
override, range, load, validate, prologue, epilogue, button, autoactivity, or action that
is not deferred.
• The invoking program is not a nested program, meaning that the invoking program
cannot be the result of an exec prog or an exec bus T N R method
invocation from a higher-level program.
Note that appl wizard can be used in programs that are “utloaded” into a program that
meets the above criteria, since a utloaded program is actually run as part of the program
that utloads it.
Copying (Cloning) After a wizard is defined, you can clone the definition with the Copy Wizard statement.
a Wizard Definition This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy wizard SRC_NAME DST_NAME [MOD_ITEM] {MOD_ITEM};
Modifying a After a wizard is defined, you can change the definition with the Modify Wizard
Wizard Definition statement. When modifying a wizard program that is used to launch an application,
however, consider upward and downward compatibility between software versions.
The following statement lets you add or remove defining clauses and change the value of
clause arguments:
modify wizard NAME [MOD_ITEM] {MOD_ITEM};
Version 10 465
Modify Wizard Clause Specifies that…
[!]downloadable The status of downloadable changes as indicated here:
downloadable is specified when the program includes code for
operations not supported on the Web product (for example, Tk dialogs
or reads/writes to a local file).
!downloadable is specified when the program does not include code
for operations not supported on the Web product.
execute immediate The status of wizard execution changes so the program runs within the
current transaction.
execute deferred The status of wizard execution changes so the program runs only after
the outermost transaction is successfully committed.
hidden The hidden option is changed to specify that the object is hidden.
nothidden The hidden option is changed to specify that the object is not hidden.
frame FRAME_NAME FRAME_MOD_ITEM The named frame item(s) are changed to the new item(s) specified.
{FRAME_MODE_ITEM}
add FRAME FRAME_NAME [before The named frame is added.
FRAME] [FRAME_ITEM {FRAME_ITEM}]
remove FRAME FRAME_NAME The named frame is removed.
property NAME [to ADMINTYPE The named property is modified.
NAME] [value STRING]
add property NAME [to ADMINTYPE The named property is added.
NAME] [value STRING]
remove property NAME [to The named property is removed.
ADMINTYPE NAME] [value STRING]
As you can see, each modification clause is related to the arguments that define the wizard
frame.
Modifying Wizard The following subclauses are available to modify the existing frames in a wizard:
Frames
As you can see, each modification clause is related to the arguments that define the wizard
frame widgets.
Version 10 467
Deleting a Business Wizard
If a wizard is no longer required, you can delete it with the Delete Wizard statement:
delete wizard NAME;
Version 10 469
Overview of Programs
Java Program A Java Program Object (JPO) contains code written in the Java language. JPOs provide
Objects the ability to run Java programs natively inside the kernel, without creating a separate
process and with a true object-oriented integration ‘feel’ as opposed to working in MQL.
JPOs allow developers to write Java programs using the Matrix ADK programming
interface and have those programs invoked dynamically.
When running inside the Matrix Collaboration Kernel, programs share the same context
and transaction as the thread from which they were launched. In fact, Java programs run
inside the same Java Virtual Machine (JVM) as the kernel.
JPOs are also tightly integrated with the scripting facilities of Matrix. Developers can
seamlessly combine MQL, Tcl, and Java to implement their business model. However,
while Tcl will continue to be supported and does offer a scripting approach which can
makes sense in some cases, the Java language brings several advantages over Tcl:
• Java is compiled, and therefore offers better run-time performance
• Java is object-oriented
• Java is thread safe
Version 10 471
Creating a Program
NAME is the name you assign to the program. The program name is limited to 127
characters. For additional information, refer to Business Object Name in Chapter 35.
ADD_ITEM is an Add Program clause which provides additional information about the
program. The Add Program clauses are:
code CODE
description VALUE
java|external|mql
file FILENAME
icon FILENAME
execute immediate|deferred
[!|not]needsbusinessobject
[!|not]downloadable
[!|not]pipe
[!|not]pooled
[!|not]hidden
rule NAME
All of these clauses are optional. You can define a program by simply assigning a name to
it. You will learn more about each Add Program clause in the sections that follow.
Code Clause The Code clause of the Add Program statement defines the commands for the program.
Below are examples of program code that could be written to provide various
functionality. See Handling Variables in the Matrix PLM Platform Programming Guide
for additional information.
Legal characters in XML are the tab, carriage return, line feed, and the legal graphic
characters of Unicode, that is, #x9, #xA, #xD, and #x20 and above (HEX). Therefore,
other characters, such as those created with the ESC key, should not be used for ANY
field in Matrix, including business and administrative object names, description fields,
program object code, or page object content.
${PROG} /w “${FILENAME}”
The ${PROG} macro returns the command needed to execute the program defined by the
file association mechanism of windows. The /w is needed for Word 2000, but is ignored
for other versions.
To open multiple PDF files you can create an external Program with the following code:
${PROG} /n ${FILENAME}
The /n is needed for multiple files to be opened without errors..
For a simple generic format that uses file associations, do not define any programs for the
edit, view and print clauses of the format. For a more complex and flexible generic
Windows format that will open any file for view, edit, or print based on its file association,
include a condition exception for Word. For example:
tcl;
eval {
... parsing code to take out quotes / args / etc. from the
registry
if [string match *winword* ${PROG}] {
exec [${PROG} /w “${FILENAME}”]
} else {
exec [${PROG} “${FILENAME}”]
}
}
On a UNIX system, you might use the following for a text format:
edit textedit “${FILENAME}"
Note that the quotes allow the file name to contain spaces.
Some examples follow. See the Matrix PLM Platform Programming Guide for code-
writing guidelines.
Version 10 473
** specified when the program is configured on the policy. The macros are passed in
** the 'args' array when the trigger is run.
**
** This trigger will increment the 'docInt' attribute on an object when it is promoted
** from state Created to state Working, and will decrement the attribute when an
** object is demoted from state Working to state Created.
**
** To configure this as a promote and demote action on a policy:
** mod policy docPolicy state Created add trigger promote action
** docPromoteAction input "-method mxMain ${EVENT} ${OBJECTID}";
** mod policy docPolicy state Working add trigger demote action
** docPromoteAction input "-method mxMain ${EVENT} ${OBJECTID}" ;
try
{
// Declarations
String event = new String();
String objId = new String();
String attrName = new String("docInt");
MQLCommand mql = new MQLCommand();
// Get and check arguments arguments
if (args.length > 0)
event = args[0];
if (args.length > 1)
objId = args[1];
// Generate notices for bad arguments
if (event == null || event.equals("")) {
mql.executeCommand(ctx, "notice 'No event for docPromoteAction'");
}
else if (objId == null || objId.equals("")) {
mql.executeCommand(ctx, "notice 'No objId for docPromoteAction'");
}
Note that it is recommended that Actions and Checks are configured as promote Triggers,
and not as Lifecycle Checks and Actions. Refer to Working With Event Triggers in the
Matrix PLM Platform Programming Guide for more information.
Version 10 475
**
**
*/
import matrix.db.*;
import matrix.util.*;
try
{
// Declarations
String event = new String();
String objId = new String();
String attrName = new String("docString");
MQLCommand mql = new MQLCommand();
Note that it is recommended that Actions and Checks are configured as promote Triggers,
and not as Lifecycle Checks and Actions. Refer to Working With Event Triggers in the
Matrix PLM Platform Programming Guide for more information.
Version 10 477
import matrix.util.*;
try
{
// Declarations
String objId = new String();
MQLCommand mql = new MQLCommand();
Description The Description clause of the Add Program statement provides general information for
Clause you and the user about the commands associated with this program and the overall
function of the program. There may be subtle differences between programs; the
description can point out the differences.
There is no limit to the number of characters you can include in the description. However,
keep in mind that the description is displayed when the mouse pointer stops over the
program in the Program chooser. Although you are not required to provide a description,
this information is helpful when a choice is requested.
For example, assume you want to write descriptions for two word processing programs.
For the program named “BestWord” you might assign a description such as:
add program BestWord
description "Use to launch the BestWord word processing application"
Descriptions help to clarify the purpose of the program. You may enter a string of any
length.
Java or External or You can specify the type of program as java or external or MQL.
MQL Clause A Java Program Object (JPO) is just another type of Program object that contains code
written in the Java language. Generally, anywhere a Program object can be used, a JPO
can be used. See Java Program Objects for details.
An MQL program can be run from any machine with Matrix installed; it is not necessary
for MQL to be available on the machine. If not specified, mql is the default.
add program NAME mql;
An external program consists of commands that are evaluated by the command line syntax
of the machines from which they will be run. When creating external programs, remember
that the commands that you enter will be evaluated at each Matrix user’s workstation as if
they were being typed at the operating system’s command prompt. Be sure that the users
have the appropriate application files available from their workstation. External program
objects may also be defined as “piped,” providing a built-in MQL command line service to
handle standard input and output. Refer to Piped Clause for more information.
Since MQL can be launched from a command line, MQL code could be specified in an
external program. This would spawn a separate MQL session that would run in the
Version 10 479
background. In this case, MQL would have to be installed on every machine that will run
the program.
add program NAME external;
A Java program has code written in the Java language. A Java program can be run
anywhere a program object can be used.
add program NAME java;
File Clause The File clause enables you to specify a file that contains the code to be used in the
program.
add program NAME file FILENAME;
Icon Clause The Icon clause associates a special image with a program. When a user searches for a
program, the icon can help identify the object to select. Icons help users locate and
recognize items. You can assign a special icon to the new program or use the default icon.
The default icon is used when in view-by-icon mode. Any special icon you assign is used
when in view-by-image mode. When assigning a unique icon, you must use a GIF image
file. Refer to Icon Clause in Chapter 1 for a complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Execute Clause Use the execute clause to specify when the program should be executed. If the
execute clause is not used, immediate is assumed.
Immediate execution means that the program runs within the current transaction, and
therefore can influence the success or failure of the transaction, and that all the program’s
database updates are subject to the outcome of the transaction.
Deferred execution means that the program is cued up to begin execution only after the
outer-most transaction is successfully committed. A deferred program will not execute at
all if the outer transaction is aborted. A deferred program failure affects only the new
isolated transaction in which it is run (the original transaction from which the program
was launched will have already been successfully committed).
For example, to defer the execution of the “Roll up Cost” program:
modify program “Roll up Cost” execute deferred;
However, there are a number of cases where deferring execution of a program does not
make sense (like when it is used as a trigger check, for example). In these cases the system
will execute the program immediately, rather than deferring it until the transaction is
committed.
There are four cases where a program’s execution can be deferred:
• Stand-alone program
• Method
execute user You can assign a user to a program object such that when other users execute the program,
USERNAME they get the accesses available to the user specified in the program definition. For
clause example:
add program DocActionTrigger execute user bill;
Only one user is ever associated with a program. For nested programs, the user’s access
from the first program is inherited only if the called program has no associated user of its
own. If the called program does have a user, then that user’s accesses are made available
instead. Once the called program returns to the calling program, the latter's user is restored
as the person whose accesses are added to the current context. Thus, only one person's
accesses are ever added to the current context (not including access granted on a business
object).
methodOfA(ctx);
Version 10 481
_mql = new MQLCommand();
_mql.executeCommand(ctx, "execute program D");
}
}
The above program may be run in any of the following manners:
1. JPO B extends JPO A and a method of A is run on an object of type B as shown by
methodOfA.
2. JPO B implements JPO C. References to C objects really execute a different program
object.
3. JPO B runs a method of JPO D without using JPO.INVOKE as shown with dObject.
4. JPO B uses JPO.INVOKE to run JPO D.
5. JPO B uses MQLCommand to run "execute program <program name>" as shown
with _mql.
In the first 3 cases, execution is handled solely by the JVM, so that Matrix is never aware
of when the methods of another JPO get invoked and returned. In these cases, the user of
program B will remain in effect and the users, if any, of programs A, C and D, are ignored.
In cases 4 and 5, execution goes through the Matrix kernel code and the programs are
invoked as program objects, not just Java code by the JVM, and so the usual rules apply.
Needs Business You can specify that the program must function with a business object. For example, you
Object Clause would select this option if the program promotes a business object. If, however, the
program creates a business object, the program is independent of an existing object and
this option would not apply.
add program NAME needsbusinessobject;
Matrix runs any program specified as “needs business object” with the selected object as
the starting point. If a method does not use a business object, the selected object would not
be affected.
If not set, some macros, including Business Object Identification Macros, will not be
available.
The doesneedcontext selectable is available on programs to determine this setting in
an existing program.
The following indicates that a business object is not needed:
add program NAME !needsbusinessobject;
You can specify that external program objects use the “piped” service. Piped programs
may use a built-in MQL command line service to handle standard input and output. When
piped is specified, External is assumed. The piped service is not available to MQL or Java
program objects. Execution may be immediate or deferred. Piped programs cannot be
downloadable. Refer to Writing Piped Program Code in the Matrix PLM Platform
Programming Guide for more information.
Each time an MQL program object runs Tcl code and then exits out of Tcl mode, a Tcl
interpreter is initialized, allocated, and then closed. During a Matrix session, you may
execute several programs, and one program may call other programs, all of which require
a Tcl interpreter and therefore the overhead of its use. In an effort to optimize multiple Tcl
program execution, Tcl program objects may be specified as “pooled.” When such a
program is first executed in a session, a pool of Tcl interpreters is initialized, one of which
is allocated for the executing code. When the code is completed, the interpreter is freed up.
Subsequent Tcl code that is executed in a pooled program during the session will use an
interpreter from the already initialized pool.
When programs are created, the default is that they are not pooled. To define or modify an
MQL type program to use the pool of interpreters, use the following syntax:
mql< > add|modify program PROG_NAME [!]pooled;
The “!” may be used to turn off the pooled setting of a program.
Version 10 483
The number of interpreters available in a session is controlled by the
MX_PROGRAM_POOL_SIZE setting in the initialization file (matrix.ini or ematrix.ini).
MX_PROGRAM_POOL_SIZE sets the initial size of the Tcl interpreter pool. This setting is
also used to extend the pool size when all the interpreters in the pool are allocated and
another is requested. The default is 10.
Usage
Enabling the Tcl interpreter benefits MQL/Tcl programs that are nested or run in a loop,
such as the trigger manager. Also, while wizards do not support the pooled setting, the Tcl
programs that make up a wizard (load, validate, etc.) should make use of an interpreter
pool to optimize performance.
Unexpected results may occur if the pooled setting is turned on in a program without first
reviewing and validating its code. Good programming techniques must be adhered to
ensure proper results. When using an interpreter pool, Tcl variables are not cleared before
freeing up an interpreter. This means that programs must explicitly set variables before
using them, in case a previously executed program made use of the same variable name.
External, downloadable and Java programs do not use the Tcl interpreter pool, regardless
of the setting in the program definition. In addition, MQL/Tcl programs that use the TK
toolkit will not benefit from using the pooled setting, since user interaction is required. In
fact, unexpected results, such as leaving a TK dialog displayed, may occur due to the use
of variables as described above.
Before modifying existing programs to use the pooled setting, the code should be reviewed
and validated. Only programs that include tcl code but no TK code should use the pooled
setting.
Hidden Clause You can specify that the new program is “hidden” so it does not appear in the Program
chooser in Matrix, which simplifies the end-user interface. Many programs are not
intended to be executed as stand-alone programs (such as nested programs) and users
should not be able to view these program names in the Matrix Program chooser. Users
who are aware of the hidden program’s existence can enter its name manually where
appropriate. Hidden objects are also accessible through MQL, but printing a hidden
program is not possible unless you are a Matrix Business or System Administrator.
Rule Clause Rules are administrative objects that define specific privileges for various Matrix users.
The Rule clause enables you to specify an access rule to be used for the program.
add program NAME rule RULENAME;
Property Clause Integrators can assign ad hoc attributes, called Properties, to the program. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 485
Copying and/or Modifying a Program Definition
Copying (Cloning) After a program is defined, you can clone the definition with the Copy Program statement.
a Program This statement lets you duplicate defining clauses with the option to change the value of
Definition clause arguments:
copy program SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Modifying a After a program is defined, you can change the definition with the Modify Program
Program Definition statement. When modifying a program that is used to launch an application, however,
consider upward and downward compatibility between software versions.
The following statement lets you add or remove defining clauses and change the value of
clause arguments:
modify program NAME [MOD_ITEM] {MOD_ITEM};
Each modification clause is related to the arguments that define the program.
Version 10 487
Deleting a Program
If a program is no longer required, you may delete it with the Delete Program statement:
delete program NAME;
Version 10 489
Overview of Workflow Processes
NAME is the name you assign to the process. The process name is limited to 127
characters. The naming convention for process objects is similar to conventions for
business objects. For additional information, refer to Business Object Name in Chapter 35.
ADD_ITEM is an Add Process clause that provides additional information about the
process. The Add Process clauses are:
description STRING
and AND_NODE_NAME
or OR_NODE_NAME
finish FINISH_NODE_NAME
start START_NODE_NAME
stop STOP_NODE_NAME
autostart on|off
[!|not]hidden
icon FILENAME
All these clauses are optional. You can define a process by simply assigning a name to it.
(Note, however, that this skeleton process cannot be instantiated as a Matrix workflow
since it lacks required process elements.) Each Add Process clause is described in detail in
the sections that follow.
Description The Description clause of the Add Process statement provides general information for you
Clause and the user about the process and the overall function of the process. There may be subtle
differences between processes; the description can point out the differences. The syntax of
the Description clause is:
description STRING
Version 10 491
There is no limit to the number of characters you can include in the description. However,
keep in mind that the description is displayed when the mouse pointer stops over the
process in the Process chooser. Although you are not required to provide a description,
this information is helpful when a choice is requested.
Attribute Clause The Attribute clause of the Add Process statement assigns explicit attributes to the
process. These attributes must be previously defined with the Add Attribute statement or
in Business Modeler. If they are not defined, an error message is displayed.
If attributes are defined for the process, the attribute clause must precede any
interactive or automated clauses in the Add Process statement.
In addition to adding attributes to a process as a whole, attributes can also be added to the
activities within a process. This is similar to how attributes are used within a type
hierarchy where an attribute can be added for a parent type and then additional attributes
can be added to the child type of that parent.
For the user, the display of attributes (when creating processes or viewing attributes) will
appear in the reverse order of the programmed order. Therefore, you should put the first
attribute last in the MQL script.
A process can have any combination of attributes associated with it. For example, the
following Add Process statement assigns three attributes to the Create Part process:
add process "Order Materials"
description "to purchase materials for manufacturing"
attribute "Total Cost"
attribute "Quantity"
attribute "Composition";
Interactive Clause The Interactive clause of the Add Process statement adds an interactive activity to the
process.
During workflow execution, interactive activities are performed by a workflow participant
who becomes the owner of that activity. The activity owner may need to modify attributes
of the activity and may also need to access existing attachments or add business objects as
attachments.
The Interactive clause uses the following syntax:
interactive ACTIVITY_NAME [ACTIVITY_ITEM {,ACTIVITY_ITEM}]
description STRING
user ASSIGNEE
duration VALUE
priority VALUE
instruction VALUE
rate RATE
xcoord VALUE
ycoord VALUE
All these subclauses are optional. You can define an interactive activity simply by
assigning a name to it. Each subclause is described in detail in the sections that follow.
Description subclause
The Description subclause of the Interactive clause provides general information about the
interactive activity and the overall function of the activity. The syntax of the Description
subclause is:
description STRING
Attribute subclause
The Attribute clause of the Interactive clause assigns explicit attributes to the interactive
activity. These attributes must be previously defined with the Add Attribute statement or
in Business Modeler. If they are not defined, an error message is displayed.
For the user, the display of attributes (when creating processes or viewing attributes) will
appear in the reverse order of the programmed order. Therefore, you should put the first
attribute last in the MQL script.
An interactive activity can have any combination of attributes associated with it. For
example, the following Add Process statement assigns the attribute TotalCost to the
interactive activity:
add process "Create Part"
description "to purchase parts for manufacturing process"
interactive "Order Materials"
attribute "TotalCost";
User subclause
The User subclause of the Interactive clause adds an assigned user to the interactive
activity. The Process definition must contain assignees for all interactive activities. All
users who are assigned workflow tasks must have IconMail enabled. See Enable Iconmail
Clause in Chapter 11. The syntax of the User subclause is:
user ASSIGNEE
Version 10 493
For example, the following statement assigns the interactive activity “Check References”
to group “Human Resources.”
add process "Hiring"
interactive "Check References"
user "Human Resources";
Duration subclause
The Duration subclause of the Interactive clause specifies the number of days allocated for
the interactive activity. The syntax of the Duration subclause is:
duration VALUE
Wizard subclause
The Wizard subclause of the Interactive clause allows you to add Wizards or other
programs to a workflow interactive activity definition to make it easier for workflow
participants to perform tasks. Wizards can be designed to facilitate any task within the
workflow. You can create and assign Wizards such as Complete, Reassign, Suspend, etc.
to the activity definition, which the end users would execute to communicate to the
workflow system. Any program or tool that you specify appears as a toolbar icon within
the task window when the task is opened in Matrix. You can add multiple tools within a
single Interactive task. These wizards/programs must be previously defined with the Add
Wizard statement or in Business Modeler. If they are not defined, an error message is
displayed.
The syntax of the Wizard subclause is:
wizard NAME
Priority subclause
The Priority subclause of the Interactive clause helps to prioritize the tasks to be
performed (applicable when a user has more than one task assigned).
The syntax of the priority subclause is:
priority VALUE
VALUE can be a string of any length describing the work that needs to be done to complete
the activity. For example, if the activity involves purchase requisitions, and they must be
entered each week before 3 p.m. on Thursday afternoon, this information can be included
in the Instruction subclause. For example:
add process "Purchase Req"
interactive "Enter reqs"
instruction "All reqs must be entered into the
database before 3 p.m. on Thurs. afternoon.";
Rate subclause
The Rate subclause of the Interactive clause specifies the percentage of the assigned user’s
time expected to be allocated for this activity. The syntax of the Rate subclause is:
rate RATE
Xcoord subclause
The Xcoord subclause of the Interactive clause specifies horizontal location on the graph
of the Interactive activity icon. The syntax of the Xcoord subclause is:
xcoord VALUE
Ycoord subclause
The Ycoord subclause of the Interactive clause specifies vertical location on the graph of
the Interactive activity icon. The syntax of the Ycoord subclause is:
ycoord VALUE
Version 10 495
Trigger subclause
Triggers allow the execution of a Program object to be associated with the occurrence of
an event.
Interactive activity Triggers use the following syntax:
trigger EVENT_TYPE TRIGGER_TYPE PROG_NAME [input ARG_STRING]
Refer to Designing Triggers in the Matrix PLM Platform Programming Guide for more
information on Triggers.
Automated Clause The Automated clause of the Add Process statement adds an automated activity to the
process.
During workflow execution, automated activities are directly activated by the workflow
system with no workflow participant or task performer involved. A program object is
assigned to an automatic activity definition. This program object is executed at the
appropriate time during execution phase.
The Automated clause uses the following syntax:
automated AUTO_ACTIVITY_NAME [AUTO_ACTIVITY_ITEM
{,AUTO_ACTIVITY_ITEM}];
description STRING
user ASSIGNEE
xcoord XVALUE
ycoord YVALUE
All these subclauses are optional. You can define an automated activity simply by
assigning a name to it. Each subclause is described in detail in the sections that follow.
Description subclause
The Description subclause of the Automated clause provides general information about
the automated activity and the overall function of the activity. The syntax of the
Description subclause is:
description STRING
Attribute subclause
The Attribute clause of the Automated clause assigns explicit attributes to the automated
activity. These attributes must be previously defined with the Add Attribute statement or
in Business Modeler. If they are not defined, an error message is displayed.
For the user, the display of attributes (when creating processes or viewing attributes) will
appear in the reverse order of the programmed order. Therefore, you should put the first
attribute last in the MQL script.
An automated activity can have any combination of attributes associated with it. For
example, the following Add Process statement assigns the attribute "Time" to the "Log
Progress" automated activity:
add process "Create Part"
automated "Log Progress"
attribute "Time";
User subclause
The User subclause of the Automated clause adds an assigned user to the automated
activity. The syntax of the User subclause is:
user ASSIGNEE
Version 10 497
you may need to access the finance database which is not available to all users. In this
case, you should specify an assigned user whose context has access to that database. To
prevent the task assignment from showing in the person’s inbox, you could create an
alternate name for the user and use that name instead.
Any automated activity that has an assignee must be executed through a cron/batch
program which can be set up to run on any machine where resources are available to
execute the program object attached to the automated activity. The batch program can be
an MQL script which would set context as the assignee/special agent and run the execute
command. For example:
execute workflow PROCESS NAME automated AUTO_NAME;
Xcoord subclause
The Xcoord subclause of the Automated clause specifies horizontal location on the graph
of the automated activity icon. The syntax of the Xcoord subclause is:
xcoord VALUE
Ycoord subclause
The Ycoord subclause of the Automated clause specifies vertical location on the graph of
the automated activity icon. The syntax of the Ycoord subclause is:
ycoord VALUE
Program subclause
The Program subclause of the Automated clause adds the program which executes when
the automated activity is started. The syntax of the Program subclause is:
program PROG_NAME [input ARG_STRING]
Refer to Designing Triggers in the Matrix PLM Platform Programming Guide for more
information on Triggers.
Subprocess The Subprocess clause of the Add Process statement adds a sub-process to the process.
Clause A sub-process is a process that is enacted or called from another process and forms part of
the overall process. A sub-process is useful for defining reusable components from within
other processes. A sub-process will have its own process definition.
The sub-process informs workflow in which it is contained (the parent process) that it is
complete when the sub-process reaches the Finish disposition.
The Subprocess clause uses the following syntax:
subprocess SUBPROCESS_NAME reference PROCESS_NAME description
STRING] [xcoord XVALUE] [ycoord YVALUE]
Version 10 499
STRING is a string of any length, enclosed in quotes if it contains embedded spaces,
which provides general information about the sub-process and the overall function of the
sub-process.
XVALUE is a whole number that specifies the horizontal location on the graph of the
sub-process icon.
YVALUE is a whole number that specifies the vertical location on the graph of the
sub-process icon.
And Clause The And clause of the Add Process statement adds an AND connector to the process.
AND connectors can be added to a process to create branching within the process. For
example, if your process defines the activities necessary to create a book, you may need
different translations of the book to be performed at the same time. The syntax of the And
clause is:
and AND_NODE_NAME
AND_NODE_NAME is the name assigned to the AND connector. This name is used in the
Modify Process statement when linking activities and sub-processes through an AND
connector.
Or Clause The Or clause of the Add Process statement adds an OR connector to the process. OR
connectors can be added to a process to create activity branching within the process. For
example, if your process defines the activities necessary to approve a purchase requisition,
you may need different approvals depending on the cost of the item. The syntax of the Or
clause is:
or OR_NODE_NAME
OR_NODE_NAME is the name assigned to the OR connector. This name is used in the
Modify Process statement when linking activities and sub-processes through an OR
connector.
Finish Clause The Finish clause of the Add Process statement adds a finish node to the process, which
signifies the end of the process. The Finish node is required, and there can be only one
Finish node in a process definition. The syntax of the Finish subclause is:
finish FINISH_NODE_NAME
FINISH_NODE_NAME is the name assigned to the Finish node. This name is used in the
Modify Process statement when linking the final activity or sub-process to the Finish
node.
Start Clause The Start clause of the Add Process statement adds a start node to the process, which
signifies the start of the process. There can be only one Start node in a process definition.
The syntax of the Start subclause is:
start START_NODE_NAME
Stop Clause The Stop clause of the Add Process statement adds a stop node to the process, which
signifies an abrupt termination of the process. The syntax of the Stop subclause is:
stop STOP_NODE_NAME
STOP_NODE_NAME is the name assigned to the Stop node. This name is used in the
Modify Process statement when linking an activity or sub-process to the Stop node.
Autostart Clause The Autostart clause of the Add Process statement specifies whether the workflow is
started as soon as it is created in Matrix Navigator. If you want the workflow to start
immediately after it is created, use:
autostart on
Hidden Clause You can specify that the new process is “hidden” so it does not appear in the Process
chooser in Matrix, which simplifies the end-user interface. Users who are aware of the
hidden process’s existence can enter its name manually where appropriate. Hidden objects
are also accessible through MQL.
The hidden flag can be changed even when instances of the workflow are active. This
allows Business Administrators to clone existing process definitions and modify the
clones to the new process definition. Marking the old process as hidden would force
Matrix Navigator users to use the new process definitions.
Icon Clause The Icon clause of the Add Process statement associates a special image with a process.
Icons help users locate and recognize items. You can assign a special icon to the new
process or use the default icon. The default icon is used when in view-by-icon mode. Any
special icon you assign is used when in view-by-image mode. When assigning a unique
icon, you must use a GIF image file. Refer to Icon Clause in Chapter 1 for a complete
description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the process. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
Version 10 501
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add process NAME
property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Trigger Clause Triggers allow the execution of a Program object to be associated with the occurrence of
an event.
Process Triggers use the following syntax:
trigger EVENT_TYPE TRIGGER_TYPE PROG_NAME [input ARG_STRING];
Refer to Designing Triggers in the Matrix PLM Platform Programming Guide for more
information on designing Triggers.
Workflow Macros
Macros are a simple name/value string substitution mechanism, where the macro value is
substituted for the macro name when used in a Program as follows:
${MACRONAME}
This single one-pass string substitution process occurs just prior to program execution.
These macros are also created as a variable of the same name in the RPE. Refer to the
Macros Appendix in the Matrix PLM Platform Programming Guide for more information.
Copying (Cloning) After a process is defined, you can clone the definition with the Copy Process statement.
a Process This statement lets you duplicate defining clauses with the option to change the value of
Definition clause arguments:
copy process SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Modifying a After a process is defined, you can change the definition with the Modify Process
Process Definition statement.
The following statement lets you add or remove defining clauses and change the value of
clause arguments:
modify process NAME [MOD_ITEM {MOD_ITEM}];
Version 10 503
Modify Process Clause Specifies that…
icon FILENAME The image is changed to the new image in the file specified.
hidden The hidden option is changed to specify that the object is hidden.
nothidden The hidden option is changed to specify that the object is not hidden.
property NAME [to ADMINTYPE The named property is modified.
NAME] [value STRING]
add property NAME [to ADMINTYPE The named property is added.
NAME] [value STRING]
remove property NAME [to The named property is removed.
ADMINTYPE NAME] [value STRING]
add attribute NAME The named attribute is added.
remove attribute NAME The named attribute is removed.
add interactive ACTIVITY_NAME The named interactive activity is added.
[ACTIVITY_ITEM {,ACTIVITY_ITEM}]
remove interactive ACTIVITY_NAME The named interactive activity is removed. If ACTIVITY_ITEMS are
[ACTIVITY_ITEM {,ACTIVITY_ITEM}] specified, only those items are removed from the activity; the interactive
activity itself is not removed. All ACTIVITY_ITEMS can be removed
except for Name, Description, Duration, Priority, and Rate.
add automated AUTO_ACTIVITY_NAME The named automated activity is added.
[AUTO_ACTIVITY_ITEM
{,AUTO_ACTIVITY_ITEM}]
remove automated The named automated activity is removed. If ACTIVITY_ITEMS are
AUTO_ACTIVITY_NAME specified, only those items are removed from the activity; the automated
[AUTO_ACTIVITY_ITEM activity itself is not removed. All ACTIVITY_ITEMS can be removed
{,AUTO_ACTIVITY_ITEM}] except for Name and Description.
add subprocess SUBPROCESS_NAME The named sub-process is added.
[description VALUE] [xcoord
XVALUE] [ycoord YVALUE]
add or OR_NODE_NAME The named OR node is added.
remove or OR_NODE_NAME The named OR node is removed.
add and AND_NODE_NAME The named AND node is added.
remove and AND_NODE_NAME The named AND node is removed.
add finish FINISH_NODE_NAME The named finish node is added.
remove finish FINISH_NODE_NAME The named finish node is removed.
add start START_NODE_NAME The named start node is added.
remove start START_NODE_NAME The named start node is removed.
add stop STOP_NODE_NAME The named stop node is added.
remove stop STOP_NODE_NAME The named stop node is removed.
Each modification clause is related to the arguments that define the process.
Version 10 505
Reassigning an Activity to a Group
Any workflow activity can be reassigned in an instantiated workflow by its owner as long
as the activity has not been completed. The new owner can be any type of user (person,
group, role, or association). You can reassign activities before the workflow has been
started, while it is in progress, or by stopping (and restarting) it. (You cannot reassign
activities when the workflow has been suspended or completed.) When you restart a
workflow, it returns to the beginning of the process.
There is a behavior difference between assigning an activity to a group in the process
definition and reassigning an activity to a group in the workflow instance:
• If the assignee of an activity in a process definition is a group or role, the workflow
engine routes a task to each member of the group, or each person assigned to the role.
Any of the recipients of the taskmail can then accept the task (from Matrix or MQL),
and become the owner of the activity. The taskmail is then rescinded from all other
group members’ inboxes.
• If an activity is reassigned to a group or role from the workflow instance, the
workflow engine routes a task to each member of the group, or each person assigned
to the role. The activity does not require acceptance, and it remains under the
ownership of the group or role until it is completed. No taskmails are rescinded until
the task is completed, and the user that completes the task is recorded in history.
When members of a group receive taskmail for an activity that has been reassigned to the
group, any member can work on the activity. The taskmail remains in all members’
inboxes as a reminder of the group’s responsibility. When a member marks the task
complete, all taskmails for this activity are rescinded from all members.
The elements of a process definition are linked to each other to form a directed process.
Links are created using the Connect clause of the Modify Process statement. Links must
be made between each of the elements that have been defined for the process, including
interactive activities, automated activities, sub-processes, AND-connectors,
OR-connectors, start node, finish node, and stop node(s).
Connect Clause After elements of a process have been defined, you must link them using the Connect
clause of the Modify Process statement. The syntax is:
modify process connect from NODE_NAME to NODE_NAME;
Disconnect Clause To disconnect elements of a process that have been connected, use the Disconnect clause
of the Modify Process statement. The syntax is:
modify process disconnect from FROM_NODE to TO_NODE;
FROM_NODE is the name of the node at the start of the link that you want to disconnect.
TO_NODE is the name of the node at the end of the link that you want to disconnect.
Transition A transition condition is a logical expression to be evaluated by the workflow system. This
Conditions decides the sequence of activity execution within a workflow. It is stored as an attribute of
the link. The transition condition is used with the OR clause, where multiple alternative
workflow branches exist and the system needs to determine which branch to take to
advance the workflow. This approach allows adding as many alternative branches on the
OR icon as needed without cluttering the activity instance with branch conditions for each
branch that is needed.
Transition conditions are added using the following clause of the Modify Process
statement:
add from FROM_NODE to TO_NODE transition expression EXPRESSION
Version 10 507
For example, the following expression could be used to route tasks of cost value less than
or equal to 25:
modify process “Order Supplies”
add from OR1 to “Place Order” transition expression
“interactive[Task1].attribute[Actual Cost].value <= 25”;
See Where Clause in Chapter 39 for information on how to create logical expressions.
Processes should be designed so that only one transition condition can be true for each
OR-split. For example, consider the following transition conditions:
interactive[Task1].attribute[Actual Cost].value <= 25
and
interactive[Task1].attribute[Actual Cost].value >= 25
The first tests for Actual Cost less than or equal to 25. The second tests for Actual Cost
greater than or equal to 25. If the Actual Cost is exactly 25, both conditions test true. The
workflow will take the first path it finds that tests true. Since the transition conditions are
ambiguous, you may get unexpected results.
Business object attributes can also be used in transition conditions. These business objects
need to be used as attachments before evaluation can be done. For example:
businessobject[TYPE NAME REV].attribute[ATTR_NAME].value == 25
It is not necessary to add transition conditions to every link in a process. If a link does not
contain a transition expression, it provides a default path. If none of the transition
conditions for a particular OR-split is met, the task on the default path would be activated.
If a process is no longer required, you can delete it with the Delete Process statement:
delete process NAME;
Version 10 509
Validating a Process
When Matrix attempts to create or modify a defined process, it checks for a couple of
errors in the process definition. If Matrix finds one of these errors, it presents an error
message and will not save the process:
• A sub-process is included that has not been defined.
• Invalid links between process elements.
If you don’t receive an error message when you save a process definition, the process may
still have errors. Matrix allows you to save a process that has some errors so you can save
processes that aren’t complete. Here is a list of errors that may be present in a process but
that will not prevent the system from saving the process:
• Missing or more than one Start node
• Start node not at the beginning of the process
• More than one node connected to the Start node
• Missing or more than one Finish node
• Finish node not at the end of the process
• Stop node with nodes following it
• No activities or sub-processes included in the process
• No assignee for interactive activities
• An AND connector following an OR connector
• An AND connector following an AND connector
To check for the above errors, you can validate a process using the Validate Process
statement:
validate process PROCESS_NAME {,PROCESS_NAME};
Version 10 511
Overview of Reports
Business objects can contain a large amount of information, not all of which will be
relevant to your report. Most reports are designed to answer specific questions. For
example:
• What is the total cost of this project?
• Who is working on this project and how can they be contacted?
Once you have identified each question, you can determine the information required to
provide each answer. To be efficient, a report should be designed to logically answer these
questions. Simply seeing rows of names or numbers has little meaning to the reader. All
information should be labeled and grouped appropriately so that a reader can easily locate
desired values.
Version 10 513
Defining a Report
NAME is the name you assign to the report you are creating. The report name is limited to
127 characters. For additional information, refer to Business Object Name in Chapter 35.
ADD_ITEM is an Add Report clause which provides additional information about the
report. The Add Report clauses are:
units [picas|points|inches]
description VALUE
icon FILENAME
header HEADER_SIZE
footer FOOTER_SIZE
displayrule false|true
[!|not]hidden
With the exception of the Units and Size clauses, all other Add Report clauses are
optional. (Units will default to picas if you do not enter a value.) Field clauses specify the
field values that should be printed in the report and where. Without at least one Field
clause, your report will not have much value.
In the sections that follow, you will learn more about each Add Report clause.
Units Clause The Units clause of the Add Report statement specifies the units of page measurement.
There are three possible values: picas, points, or inches.
units picas
Or
units points
Or
units inches
Without a unit of measurement, Matrix cannot interpret the values of any given header,
footer, margin, or field size. Because picas are the default unit of measurement, Matrix
will automatically assume a picas value if you do not use a Units clause.
Picas are the most common units of page measurement in the computer industry. Picas use
a fixed size for all characters. Determining the size of a field value is easy when using
picas as the measurement unit. Simply determine the maximum number of characters that
Description The Description clause of the Add Report statement provides general information to you
Clause and the user about the function of the report. There may be subtle differences between
reports; you can use the Description clause to point out the differences to the user.
There is no limit to the number of characters you can include in the description. However,
keep in mind that the description is displayed when the mouse pointer stops over the
report in a chooser. Although you are not required to provide a description, this
information is helpful when a choice is requested.
You can distinguish your report in your selection of a report name. This consists of a
character string value to identify the report being created and to reference it later. It should
have meaning to the purpose of the report. If possible, avoid cryptic names. For example,
“Cost Report” is a valid name, but it does not inform you of what costs you are reporting.
Since the report name is too short to be very descriptive, you may include a Description
clause as part of the report definition. This enables you to associate a prompt, comment, or
qualifying phrase with the report being defined.
For example, if you were defining a report named “Cost Report,” you might write an Add
Report statement with a Description clause similar to one of the following. The
information in each report might differ considerably.
add report “Cost Report”
description “Provides daily operating costs of the department”;
add report “Cost Report”
description “Provides manufacturing costs for Widget A”;
add report “Cost Report”
description “Provides monthly costs for supporting Widget B”;
When specifying a value for the description, you can enter a string of any length.
However, the longer the string, the more difficult it may be for the user to use.
Version 10 515
Icon Clause The Icon clause of the Add Report statement associates a special image with a report.
Choose an icon that has meaning to the user. Icons can visually help a user locate the
report s/he needs by clearly identifying the report function. The default icon is used when
in view-by-icon mode. Any special icon you assign is used when in view-by-image mode.
When assigning a unique icon, you must use a GIF image file. Refer to Icon Clause in
Chapter 1 for a complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Size Clause The Size clause of the Add Report statement defines the page dimensions of the report.
This is commonly equal to standard page sizes such as 8½ by 11 inches or 8½ by 14
inches. However, you are not restricted to these sizes.
A page can be any size that your printer can handle. A page is a logical unit that you
define. Once defined, Matrix will use that definition to determine where to place the
header, footer, and margins. But, Matrix must know the page size to determine when one
page ends and another begins.
To define a page size, you need two numeric values. One represents the width
(COL_SIZE) and one represents the length (ROW_SIZE). Both of these values must be
provided and entered according to the following syntax:
size ROW_SIZE COL_SIZE
If you wanted the dimensions of a standard page, you would write one of the following
clauses. The clause you use depends on the units you specified in the Units clause.
size 80 66 Measured in picas
When specifying page dimensions, be sure the page break occurs in the correct place. For
example, depending on your printer, a page may have 60 or 66 lines. For example, if your
printer automatically inserts a footer and header value of 3 lines each, you should use a
value of 60. Otherwise, you would end with a page of 72 lines (66 plus the footer and
header) rather than 66. If you are unsure of your printer settings, try several test values to
see what works best. Or, consult the printer user manual.
Header Clause The Header clause of the Add Report statement places a border at the top of the page. It
specifies the number of lines, points, or inches that should be measured down from the top
of the page. While inserting a Header clause defines an upper border, it does not prevent
you from placing information within that border.
Header clauses are often used in conjunction with display rules and page titles. When you
define a header, you are defining a place where a rule line can be placed. You may want to
place title information above the rule line with the values below it.
The following statement creates a report named “Material Properties.” Measured in picas,
the report is 80 characters wide and 60 lines long. It has a header that extends six lines
When you define a large header value, you can ensure that a value is not printed directly
on a page break. It is a good practice to allow some space near the expected page break.
This allows for printer paper that is in a less than perfect position. Also, the border sets off
each page and makes it easier to identify and read.
Footer Clause The Footer clause of the Add Report statement is similar to the Header clause. It places a
border at the bottom of the page by specifying the number of lines, points, or inches that
should be measured up from the bottom of the page. While inserting a Footer clause
defines a lower border, it does not prevent you from placing information within that
border.
Footer clauses are often used in conjunction with display rules and page footnotes (such as
page numbers or titles). When you define a footer, you are defining where a rule line can
be placed. You may want to place your footnote information below that rule line. This
information might consist of summary values, orientation material (such as a page number
and title), or special information (such as warning flags).
A Footer clause can be used with or without a Header clause. When used alone, define a
footer large enough to ensure that your values will not be printed directly on a page break.
For example, the following statement starts the report at the first line (a header is not
defined). Then a border (defined by the footer) is placed six lines up from the bottom to
allow for the page break.
add report “Material Properties”
units picas
size 80 60
footer 6
displayrule true;
But what if the printer paper is slightly below the desired starting point? In that case, you
might loose the first line or two of report output. For that reason, it would be better to
define the report as:
add report “Material Properties”
units picas
size 80 60
header 3
footer 3
displayrule true;
With this definition, the page will hold the same number of lines. However, the starting
point is three lines down from the top to ensure that no field values are lost.
Version 10 517
Margins Clause The Margins clause of the Add Report statement specifies a left and right border on each
page:
margins LEFT_MARGIN RIGHT_MARGIN
LEFT_MARGIN is the number of units Matrix should move from the left page edge.
Always specify this value first.
RIGHT_MARGIN is the number of units Matrix should move from the right page edge.
For example, assume you want to include margins in a “Material Properties” report
definition:
add report “Material Properties”
units picas
size 80 60
header 3
footer 3
margins 5 10;
In this example, the left margin is set as five characters in from the left page edge. The
right margin is set as ten characters in from the right page edge. Since the page size is set
at 80 characters, this means that the center working area is equal to 65 characters.
When including a Margins clause in an Add Report statement, you must always specify
two values even if you only want one margin. This enables Matrix to determine which
value is the left margin offset and which is the right. For example, to define only a right
margin, you can use this Margins clause:
margins 0 5
A 0 value for the margin means that the first character is printed at the edge (coordinate
1).
The left margin is defined as the left page edge (0). The right margin is then defined as
five characters in from the right page edge. This gives you a new working area of 75
characters in width.
Note that the margin values are relative to the page size. This means that you can apply
borders to nonstandard page sizes. It also means that you can have a right or left border
that is invalid or leaves no room for values. For example, assume you want to include a
Margins clause within the “Label List” report definition:
add report “Label List”
units picas
size 40 12
header 1
footer 1
displayrule true
margins 5 5;
With the inclusion of the Margins clause, you have a working area that is 30 characters
wide. The left margin is at five characters from the left edge and the right margin is at five
characters from the right edge. Since the right edge is at 40 characters, this definition is
equivalent to saying that the right margin is at 35 characters.
When the Displayrule clause is set to FALSE, a dividing line is not displayed. This is the
default value. When the Displayrule clause is set to TRUE, Matrix will print a line at the
positions specified in the Header and Footer clauses. If Header and Footer clauses are not
included in the definition, you will get an error.
Dividing lines can make a report easier to read by setting off important information (such
as title or summary information). Since you can define a page to be of any size within the
limitations of your printer, you can use the Displayrule clause to denote the boundaries of
page information. For example, you may be printing labels that are eight lines in length.
You may want to draw a dividing line between each label. To do so, you could write a
statement such as:
add report “Label List”
units picas
size 40 12
header 1
footer 1
displayrule true;
This report definition defines a page of only 12 lines in length and 40 characters wide.
Since the header begins at one line down from the top and the footer begins one line up
from the bottom, you can have a blank line before and after the eight lines of label
information. The boundaries of each label will be marked by the two rule lines. If you only
wanted one rule line to divide each label, you could use only a Header or Footer clause in
the definition.
Field Clause The Field clause specifies the values to be printed and their general placement on the
page:
field FIELD_TYPE FIELD_DEF {FIELD_DEF}
FIELD_TYPE identifies the general function of the field value being defined. All Field
clauses must include a Field Type subclause which must be given before any defining
subclauses. When specified, the field type identifies the kind of value that will be printed:
Each field type is defined in its own Field Type subclause, as discussed in the sections that
follow.
FIELD_DEF (field definition) is a subclause that provides additional information about
the value to be printed. Four different subclauses can define a field:
Version 10 519
• Output subclause
• Geometry subclause
• Label subclause
• Filter subclause
These subclauses define information such as where the values should be placed on the
page, how often the field values should be printed, and test criteria to ensure that you have
the correct values. Each of these four subclauses and the arguments they use are discussed
in the sections that follow.
expression QUERY_WHERE_EXPRESSION
date
String
The first form specifies that the field value is a text string or label. For example, a report
title or footnote would use the String field type.
Expression
The second form specifies that the field value is the result of an expression. This
expression is constructed according to the syntax described for the Where clause as
described in Query Overview in Chapter 39.
Unlike a QUERY_EXPR expression that must produce a TRUE or FALSE value, the
QUERY_WHERE_EXPRESSION can produce any type of value. This means that you can
use the name of a field that contains a non-Boolean value in the field type definition. For
example, each of the following are valid Expression subclauses that define a field type
value:
expression DESCRIPTION
In the first example, the Description field value (a character string value) is used. In the
second example, the value of the field named “All tests are negative” (a Boolean value) is
Date
The third form of the Field Type subclause specifies that the value is the date obtained
from the system clock. When this field type is used, Matrix prints the date using the
format MM/DD/YY. This field type is useful to include the current date within your report.
Calculated
The remaining forms of the Field Type subclause—the Calculated subclauses—specify
that the field value is calculated from other multiple field values. In the Calculated Sum/
Average subclause, you can calculate either the total of the field values or the average
value.
calculated sum NUMERIC_VAL_EXPR [resetperpage true|false]
Or
calculated average NUMERIC_VAL_EXPR [resetperpage true|false]
Version 10 521
This specifies that the value should be a count of the number of values that meet the
counting criteria. The keyword Count is used and the field value does not have to be
numeric. You can use any valid query expression. If the expression returns a TRUE value,
the count is incremented by one. If the value is FALSE, the count remains unchanged.
The expression also can provide information on how many values you have when the
number is too large to count easily. And, it can flag errors or discrepancies that may be
found.
In each of the three forms of Calculated subclause, you can use a resetperpage
subclause to reset the total, average, or counter back to zero at the beginning of the next
page if the resetperpage subclause is set to FALSE. A running total, average, or
count will be compiled.
pervalue The field value appears on a report each time the report evaluation
encounters valid data. Valid data must pass any evaluation requirements as
well as any specified field filter expression. The report will continue to
output the field values until the end of the page is reached. Then, the data
reporting will continue on a new page.
firstpage The field value appears only on the first report page.
lastpage The field value appears only on the last report page.
START_POINT identifies the X and Y coordinates of the field’s starting point. This is
where the first character of the field value is printed.
ROW_SIZE specifies the horizontal size of the field.
COL_SIZE specifies the vertical size of the field.
The field’s starting point can be specified in one of two ways. The first is to give the
absolute X and Y coordinates. The second is to give the X and Y coordinates relative to
the report’s header and left margin.
The geometry size must be at least 1,1. Absolute coordinates begin with 1,1 and are
measured from the upper left corner of the page.
Absolute coordinates use the syntax:
@X_START_VALUE @Y_START_VALUE
The first description will start printing the title string “Daily Customer Report For:” in the
upper left corner of the page. Its coordinates, given in picas, indicate ten characters over
and five lines down from the uppermost left corner of the page. Following the title string is
the current date. It is started on the same line 28 characters after the start of the title string.
This starting location allows for the number of characters needed to print the title string. If
the date location were less that 38, part of the title string would be overwritten. Take care
to ensure that the field sizes do not conflict with field locations.
Relative coordinates can begin with 0,0 and are specified in the same general manner as
absolute coordinates. Remember that, with relative coordinates, the values are measured
from the upper left corner of the header and left margin intersection.
X_START_VALUE Y_START_VALUE
While the starting point is given as (1,1), this actually translates to an absolute starting
point of (12,7). That is because the starting point for all relative coordinates is the bottom
of the header (the 7th line) and the end of the left margin (12th character). When
specifying the relative coordinates, you will always have to add the header and left margin
values to obtain the absolute coordinates. Therefore a relative position of (28,0) translates
into an absolute position of (39,6) with header and margin values of 6 and 11.
When specifying the starting point, you can use any combination of relative or absolute
values. Absolute coordinates are useful when you want to print a title within the header,
footer, or margin areas. You cannot do this using relative coordinates. For example, to
Version 10 523
print the previous sample title above the display line, you would have to use absolute
values such as:
add report “Customer List”
units picas size 80 60
header 6 margins 11 6
displayrule true
field string “Daily Customer Report For: ”
output firstpage
geometry start @22 @3 size 27 1
field date
output firstpage
geometry start @49 @3 size 9 1;
This statement will place the title and date in the center of the page on line 3. Since the
header is set off with a display rule clause, this gives you two lines above and two lines
below the title.
Centering the title and date on the page is done by using the starting point in conjunction
with the Size subclause. The Size subclause specifies the length and width of the field.
First determine the number of characters required to print the title and date (36 characters)
and then determine the amount of space remaining (80 - 36 = 44). That amount is divided
in half to determine the starting row for the first field (@22). If you add the field size to
this starting value, you find the starting location for the second field (@49).
Like the Start clause of the Add Report statement, the size is given row first and column
second. For example, to print to field string “Address: ” the size would be nine pica
characters long and use one line. Therefore, its size could be expressed as:
size 9 1
All geometry subclauses must include the field size. If the size value is larger than the
field value, the field value is padded with blank spaces so that the field and size values are
equivalent. If the size value is smaller than the field value, the field value is truncated on
the right to fit into the field size. Multiple-line text output will wrap at word boundaries if
the report field is defined with a row size greater than 1.
As an added precaution, you could add a Filter subclause (discussed in Field Definition
(Filter) Subclause below) to check for excessively large numbers. If one is encountered,
you could print a warning message rather than the truncated value.
When specifying the number of rows used by a field, you should consider the spacing you
want to use in the report. Matrix will look at the number of rows required to print each
field value on a line as well as the maximum number when determining how many lines
must appear within each output group. For example, a sample report evaluation uses this
report definition:
report “Material Properties Report”
description “Lists the material types of selected components and their total weight”
size 80 60
header 5 footer 5 margins O 5
displayrule true
field string “Material Properties Report”
output firstpage
geometry start @5 @2 size 28 1
field date
output firstpage
geometry start @11 @3 size 9 1
label title “Date: ”
output firstpage
Version 10 525
Labels provide a title for the associated field only when the associated field values appear
in the report. Since labels are fields, they follow the same general syntax:
label title LABEL_NAME
output OUTPUT_FREQUENCY
geometry start START_POINT size ROW_SIZE COL_SIZE
However, what happens if you have a value too large to fit in the field’s size? If the value
is larger than the size, the value is truncated. Therefore, you might want to test for any
value that is out of the range of the expected item costs. If it is out of range, you could
simply not print the value. The blank value would then represent a flag for out of range
values.
To test for out of range values, include a Filter subclause in the above field definition as:
field expression ‘“attribute[Item Cost]”’
output perline
geometry start 65 4 size 5 1
filter ‘“attribute[Item Cost]”
Version 10 527
This subclause tests the Item Cost to see if it is less that $100.00. If the expression result is
TRUE, the Item Cost value is printed. If the expression result is FALSE, nothing is printed.
Hidden Clause You can specify that the new report is “hidden” so that it does not appear in the Report
chooser in Matrix. You may want to use the hidden option if, for example, an object is
under development or if it is intended only for your personal use. Hidden objects are also
accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the report. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add report NAME
property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Once you have defined a report, the next step is to evaluate it. Evaluating a report involves
feeding business objects to the report for processing. This is done with the Evaluate
Report statement:
evaluate report NAME BO_SOURCE [output FILENAME];
NAME specifies the report definition you want to use in the evaluation.
BO_SOURCE specifies the source of the business objects to be processed within the report.
FILENAME specifies an external file to be used to store the results of the report
evaluation.
When an Evaluate Report statement is entered, Matrix processes each of the business
objects associated with the BO_SOURCE. This source may be either a query or a set. If the
source is a query, the syntax of the Evaluate Report statement appears as:
evaluate report NAME query QUERY_NAME [output FILENAME];
A query produces a collection of business objects that meet specified search criteria. This
collection then can be stored in a set. In both cases, a collection of business objects share a
set of common features or values as specified by the query’s search criteria.
When evaluating a report, you will want to match the report definition to the query’s
search criteria. If the business objects you are providing for the report do not have the
correct types of values, the report results will be worthless.
For example, evaluating a report named “Current Customer Report” with business objects
containing information on the storing and ordering components will only produce errors.
Therefore, you should check the current query criteria or the set contents before evaluating
a report to ensure that you will be working with the correct collection of business objects.
Once you have an appropriate collection of one or more business objects, you can have
them evaluated to produce a set of report results.
Version 10 529
Copying and/or Modifying a Report
Copying (Cloning) After a report is defined, you can clone the definition with the Copy Report statement.
a Report Definition This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy report SRC_NAME DST_NAME [MOD_ITEM] {MOD_ITEM};
Modifying a Report After a report is defined, you can change the definition with the Modify Report statement.
This statement lets you add or remove defining clauses and change the value of clause
arguments:
modify report NAME [MOD_ITEM {MOD_ITEM}];
Each modification clause is related to the arguments that define the report. To change the
value of one of the defining clauses or add a new one, use the Modify clause that
corresponds to the desired change. For example, use the Size clause of the Modify Report
statement to alter the values of the Size clause used in the Add Report statement. The only
exception to this general rule involves modifying field definitions.
When modifying field definitions within an existing report, you have only two choices.
You can either remove an existing field definition or you can add a new one. The Modify
Report clause does not offer a way to alter the subclause values that make up a field
definition. Therefore, if you are unhappy with a subclause value, you can only remove the
entire field definition and replace it with one that has the desired changes in it.
New field definitions appear at the end of the report definition. While they are listed last,
their placement in the report definition does not affect the placement or printing of the
report values. That is controlled by the geography and size values within the field
definitions themselves.
When modifying a report, you can make the changes from a script or while working
interactively with MQL. When making these changes, you should do one of the following:
• Perform one or two changes at a time if you are working interactively. This avoids the
possibility of one invalid clause invalidating the entire statement.
• Group the changes together in a single Modify Report statement if you are working
from a script.
Version 10 531
Deleting a Report
If a report is no longer required, you can delete it by using the Delete Report statements
delete report NAME:
After this statement is processed, the report is deleted and you receive an MQL prompt for
another statement.
Version 10 533
Overview of Forms
You must be a Business Administrator to define a form, and have form administrative
access.
NAME is the name you assign to the form you are creating. The form name is limited to
127 characters. For additional information, refer to Business Object Name in Chapter 35.
web is used when creating a “Web form.” This distinguishes forms to be used in HTML/
JSP applications from those used in Matrix thick client and PowerWeb.
ADD_ITEM is an Add Form clause which provides additional information about the form.
The Add Form clauses are:
[!|not]web
units [picas|points|inches]
description VALUE
icon FILENAME
rule RULENAME
header HEADER_SIZE
footer FOOTER_SIZE
[!|not]hidden
With the exception of the Units and Size clauses, all other Add Form clauses are optional.
(Units will default to picas if you do not enter a value.) Field clauses specify the field
values that should be printed in the form and where. Without at least one Field clause,
your form will not have much value.
The sections that follow explain more about each Add Form clause.
Units Clause The Units clause of the Add Form statement specifies the units of page measurement.
There are three possible values: picas, points, or inches.
units picas
Or
units points
Or
units inches
Version 10 535
Without a unit of measurement, Matrix cannot interpret the values of any given header,
footer, margin, or field size. Because picas are the default unit of measurement, Matrix
will automatically assume a picas value if you do not use a Units clause.
Picas are the most common units of page measurement in the computer industry. Picas use
a fixed size for all characters. Determining the size of a field value is easy when using
picas as the measurement unit. Simply determine the maximum number of characters that
will be used to contain the largest field value. Use that value as your field size. For
example, if the largest field value will be a six digit number, you need a field size of six
picas. This is not true when using points.
Points are standard units used in the graphics and printing industry. A point is equal to 1/
72 of an inch or 72 points to the inch. Points are commonly associated with fonts whose
print size and spacing varies from character to character. Unless you are accustomed to
working with points, measuring with points can be confusing and complicated. For
example, the character “I” may not occupy the same amount of space as the characters “E”
or “O.” To determine the maximum field size, you need to know the maximum number of
characters that will be used and the maximum amount of space required to express the
largest character. Multiply these two numbers to determine your field size value.
Inches are common English units of measurement. While you can use inches as your unit
of measurement, be aware that field placement can be difficult to determine and specify.
Each field is composed of character string values. How many inches does each character
need or use? If the value is a four-digit number, how many inches wide must the field be to
contain the value? How many of these fields can you fit across a form page? Considering
the problems involved in answering these questions, you can see why picas are a favorite
measuring unit.
Description The Description clause of the Add Form statement provides general information to you
Clause and the user about the function of the form. There may be subtle differences between
forms; you can use the Description clause to point out the differences to the user.
There is no limit to the number of characters you can include in the description. However,
keep in mind that the description is displayed when the mouse pointer stops over the form
in a chooser. Although you are not required to provide a description, this information is
helpful when a choice is requested.
You can distinguish your form in your selection of a form name. This consists of a
character string value to identify the form being created and to reference it later. It should
have meaning to the purpose of the form. If possible, avoid cryptic names. For example,
“Specification” is a valid name, but it does not inform you of the specifications for which
the form was designed.
Since the form name it is too short to be very descriptive, you may include a Description
clause as part of the form definition. This enables you to associate a prompt, comment, or
qualifying phrase with the form being defined.
For example, if you were defining a form named “Cost Specification”, you might write an
Add Form statement with a Description clause similar to one of the following. The
information in each form might differ considerably.
add form “Cost Specification”
description “Provides costs for developing new product features for
Widget A”;
When specifying a value for the description, you may enter a string of any length.
Icon Clause The Icon clause of the Add Form statement associates a special image with a form.
Choose an icon that has meaning to the user. Icons can visually help a user locate the form
s/he needs by clearly identifying the form function. You can assign a special icon to the
new form or use the default icon. The default icon is used when in view-by-icon mode.
Any special icon you assign is used when in view-by-image mode. When assigning a
unique icon, you must use a GIF image file. Refer to Icon Clause in Chapter 1 for a
complete description of the Icon clause.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Rule Clause Rules are administrative objects that define specific privileges for various Matrix users.
The Rule clause enables you to specify an access rule to be used for the form.
add form NAME rule RULENAME;
Color Clause The Color clause of the Add Form statement specifies color values used as the default
foreground and background for the form.
add form color [FOREGROUND |on BACKGROUND |]
FOREGROUND is the name of the color for the foreground printed information (any
vertical or horizontal lines of information).
BACKGROUND is the name of the color used as an overall background for the form. Note
that the word on is required only if a background color is specified.
For a list of available colors, refer to:
• Windows— \$MATRIXHOME\lib\winnt\rgb.txt.
• UNIX— /$MATRIXHOME/lib/ARCH/rgb.txt.
$MATRIXHOME is where the Matrix application is installed and ARCH is the
UNIX platform.
Header Clause The Header clause of the Add Form statement places a border at the top of the page. It
specifies the number of lines, points, or inches that should be measured down from the top
of the page. While inserting a Header clause defines an upper border, it does not prevent
you from placing information within that border. Header clauses are often used in
conjunction with page titles. You may want to place title information within the header
with the values below it.
Version 10 537
The following statement creates a form named “Material Properties.” Measured in picas,
the form is 80 characters wide and 60 lines long.
add form “Material Properties”
units picas
size 80 60
header 6
Footer Clause The Footer clause of the Add Form statement is similar to the Header clause. It places a
border at the bottom of the page by specifying the number of lines, points, or inches that
should be measured up from the bottom of the page. While inserting a Footer clause
defines a lower border, it does not prevent you from placing information within that
border.
Footer clauses are often used in conjunction with display rules and page footnotes (such as
page numbers or titles). When you define a footer, you are defining where a rule line can
be placed. You may want to place your footnote information below that rule line. This
information might consist of summary values, orientation material (such as a page number
and title), or special information (such as warning flags).
add form “Material Properties”
units picas
size 80 60
footer 6
Margins Clause The Margins clause of the Add Form statement specifies a left and right border on each
page:
add form margins LEFT_MARGIN RIGHT_MARGIN
LEFT_MARGIN is the number of units Matrix should move from the left page edge.
Always specify this value first.
RIGHT_MARGIN is the number of units Matrix should move from the right page edge.
For example, assume you want to include margins in a “Material Properties” form
definition:
add form “Material Properties”
units picas
size 80 60
header 3
footer 3
margins 5 10;
In this example, the left margin is set as five characters in from the left page edge. The
right margin is set as ten characters in from the right page edge. Since the page size is set
as 80 characters, this means that the center working area is equal to 65 characters.
When including a Margins clause in an Add Form statement, you must always specify two
values even if you only want one margin. This enables Matrix to determine which value is
the left margin offset and which is the right. For example, to define only a right margin,
use can use this Margins clause:
margins 0 5
With the inclusion of the Margins clause, you have a working area that is 30 characters
wide. The left margin is at five characters from the left edge and the right margin is at five
characters from the right edge. Since the right edge is at 40 characters, this definition is
equivalent to saying that the right edge is at 35 characters.
Type Clause The Type clause of the Add Form statement lists business types that the form is associated
with. When a business object is highlighted in Matrix and the Form option is selected, any
forms associated with that type of business object are presented.
Size Clause The Size clause of the Add Form statement defines the page dimensions of the form. This
is commonly equal to standard page sizes such as 8½ by 11 inches or 8½ by 14 inches.
However, you are not restricted to these sizes.
A page is a logical unit that you define. Once defined, Matrix will use that definition to
determine where to place the header, footer, and margins. But, Matrix must know the page
size to determine when one page ends and another begins.
To define a page size, you need two numeric values. One represents the width and one
represents the height. Both of these values must be provided and entered according to the
following syntax:
add form size WIDTH HEIGHT
If you wanted the dimensions of a standard page, you would write one of the following
clauses. The clause you use depends on the units you specified in the Units clause.
size 80 66 Measured in picas.
Field Clause The Field clause specifies the values to be printed and their general placement on the
page:
add form field FIELD_TYPE FIELD_DEF
Version 10 539
FIELD_TYPE identifies the general function of the field value being defined. All Field
clauses must include a Field Type subclause which must be given before any defining
subclauses. When specified, the field type identifies the kind of value that will be printed:
The mechanism used for rendering fonts on the Web differs from the one
that is used for Matrix on the desktop. Therefore, forms that are intended
for use in both environments need to be designed to accommodate these
slight differences. Increasing the size of the field will fix the problem.
start XSTART YSTART The X and Y coordinates of the field’s starting point. This is where the first
character of the field value is printed. Refer also to the description of Field
Starting Point below.
size WIDTH HEIGHT The width and height size of the form.
scale PERCENTAGE_VALUE The percentage to scale the form.
href HREF_VALUE For use in Web forms only to provide link data to the JSP.
alt ALT_VALUE For use in Web forms only to display alternate text until any image associated
with the command is displayed and also as “mouse over text.”
range RANGE_HELP_HREF_VALUE For use in Web forms only to specify the JSP that gets a range of values and
populates the field with the selected value. These values can be displayed in a
popup window or a combo box.
update UPDATE_URL_VALUE For use in Web forms only to specify the URL page that should be displayed
after the field is updated.
order NUMBER For use in Web forms only to re-order field items.
add user USER_NAME | all For use in Web forms only to specify who will be allowed access to the field.
remove user USER_NAME | all For use in Web forms only to specify who will not be allowed access to the
field.
add setting NAME VALUE For use in Web forms only. Settings are general name/value pairs that can be
added to a field as necessary. They can be used by JSP code, but not by hrefs
on the Link tab. Also refer to Using Macros and Expressions in Dynamic UI
Components in the Matrix Business Modeler Guide for more details.
remove setting NAME VALUE For use in Web forms only to remove settings.
Version 10 541
For example, you could write the following field description to place a title at the top of
the form:
field label “Daily Customer Form For:”
start @10 @5 size 28 1
This description will start printing the title string “Daily Customer Form For:” in the upper
left corner of the page. Its coordinates, given in picas, indicate ten characters over and five
lines down from the uppermost left corner of the page. Take care to ensure that field sizes
do not conflict with other field locations.
Relative coordinates can begin with 0,0 and are specified in the same general manner as
absolute coordinates:
X_START_VALUE Y_START_VALUE
While the starting point is given as (0,0), this actually translates to an absolute starting
point of (11,6). That is because the starting point for all relative coordinates is the bottom
of the header (the 6th line) and the end of the left margin (11th character). When
specifying the relative coordinates, you will always have to add the header and left margin
values to obtain the absolute coordinates. Therefore a relative position of (28,0) translates
into an absolute position of (39,6).
When specifying the starting point, you can use any combination of relative or absolute
values. Absolute coordinates are useful when you want to print a title within the heading,
footer, or margin areas. You cannot do this using relative coordinates.
Centering the title on the page is done by using the starting point in conjunction with the
Size subclause. The Size subclause specifies the width and height of the field. First
determine the number of characters required to print the title (36 characters) and then
determine the amount of space remaining (80 - 36 = 44). That amount is divided in half to
determine the starting row for the first field (@22). If you add the field size to this starting
value, you find the starting location for the second field (@49).
Like the Start clause of the Add Form statement, the size is given width first and height
second. For example, a value of “Address: ” is nine pica characters long and uses one line.
Therefore, its size could be expressed as:
size 9 1
All geometry subclauses must include the field size. If the size value is larger than the
field value, the field value is padded with blank spaces so that the field and size values are
equivalent. If the size value is smaller than the field value, the field value is truncated on
the right to fit into the field size. Multiple-line text output will wrap at word boundaries if
the form field contains more than one output line.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the form. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add form NAME
property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 543
Copying and/or Modifying a Form
Copying (Cloning) After a form is defined, you can clone the definition with the Copy Form statement. This
a Form Definition statement lets you duplicate defining clauses with the option to change the value of clause
arguments:
copy form FROM_NAME TO_NAME [MOD_ITEM {MOD_ITEM}];
Modifying a Form After a form is defined, you can change the definition with the Modify Form statement.
This statement lets you add or remove defining clauses and change the value of clause
arguments:
modify form NAME [MOD_ITEM {MOD_ITEM}];
Each modification clause is related to the arguments that define the form. To change the
value of one of the defining clauses or add a new one, use the Modify clause that
corresponds to the desired change. For example, use the Size clause of the Modify Form
statement to alter the values of the Size clause used in the Add Form statement. The only
exception to this general rule involves modifying field definitions.
When modifying field definitions within an existing form, you have only two choices.
You can either remove an existing field definition or you can add a new one. The Modify
Form clause does not offer a way to alter the subclause values that make up a field
definition. Therefore, if you are unhappy with a subclause value, you can only remove the
entire field definition and replace it with one that has the desired changes in it.
New field definitions appear at the end of the form definition. While they are listed last,
their placement in the form definition does not affect the placement of the form values.
That is controlled by the geography and size values within the field definitions
themselves.
Version 10 545
Deleting a Form
If a form is no longer required, you may delete it by using the Delete Form statement:
delete form NAME;
After this statement is processed, the form is deleted and you receive an MQL prompt for
another statement.
Use the Print Form statement to print information about the attributes of a specific form,
including the number and characteristics of each form field.
print form NAME [SELECT];
Form TechTip
inactive
Version 10 547
field# 4 select "attribute[Reason]"
color on lemon chiffon
font Times New Roman-10
autoheight false
autowidth false
drawborder true
multiline true
edit true
hidden false
start 22 44
size 75 8
user all
nothidden
created Fri Jun 22, 2001 8:16:45 PM EDT
modified Fri Jun 22, 2001 8:16:45 PM EDT nothidden
created Wed Oct 31, 2001 2:57:09 PM EST
modified Wed Feb 20, 2002 2:47:56 PM EST
Since forms have additional uses in support of dynamic UI modeling, the MQL print
command suppresses the output of data that is not used. For example, if you print a form
that is defined as a system object used for Web applications, the following selects will not
be printed:
size, minsize, scale, font, minwidth, minheight, absolutex, absolutey, xlocation,
ylocation, width, and height.
Conversely, when printing non-Web forms, parameters used only for Web forms are
suppressed from the output:
href, alt, range, update, and settings
Version 10 549
Overview of Administration Properties
Properties can be created and attached to an object at the same time using the add
property command. A property must have a name and be “on” an object. It can,
optionally, define a link to another administrative object using the “to” clause. This
command, therefore, takes two forms, with and without the “to” clause.
add property NAME on ADMIN_TYPE ADMIN_NAME [system] [to
ADMIN_TYPE ADMIN_NAME] [system] [value VALUE];
A Format property could be added to other Programs as well. And other perl programs
would be added “to” the Perl Format. However, the properties are unique in that the “on”
object would differ.
Version 10 551
Adding Properties A property can be added to an administrative object in three ways:
to Administrative • It can be added using the property command, as shown above.
Definitions • In addition, a property can be added when an administrative object or workspace
object is created, using the property clause with the add statement.
• A third way is within the modify statement for administrative/workspace objects.
add ADMIN_TYPE ADMIN_NAME add property NAME [to ADMIN_TYPE ADMIN_NAME] [value VALUE];
modify ADMIN_TYPE ADMIN_NAME add property NAME [to ADMIN_TYPE ADMIN_NAME] [value
VALUE];
For example, the following are equivalent to the command given above:
add program Perlscript add property Format to Format Perl value yes;
modify program Perlscript add property Format to Format Perl value yes;
Adding Properties Properties can be added to the logged on user’s personal workspace objects. For example,
to User Workspace the following adds the date property to the set MYSET:
Items add property Date to set Myset value 4/19/99;
Workspace objects include filters, cues, queries, tips, tables, sets, toolsets, and views.
Modifying The value of a property can be modified using either the modify property or
Properties modify ADMIN statements.
modify property NAME on ADMIN_TYPE ADMIN_NAME [to ADMIN_TYPE ADMIN_NAME] [value VALUE];
modify ADMIN_TYPE ADMIN_NAME property NAME [to ADMIN_TYPE ADMIN_NAME] [value VALUE];
This command will create the property if it does not exist or will modify its value if it
does. If other changes are required (for example, changing any ADMIN values) the
property should be deleted and redefined.
Listing Properties Properties can be listed with the list property command, which takes the following
forms:
list property [system] [on ADMIN_TYPE ADMIN_NAME];
The System option is used to list the system-defined properties. Without it, only
user-defined properties are listed.
The user option is for workspace properties. If all is indicated as the user, all properties
on all Persons’ workspace items will be displayed. USER_NAME is the name of the
person.
The following should be noted:
• All properties on an administrative object or on a user’s workspace objects can be
listed.
• Currently only person users have workspace objects.
• The “on” and “user” clauses cannot be used together.
• The all keyword goes with the user clause—either a Person or all is specified.
ADMIN_TYPE ADMIN_NAME here could be a workspace object (table, set, tip, etc.) of the
current user, or a non-workspace object.
Selecting The properties of administrative objects are selectable, using the following syntax:
Properties print ADMIN_TYPE ADMIN_NAME select property;
The above will list all user properties associated with the specified administrative object,
including their name, their “to” object, and their values. To further refine the list you can
also select the following:
property.name
property.value
property.to
Version 10 553
For example:
MQL<12>print program Perlscript select property;
program Perlscript
property = Format to Format Perl value 4
MQL<13>print program Perlscript select property.name;
program Perlscript
property[Format].name = Format
MQL<14>print program Perlscript select property.value;
program Perlscript
property[Format].value = 4
MQL<15>print program Perlscript select property.to;
program Perlscript
property[Format].to = Format Perl
Version 10 555
Aliases Defined
Matrix is in use around the world and is designed to support the use of multiple languages.
Menus and messages can be translated and imported using the language import
mechanism in the System Manager application. Double-byte characters are also supported
for the wider Asian alphabets. But for global companies, with offices in several countries,
there is a need to use the same database in several languages. Toward this end, aliases are
provided to display and choose administrative object names in any number of languages,
for desktop and Matrix Navigator users. When displayed to the user, be it a human or a
program, the chosen language is used. Likewise, any localized name, when fed into the
system, will be mapped to its original name in the database.
Note that the term “language” is being used loosely here. There is no reason why two
shops in the US can’t use different English terms to mean the same thing. One shop might
use the term “widget” while the other shop uses the term “gadget.” There may even be a
need to provide mappings in terminology between departments within the same shop. For
example, a design department may use different terms than the manufacturing department,
but still be talking about the same thing.
The chosen language can be temporarily overridden, such as during execution of a
program, and then easily reset to the chosen language.
Aliases are not supported in applications that use the symbolic naming of the Application
Exchange Framework, including all MatrixOne applications. Java properties files are
used for localizing schema in that environment, and aliases should not also be configured.
Alias Properties An administrative object can have any number of alias properties, consisting of an
identifier and an alias. That is, the name of the alias will identify the language, and its
value of will be the administrative name in that language. You must be a Business
Administrator to add aliases to any existing administrative object.
What Remains in Aliases provide a powerful way to share data in a global economy. However, there are
Base Language limits to what is included in this type of localization. The following stored text will be
displayed in the base language:
• Business object attribute values
• Business object names and revisions
• Checked in files
• Object descriptions
• Program code
• MQL keywords
• Matrix keywords used in where clauses when defining Queries, Cues, Tips, etc.
Since attribute ranges can be defined to be a program, attribute values could be
programmatically translated at run time. Also, third party tools may be available for
on-the-fly translations of descriptions and ingested files. However, keywords should NOT
be translated in this way, as they would then not be recognized as such.
Version 10 557
Working with Language Aliases
Business Administrators can create any number of aliases for all administrative objects.
This includes objects created in the System Manager application, as well as the Business
Modeler Application. Aliases are added using the MQL application.
Add Statement The add alias command is used to add a alias to any existing administrative object.
add alias NEWNAME to ADMIN_TYPE ADMIN_NAME [aliasname NAME];
The aliasname clause is optional. If a NAME is not specified, the alias is added to the
current language. If aliasing is not active or no language is chosen, the aliasname clause
must be specified when adding an alias or an error will result.
For example:
add alias susie to person jones aliasname nicknames;
In the above example, the nicknames language would contain the alias “susie” for the
person “jones.”
It is possible to give two different administrative objects of the same type the same alias
name. This should be avoided, since doing so may result in unsatisfactory behavior.
Modify Statement Aliases can be edited using the modify alias command:
modify alias NEWNAME on ADMIN_TYPE ADMIN_NAME [aliasname NAME];
Delete Statement In order to delete aliases, they must be removed from each administrative object using the
delete alias command:
delete alias NAME from ADMIN_TYPE ADMIN_NAME [aliasname NAME];
Pass a NAME parameter to redefine the current language. To turn off aliasing, simply
push an alias with no name (that is, do not supply a language name).
To reset aliasing back to its original state, use the pop command:
pop alias;
For example, if aliasing is in use and the Business Administrator needs to set up another
language, the program that adds the aliases for the new language should first push the
current language, then add all the required new aliases, and finally pop the language to
reset the original aliases.
Implementation Even when aliasing is active, the internal, native name of an administrative object can be
Issues used. However, confusion may arise if an alias for one object maps to the internal name of
another. The system would find the alias first, and so that is what it would use. However,
because of the possibility of unexpected results, this scenario should be avoided.
System performance will be affected when aliasing is turned on as a result of the internal
search required for the mapping phase. As for storage issues related to alias properties,
properties are extremely lightweight and this shouldn’t be a concern.
Version 10 559
560 MQL Guide
25
Working With Pages
Overview........................................................................................................ 562
Defining a Page Object................................................................................. 563
Content Clause ............................................................................................... 563
Description Clause.......................................................................................... 564
File Clause...................................................................................................... 564
Icon Clause..................................................................................................... 564
Mime Clause................................................................................................... 565
Hidden Clause ................................................................................................ 565
Property Clause .............................................................................................. 565
Copying (Cloning) a Page Definition .......................................................... 566
Modifying a Page Definition......................................................................... 567
Deleting a Page ............................................................................................. 568
Supporting Alternate Languages and Display Formats............................ 569
Version 10 561
Overview
A page is a type of Matrix administrative object that is used to create and manage
properties for Java applications. Matrix first looks for a property file using the classpath,
but if the file is not found, it looks for a page object of the same name. In a distributed
environment, such as a RMI gateway configuration, this allows you to centralize all
property files and propagate updates immediately.
In environments that use both desktop Matrix and MatrixOne applications, when
emxSystem.properties and emxFrameworkStringResource.properties (including translated
versions of the later) are stored in the database, certain errors can be avoided.
You can use MQL commands to create, delete, copy, modify, print, and list to manage
page objects.
As a Business Administrator, you can create new page objects that can be used in Web
page design. A page object requires code that defines a page or a part of a page. The are
two ways to specify the code for a page:
• Enter the code as value for the content command.
• Write the code in another editor and save the file, then include the name of the file in
the file command.
Use the Add Page command to define a new page:
add page NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name you assign to the page. Page names must be unique. The name you
choose is the name that will be referenced to include this page within a Web page. The
page name is limited to 127 characters.
ADD_ITEM is an Add Page clause that provides additional information about the page
you are defining. The Add Page clauses are:
content VALUE
description VALUE
file FILENAME
icon FILENAME
mime VALUE
[!|not]hidden
All clauses are optional for defining a page, since the page can later be modified. But to be
used in a Web page, you must include either content or a file. Each clause and the
arguments they use are discussed in the sections that follow.
Content Clause The Content clause of the Add Page command is used to add code that defines the Web
page. Content can consist of embedded tags and text.
content VALUE;
VALUE can be any combination of code and text that is displayable in a Web browser,
including HTML, XHTML, XML, JavaScript, Matrix tags, CSS, etc. If the code contains
embedded double quotes, use single quotes to define the start and end of the content.
Version 10 563
For example, you can define the following page, which might be included as a footer on
every page within an application:
add page IncludeFooter
content ’<a href="http://www.XYZCorp.com">XYZ Corporation</a><br>
Voice: (555) 123-4567<br>
Fax: (555) 123-4568<br>
<a href="mailto:[email protected]">[email protected]</a><br>
<a href="mailto:[email protected]">[email protected]</a><br>’
As an alternative, you can write the code for the page in a separate file and use the File
Clause to include the page content in the page definition.
Legal characters in XML are the tab, carriage return, line feed, and the legal graphic
characters of Unicode, that is, #x9, #xA, #xD, and #x20 and above (HEX). Therefore,
other characters, such as those created with the ESC key, should not be used for ANY field
in Matrix, including business and administrative object names, description fields,
program object code, or page object content.
Description The Description clause of the Add Page command provides general information for
Clause you and the user about the function, use, or content of the page. There may be subtle
differences between pages; the description clause points out the differences to the user.
The description can consist of a prompt, comment, or qualifying phrase. There is no limit
to the number of characters you can include in the description.
For example, if you were defining a page named “Cost Specification”, you might write an
Add Page statement with a description clause similar to one of the following. The
information in each page might differ considerably.
add page “Cost Specification”
description “Costs for developing new product features for Widget A”;
add page “Cost Specification”
description “Cost specifications for Widget A”;
add page “Cost Specification”
description “Monthly costs for supporting field testing of Widget B”;
File Clause The File clause of the Add Page command specifies a file that contains the code that
constitutes the page. This is provided as an alternative to the Content Clause. With the File
clause, you can type and save the code in any editor of your choice.
file FILENAME;
For example, you might create a file that contains the frameset that is used to display your
Web pages. You could create a page object named InitialFrame to store this data.
add page InitialFrame
file InitialFrame.jsp;
Icon Clause You can assign a special icon to the new page. Icons help users locate and recognize
items. When assigning an icon, you must select a GIF format file.
Mime Clause The Mime clause of the Add Page command associates a MIME (Multi-Purpose Internet
Mail Extension) type with a page. It defines the content type of the file named in the File
Clause.
mime VALUE;
VALUE is the content type of the file. The format of value is a type and subtype separated
by a slash. For example, text/plain or text/jsp.
The major MIME types are application, audio, image, text, and video. There are a variety
of formats that use the application type. For example, application/x-pdf refers to Adobe
Acrobat Portable Document Format files. For information on specific MIME types (which
are more appropriately called “media” types) refer the Internet Assigned Numbers
Authority Website at http://www.isi.edu/in-notes/iana/assignments/media-types/. The
IANA is the repository for assigned IP addresses, domain names, protocol numbers, and
has also become the registry for a number of Web-related resources including media
types.
Hidden Clause You can specify that the new page is “hidden” so that it does not appear in the chooser in
Matrix. Users who are aware of the hidden page’s existence can enter its name manually
where appropriate. Hidden objects are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called properties, to the page. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add page NAME
property NAME [to ADMINTYPE NAME] [value STRING];
Version 10 565
Copying (Cloning) a Page Definition
After a page is defined, you can clone the definition with the Copy Page command. This
command lets you duplicate defining clauses with the option to change the value of clause
arguments:
copy page SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Use the Modify Page command to change the definition of an existing page object.
This command lets you add or remove defining clauses and change the value of clause
arguments:
modify page NAME [MOD_ITEM {MOD_ITEM}];
As you can see, each modification clause is related to the clauses and arguments that
define the page. For example, you would use the Name clause of the Modify Page
command to change the name for the page file.
Version 10 567
Deleting a Page
If a page is no longer required, you can delete it by using the Delete Page command:
delete page NAME;
After this command is processed, the page is deleted and you receive an MQL prompt for
another command.
For global database access, pages generally need to be provided in multiple languages.
And with the wide use of cell phones and other hand-held devices in accessing Web pages,
you may also need to support the page’s display on a small LCD in wireless markup
language (wml). When this is the case, you can use the following ADK call to open a page
with a language and format argument, following the syntax:
open(BASE_PAGE_NAME, LANG, MIMETYPE)
For example:
open(login.jsp, fr, wml)
When evaluating this code, the system first looks for the file named
login_fr_wml.jsp. If this page is not found, it then attempts to find
login_wml.jsp. As a last resort, it searches for the page login.jsp. Of course, you
could call login_fr_wml.jsp directly, but the addition of arguments gives you much
more flexibility when writing the code.
In this case, you would first create login.jsp. Next, if you wanted to support wml, you
would then create the wireless version of the page and name it login_wml.jsp. Then
for each language you want to support, you would translate the text portions of the page(s)
and save as login_LANG.jsp and login_LANG_wml.jsp. For example, to support
multiple languages you might have pages with the following names in the database:
login.jsp
login_ch-tw.jsp
login_ch-gb.jsp
login_it.jsp
To then add support for wml for these languages, you might add the following pages:
login_wml.jsp
login_ch-tw_wml.jsp
login_ch-gb_wml.jsp
login_it_wml.jsp
Note that the base page does not have to be in English. Also, the LANG argument could
be more than two characters, such as en-us, en-uk, or ch-tw.
Version 10 569
570 MQL Guide
26
Working With Resources
Overview........................................................................................................ 572
Defining a Resource ..................................................................................... 573
Description Clause.......................................................................................... 573
File Clause...................................................................................................... 573
Mime Clause................................................................................................... 574
Icon Clause..................................................................................................... 574
Hidden Clause ................................................................................................ 574
Property Clause .............................................................................................. 574
Copying (Cloning) a Resource Definition................................................... 575
Modifying a Resource Definition................................................................. 576
Deleting a Resource ..................................................................................... 577
Supporting Alternate Languages and Display Formats............................ 578
Version 10 571
Overview
A resource is a Matrix administrative object that stores binary files of any type and size.
Matrix applications use resources to display output to a standard Web browser or a small
LCD device by providing components for Web pages. They are often .gif images, but they
could be movie or video files or any resource that you use in a Web application, including:
• GIF
• JPEG
• MPEG
• AVI
• WAV
• JAR
• CAB
For example, you can include in the database a resource that represents the company
corporate logo. In a Web application, the company corporate logo may be referred to
many times.
The resource editor allows you to name the administrative definition, give it a description,
and define a MIME (Multi-Purpose Internet Mail Extension) type that is used to ensure
that the browsers know what kind of component this is. For example, the company
corporate logo could be an image/gif MIME type, indicating that it is a .gif file that should
be rendered in the browser.
You can use standard MQL commands such as create, delete, copy, modify, print, and list
to manage resources. You can also create, modify, and delete resources using the Matrix
Business Modeler application. Specialized functions and embedded commands facilitate
evaluation, translation, or formatting of Matrix objects or output on HTML pages.
NAME is the name you assign to the resource. The name you choose is the name that will
be referenced to include this resource within a Web page. Resource names must be
unique. The resource name is limited to 127 characters.
ADD_ITEM is an Add Resource clause that provides additional information about the
resource you are defining. The Add Resource clauses are:
description VALUE
file FILENAME
mime VALUE
icon FILENAME
[!|not]hidden
All clauses are optional for defining a resource, since the resource can later be modified.
But to be used in a Web page, at least the file and MIME type must be defined. Each
clause and the arguments they use are discussed in the sections that follow.
Description The Description clause of the Add Resource command provides general information for
Clause you and the user about the function of the resource. There may be subtle differences
between resources; the Description clause points out the differences to the user.
The description can consist of a prompt, comment, or qualifying phrase. There is no limit
to the number of characters you can include in the description.
For example, if you were defining a resource named “Corporate Logo”, you might write
an Add Resource statement with a Description clause similar to one of the following.
add resource “Corporate Logo”
description “Small size for use in page footer”;
add resource “Corporate Logo”
description “Large size logo for use in banners”;
File Clause The File clause of the Add Resource command defines the binary file that contains the
resource. This is often a .gif or other image file, but they can be any resource that you use
in a Web application.
file FILENAME;
For example, to define a resource for the company logo, you could use:
add resource Logo
file Matrixlogo.gif;
Version 10 573
Mime Clause The mime clause of the Add Resource command associates a MIME (Multi-Purpose
Internet Mail Extension) type with a resource. It defines the content type of the file.
mime VALUE;
Value is the content type of the file. The format of value is a type and subtype
separated by a slash. For example, image/gif or video/mpeg.
The major MIME types are application, audio, image, text, and video. There are a variety
of formats that use the application type. For example, application/x-pdf refers to Adobe
Acrobat Portable Document Format files. For information on specific MIME types (which
are more appropriately called “media” types) refer the Internet Assigned Numbers
Authority Website at http://www.isi.edu/in-notes/iana/assignments/media-types/. The
IANA is the repository for assigned IP addresses, domain names, protocol numbers, and
has also become the registry for a number of Web-related resources including media
types.
Icon Clause You can assign a special icon to the new resource or use the default icon. The default icon
is used when in view-by-icon mode. Any special icon you assign is used when in
view-by-image mode.
GIF filenames should not include the @ sign, as that is used internally by Matrix.
Hidden Clause You can specify that the new resource is “hidden” so that it does not appear in the chooser
in Matrix. Users who are aware of the hidden resource’s existence can enter its name
manually where appropriate. Hidden objects are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called properties, to the resource. Properties let
you define associations between administrative objects. The property information can
include a name, a string value, and a reference to another administration object. The
property name is always required. The value string and object reference are both optional.
add resource NAME
property NAME [to ADMINTYPE NAME] [value STRING];
After a resource is defined, you can clone the definition with the Copy Resource
command. This command lets you duplicate defining clauses with the option to change the
value of clause arguments:
copy resource SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Version 10 575
Modifying a Resource Definition
Use the Modify Resource command to change the definition of an existing resource. This
command lets you add or remove defining clauses and change the value of clause
arguments:
modify resource NAME [MOD_ITEM {MOD_ITEM}];
As you can see, each modification clause is related to the clauses and arguments that
define the Resource.
If a resource is no longer required, you can delete it using the Delete Resource command:
delete resource NAME;
Version 10 577
Supporting Alternate Languages and Display
Formats
For global database access, resources generally need to be provided in multiple languages.
And with the wide use of cell phones and other hand-held devices in accessing Web pages,
you may also need to support the resource’s display on a small LCD in wireless markup
language (wml). When this is the case, you can use the following ADK call to open a
resource with a language and format argument, following the syntax:
open(BASE_RESOURCE_NAME, LANG, MIMETYPE)
For example:
open(logo.gif, fr, wml)
When evaluating this code, the resource servlet first looks for the file named
logo_fr_wml.gif. If the servlet does not find this resource object, it attempts to find
logo_wml.gif. As a last resort, it searches for the resource logo.gif. Of course,
you could call login_fr_wml.gif directly, but the addition of arguments gives you
much more flexibility when writing the code.
In this case, you would first create logo.gif, and then create the wireless version of the
resource (generally a much smaller version) and name it logo_wml.gif. Then, for each
language that requires a different version of the resource (a translated textual image, a
sound byte, or even a pure image that, due to cultural differences, requires a localized
version) you would create the different resource files and reference them in a new
resource object and save as logo_LANG.gif and logo_LANG_wml.gif. For
example, to support multiple languages, you may have resources with the following
names in the database:
logo.gif
logo_ch-tw.gif
logo_ch-gb.gif
logo_it.gif
To add support for wml, you might add the following resource:
logo_wml.gif
In this case, all languages would use the same wml resource.
Note that the base resource does not have to be in English. Also, the LANG argument
could be more than two characters, such as en-us, en-uk, or ch-tw.
Version 10 579
Commands Defined
Matrix Business Administrators can create new command objects if they have the Menu
administrative access. Commands can be used in any kind of menu in a JSP application.
Commands may or may not contain code, but they always indicate how to generate
another Web page. Commands are child objects of menus — commands are created first
and then added to menu definitions, similar to the association between Matrix types and
attributes. Changes made in any definition are instantly available to the applications that
use it.
Commands can be role-based, that is, only shown to particular users. For example, a
number of commands may only be available when a person is logged in as a user defined
as Administrator. When no users are specified in the command definitions, they are
globally available to all users.
To define a command from within MQL use the Add Command statement:
add command NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the command you are defining. Command names cannot include
asterisks. The name you choose is the name that will be referenced to include this
command within a menu.
You cannot have both a command and a menu with the same name.
ADD_ITEM is an Add Command clause that provides additional information about the
command. The Add Command clauses are:
description STRING_VALUE
icon IMAGE_PATH
label VALUE
href VALUE
alt VALUE
code VALUE
file FILENAME
Each clause and the arguments they use are discussed in the sections that follow.
Description The Description clause of the Add Command statement provides general information
Clause about the function of the command. Since there may be subtle differences between
commands, you can use the description clause to point out the differences.
The description can consist of a prompt, comment, or qualifying phrase. There is no limit
to the number of characters you can include in the description.
For example, if you were defining a command named “Cost Evaluator” you might write a
Description clause similar to one of the following. Each command might differ
considerably.
description "Figures cost based on wholesale prices"
description "Figures cost based on discounted prices"
description "Figures monthly costs for field testing of Widget B"
Version 10 581
Icon Clause You can assign a special icon to the new command. Icons help Business Administrators
locate and recognize items. When assigning an icon, you must select a .gif format file. The
icon assigned to a command is used only within Business Modeler and not in the Web
page that contains the command.
The icon assigned to a command is also considered the ImageIcon of the command. When
an object is viewed as either an icon or ImageIcon, the .gif file associated with it will be
displayed.
Label Clause The Label clause of the Add Command statement specifies the label to appear in the menu
in which the command is assigned. For example, many desktop applications have a File
menu with options labeled “Open” and “Save.”
Href Clause The Href clause of the Add Command statement is used to provide link data to the href
HTML commands on the Web page that references the command. This field is optional,
but generally an href value is included.
The syntax is:
href VALUE;
Assigning an href to a link can create problems if a user clicks the same link twice when
initiating such actions as changing an object’s state or submitting a form. The reason for
this is that an href assigned to a link is considered a server request, even if it is a JavaScript
command. Whenever the browser detects a server request, the browser stops processing
the current request and sends the new request. Therefore, when a user first clicks on an
href link, the request is processed, and typically, a JSP page starts executing. If, during this
time, a user clicks the same link again, the first request is interrupted before completion
and the new request is processed instead.
To avoid this scenario, you can set the href to “#” and use the onclick event instead. The
generic code for this is:
<a href="#" onclick="submitForm()">
Alt Clause The Alt clause of the Add Command statement is used to define text that is displayed until
any image associated with the command is displayed and also as “mouse over text.”
The syntax is:
alt VALUE;
File Clause The File clause of the Add Command statement is used to specify the file that contains the
code for the command when the code is written in an external editor.
The syntax is:
file FILENAME;
FILENAME is the name of the file that contains the code for the command.
User Clause The User clause of the Add Command statement is used to define the users allowed to see
the command.
Any number of roles, groups, persons, and/or associations can be added to the command
(role-based in this case includes all types of users and is not limited to only Matrix roles).
The syntax is:
user NAME {,NAME};
NAME is the name of the user(s) who have access to see the command.
Or
user all;
If the user clause is not included, all users are given access to the command.
Setting Clause The Setting clause of the Add Command statement is used to provide any name/value
pairs that the menu may need. They can be used by JSP code, but not by hrefs on the Link
tab. Refer to Parameters and Settings for Commands in the Application Exchange
Framework Guide for appropriate settings for the type of menu you are creating. Also
refer to Using Macros and Expressions in Configurable Components for more details.
The syntax is:
setting NAME [STRING];
Version 10 583
For example, an image setting with the image name can be specified to display when the
menu is used in a toolbar:
setting Image iconSmallMechanicalPart.gif;
Property Clause Integrators can assign ad hoc attributes, called Properties, to the command. Properties
allow associations to exist between administrative definitions that aren’t already
associated. The property information can include a name, an arbitrary string value, and a
reference to another administration object. The property name is always required. The
value string and object reference are both optional. The property name can be reused for
different object references, that is, the name joined with the object reference must be
unique for any object that has properties.
add command NAME property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Copying (Cloning) After a command is defined, you can clone the definition with the Copy Command
a Command statement. Cloning a Command definition requires Business Administrator privileges,
Definition except that you can copy a Command definition to your own context from a group, role or
association in which you are defined.
This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy command SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Modifying a The List Command statement is used to display a list of all commands that are currently
Command defined. It is useful in confirming the existence or exact name of a command that you want
to modify, since Matrix is case-sensitive.
list command [modified after DATE] NAME_PATTERN [select FIELD_NAME {FIELD_NAME}] [DUMP
[RECORDSEP]] [tcl] [output FILENAME];
For details on the List statement, see List Admintype Statement in Chapter 1.
Use the list of all the existing commands along with the Print statement to determine the
search criteria you want to change.
Use the Modify Command statement to add or remove defining clauses and change the
value of clause arguments:
modify command NAME [MOD_ITEM {MOD_ITEM}];
Version 10 585
MOD_ITEM is the type of modification you want to make. Each is specified in a Modify
Command clause, as listed in the following command. Note that you need specify only the
fields to be modified.
Each modification clause is related to the arguments that define the command. To change
the value of one of the defining clauses or add a new one, use the Modify clause that
corresponds to the desired change.
When modifying a command, you can make the changes from a script or while working
interactively with MQL.
• If you are working interactively, perform one or two changes at a time to avoid the
possibility of one invalid clause invalidating the entire statement.
• If you are working from a script, group the changes together in a single Modify
Command statement.
If a command is no longer required, you can delete it using the Delete Command
statements
delete command NAME:
After this statement is processed, the command is deleted and you receive an MQL prompt
for another statement.
Version 10 587
Using Macros and Expressions in Configurable
Components
Many strings used in the definition of configurable Components (such as label values,
hrefs, and settings) can contain embedded macros and select clauses. The ${} delimiters
identify macro names. Macros are evaluated at run-time. Macros for configurable
components are available for directory specification. Some existing macros are also
supported (refer to Supported Macros and Selects for more information).
Some strings can also include select clauses which are evaluated against the
appropriate business object at run-time. The $<> delimiters identify select clauses.
Because the select clauses will generally use symbolic names, the clauses will be
preprocessed to perform any substitutions before submitting for evaluation. The following
example shows a macro being used in the href definition and another macro being used in
the Image setting, as well as a select clause being used in the label definition of a tree
menu (associated with a LineItem object):
MQL<2>print menu type_LineItem;
menu type_LineItem
description
label '$<attribute[attribute_EnteredName].value>'
href '${SUITE_DIR}/emxQuoteLineItemDetailsFS.jsp'
setting Image value ${COMMON_DIR}/iconSmallRFQLineItem.gif
setting Registered Suite value SupplierCentralSourcing
children
command SCSAttachment
command SCSAttributeGroup
command SCSHistory
command SCSSupplierExclusion
command SCSUDA
nothidden
property original name value type_LineItem
property installed date value 02-28-2002
property installer value MatrixOneEngineering
property version value Verdi-0-0-0
property application value Sourcing
created Thu Feb 28, 2002 11:12:34 AM EST
modified Thu Feb 28, 2002 11:12:34 AM EST
The following example shows a typical business object macro being used in the label
definition of a tree menu (associated with a Company object):
MQL<3>print menu type_Company;
menu type_Company
description
label '${NAME}'
href '${SUITE_DIR}/emxTeamCompanyDetailsFS.jsp'
setting Image value ${COMMON_DIR}/iconSmallOrganization.gif
setting Registered Suite value TeamCentral
children
command TMCBusinessUnit
command TMCLocation
command TMCPeople
nothidden
property original name value type_Company
property installed date value 02-28-2002
property installer value MatrixOneEngineering
When using a macro, surround it with quotes to ensure proper substitution if a value
contains spaces.
Supported Macros The following sections provide lists of macros used in the configuration parameters of the
and Selects administrative menu and command objects found in the AEF. These menu and command
objects are used for configuring the Menus/Trees/Actionbars in the MatrixOne
applications that use them. These are the only macros currently supported for use in any
dynamic UI component.
Directory Macros
The following table provides the list of directory specific macros used in the configuration
setting.
Directory Macros
${COMMON_DIR} To substitute the “common” directory below “ematrix” directory. The substitution is done
with reference to any application specific directory and it is relative to the current directory.
${ROOT_DIR} To substitute the “ematrix” directory. The substitution is done with reference to any
application specific directory below “ematrix” and it is relative to the current directory.
${SUITE_DIR} The macro to substitute the application specific directory below “ematrix” directory. The
substitution is done based on the “Suite” to which the command belongs. and it is relative to
the current directory.
Version 10 589
590 MQL Guide
28
Working With Menus
Menus Defined .............................................................................................. 592
Creating a Menu............................................................................................ 593
Description Clause.......................................................................................... 593
Icon Clause..................................................................................................... 593
Label Clause................................................................................................... 594
Href Clause..................................................................................................... 594
Alt Clause ....................................................................................................... 594
Menu Clause................................................................................................... 594
Command Clause ........................................................................................... 595
Setting Clause ................................................................................................ 595
Property Clause .............................................................................................. 595
Copying and/or Modifying a Menu .............................................................. 596
Copying (Cloning) a Menu Definition .............................................................. 596
Modifying a Menu ........................................................................................... 596
Deleting a Menu ............................................................................................ 599
Version 10 591
Menus Defined
Matrix Business Administrators can create new menu objects if they have the Menu
administrative access. Menus can be used in custom Java applications. Before creating a
menu, you must define the commands that it will contain, since commands are child
objects of menus — commands are created first and then added to menu definitions,
similar to the association between Matrix types and attributes. Changes made in any
definition are instantly available to the applications that use it. Menus can be designed to
be toolbars, action bars, or drop-down lists of commands.
To define a menu from within MQL use the Add Menu statement:
add menu NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the menu you are defining. Menu names cannot include asterisks.
You cannot have both a command and a menu with the same name.
ADD_ITEM is an Add Menu clause that provides additional information about the menu.
The Add Menu clauses are:
description STRING_VALUE
icon IMAGE_PATH
label VALUE
href VALUE
alt VALUE
Each clause and the arguments they use are discussed in the sections that follow.
Description The Description clause of the Add Menu statement provides general information about the
Clause function of the menu. Since there may be subtle differences between menus, you can use
the description clause to point out the differences.
The description can consist of a prompt, comment, or qualifying phrase. There is no limit
to the number of characters you can include in the description.
For example, if you were defining a menu named “Tools” you might write a Description
clause similar to one of the following. Each menu might differ considerably.
description "Drawing Tools"
description "Tools to figure cost"
description "Shortcut Tools"
Icon Clause Icons help users locate and recognize items by associating a special image with a menu.
You can assign a special icon to the new menu or use the default icon. The default icon is
used when in view-by-icon mode. Any special icon you assign is used when in
view-by-image mode. When assigning a unique icon, you must use a .gif image file. Refer
to Icon Clause in Chapter 1 for a complete description of the Icon clause.
Version 10 593
.gif filenames should not include the @ sign, as that is used internally by Matrix.
Label Clause The Label clause of the Add Menu statement specifies the label to appear in the
application in which the menu is assigned. For example, many desktop applications have a
File menu.
Href Clause The Href clause of the Add Menu statement is used to provide link data to the JSP. The
Href link is evaluated to bring up another page. Many menus will not have an Href value
at all. However, menus designed for the “tree” menus require an Href because the root
node of the tree causes a new page to be displayed when clicked. The Href string generally
includes a fully-qualified JSP filename and parameters, which can contain embedded
macros and expressions for mapping to database schema. Refer to Using Macros and
Expressions in Configurable Components for more details.
The syntax is:
href VALUE;
Alt Clause The Alt clause of the Add Menu statement is used to define text that is displayed until any
image associated with the menu is displayed and also as “mouse over text.”
The syntax is:
alt VALUE;
Menu Clause The Menu clause of the Add Menu statement is used to specify existing menus to be added
to the menu you are creating. The menus will be displayed in the order in which they are
added. Separate items with a comma.
The syntax is:
menu NAME {,NAME};
Setting Clause The Setting clause of the Add Menu statement is used to provide any name/value pairs
that the menu may need. They can be used by JSP code, but not by hrefs on the Link tab.
Refer to Parameters and Settings for Commands in the Application Exchange Framework
Guide for appropriate settings for the type of menu you are creating. Also refer to Using
Macros and Expressions in Configurable Components for more details.
The syntax is:
setting NAME [STRING];
For example, an image setting with the image name can be specified to display when the
menu is used in a toolbar:
setting Image iconSmallMechanicalPart.gif;
Property Clause Integrators can assign ad hoc attributes, called Properties, to the menu. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add menu NAME property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 595
Copying and/or Modifying a Menu
Copying (Cloning) After a menu is defined, you can clone the definition with the Copy Menu statement.
a Menu Definition Cloning a menu definition requires Business Administrator privileges, except that you can
copy a menu definition to your own context from a group, role or association in which you
are defined.
This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy menu SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Modifying a Menu The List Menu statement is used to display a list of all menus that are currently defined. It
is useful in confirming the existence or exact name of a menu that you want to modify,
since Matrix is case-sensitive.
list menu [modified after DATE] NAME_PATTERN [select FIELD_NAME {FIELD_NAME}] [DUMP
[RECORDSEP]] [tcl] [output FILENAME];
For details on the List statement, see List Admintype Statement in Chapter 1.
Use the list of all the existing menus along with the Print statement to determine the
search criteria you want to change.
Use the Modify Menu statement to add or remove defining clauses and change the value
of clause arguments:
modify menu NAME [MOD_ITEM {MOD_ITEM}];
Each modification clause is related to the arguments that define the menu. To change the
value of one of the defining clauses or add a new one, use the Modify clause that
corresponds to the desired change.
When modifying a menu, you can make the changes from a script or while working
interactively with MQL.
• If you are working interactively, perform one or two changes at a time to avoid the
possibility of one invalid clause invalidating the entire statement.
• If you are working from a script, group the changes together in a single Modify Menu
statement.
Version 10 597
Another example is given below showing the before and after effect of ordering.
In order to make this change you would have to issue the following command in MQL:
modify menu MyMenu order command C1 2 order command C2 3;
If a menu is no longer required, you can delete it using the Delete Menu statement
delete menu NAME:
After this statement is processed, the menu is deleted and you receive an MQL prompt for
another statement.
Version 10 599
600 MQL Guide
f 29
Working With Inquiries
Inquiries Defined........................................................................................... 602
Creating an Inquiry ....................................................................................... 603
Description Clause.......................................................................................... 603
Icon Clause..................................................................................................... 603
Pattern Clause ................................................................................................ 603
Format Clause ................................................................................................ 604
Code Clause ................................................................................................... 604
File Clause...................................................................................................... 605
Argument Clause ............................................................................................ 605
Property Clause .............................................................................................. 605
Copying and/or Modifying an Inquiry ......................................................... 606
Copying (Cloning) an Inquiry Definition .......................................................... 606
Modifying an Inquiry........................................................................................ 606
Evaluating an Inquiry ................................................................................... 608
Deleting a Inquiry.......................................................................................... 609
Version 10 601
Inquiries Defined
Matrix Business Administrators can create new inquiry objects if they have the Inquiry
administrative access. Inquiries can be evaluated to produce a list of objects to be loaded
into a table in a JSP application. In general, the idea is to produce a list of business object
ids, since they are the fastest way of identifying objects for loading into browsers.
Inquiries include code, which is generally defined as an MQL temp query or expand
bus command, as well as information on how to parse the returned results into a list of
OIDs.
To define an inquiry from within MQL use the Add Inquiry statement:
add inquiry NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the inquiry you are defining. Inquiry names cannot include asterisks.
You must specify a unique name for each inquiry that you create. The name you choose is
the name that will be referenced to evaluate this inquiry within a JSP.
ADD_ITEM is an Add Inquiry clause that provides additional information about the
inquiry. The Add Inquiry clauses are:
description STRING_VALUE
icon IMAGE_PATH
pattern VALUE
format VALUE
code VALUE
file FILENAME
Each clause and the arguments they use are discussed in the sections that follow.
Description The Description clause of the Add Inquiry statement provides general information about
Clause the function of the inquiry. Since there may be subtle differences between inquiries, you
can use the description clause to point out the differences.
The description can consist of a prompt, comment, or qualifying phrase. There is no limit
to the number of characters you can include in the description.
Icon Clause Icons help users locate and recognize items by associating a special image with an inquiry.
You can assign a special icon to the new inquiry or use the default icon. The default icon is
used when in view-by-icon mode. Any special icon you assign is used when in
view-by-image mode. When assigning a unique icon, you must use a .gif image file. Refer
to Icon Clause in Chapter 1 for a complete description of the Icon clause.
.gif filenames should not include the @ sign, as that is used internally by Matrix.
Pattern Clause The Pattern clause of the Add Inquiry statement indicates the expected pattern of the
results of the evaluated code, and shows how the output should be parsed. It sets the
desired field to an RPE variable or macro. Since inquiries are designed to produce a list of
business objects, generally the macro that is set is OID.
Version 10 603
When you execute a temp query in MQL, the business objects found are returned in a list
that includes the type, name and revision, as well as any selectable information specified.
For example, the following code:
MQL< >temp query bus Part * * select id dump;
would return a list like:
Part,PT-6170-01,1,21762.30027.65182.63525
Part,PT-6180-01,1,21762.30027.50161.30295
Part,PT-6190-01,1,21762.30027.56625.19298
Part,PT-6200-01,1,21762.30027.37094.65388
To indicate that there are four fields that will be returned, delimited with a comma, and the
last field is the OID, you would use the following pattern:
*,*,*,${OID}
For an expand bus command, even more information is output before the select fields:
MQL< >expand bus Person "Test Buyer" - from relationship "Assigned Buyer" select
businessobject id dump |;
1|Assigned Buyer|to|Buyer Desk|Buy 001|-|37819.19807.45300.63521
To parse this output, you need to indicate that the first six fields, delimited by “|”, should
be ignored, and the seventh field is the OID. You would use:
*|*|*|*|*|*|${OID}
Format Clause The Format clause of the Add Inquiry statement defines what part of the output results
should be saved in the inquiry’s list. It references variables or macros specified in the
Pattern, and can include delimiters.
The syntax is:
format VALUE;
VALUE is the part of the output results that should be saved in the inquiry’s list.
For example:
format ${OID};
Code Clause The Code clause of the Add Inquiry statement is used to provide the code to be evaluated
to produce a list of one or more business objects.
The syntax is:
code VALUE;
When macros are included in the code (${USER} in example above), they should be
surrounded by single or double quotes, in case the substitution contains a space. Quotes
around both the macro in the code and the Argument when it contains a space ensures
that the macro substitution is handled correctly.
File Clause The Code for the inquiry does not need to be included in the Add Inquiry command itself.
It can be written in an external editor.
The syntax is:
file FILENAME;
FILENAME is the name of the file that contains the code for the inquiry.
Argument Clause The Argument clause of the Add Inquiry statement is used to provide any input arguments
that the inquiry may need. Arguments are name/value pairs that can be added to an Inquiry
as necessary to be used by the inquiry code. Depending upon how you write the code in
both the Inquiry and the JSP, you may or may not use arguments.
The syntax is:
argument NAME [STRING];
Quotes around both the macro in the code and the Argument when it contains a space
ensures that the macro substitution is handled correctly.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the inquiry. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add inquiry NAME property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 605
Copying and/or Modifying an Inquiry
Copying (Cloning) After an inquiry is defined, you can clone the definition with the Copy Inquiry statement.
an Inquiry Cloning a inquiry definition requires Business Administrator privileges, except that you
Definition can copy a inquiry definition to your own context from a group, role or association in
which you are defined.
This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy inquiry SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Modifying an The List Inquiry statement is used to display a list of all inquiries that are currently
Inquiry defined. It is useful in confirming the existence or exact name of an inquiry that you want
to modify, since Matrix is case-sensitive.
list inquiry [modified after DATE] NAME_PATTERN [select FIELD_NAME {FIELD_NAME}] [DUMP
[RECORDSEP]] [tcl] [output FILENAME];
For details on the List statement, see List Admintype Statement in Chapter 1.
Use the list of all the existing inquiries along with the Print statement to determine the
search criteria you want to change.
Use the Modify Inquiry statement to add or remove defining clauses and change the value
of clause arguments:
modify inquiry NAME [MOD_ITEM {MOD_ITEM}];
Each modification clause is related to the arguments that define the inquiry. To change the
value of one of the defining clauses or add a new one, use the Modify clause that
corresponds to the desired change.
When modifying an inquiry, you can make the changes from a script or while working
interactively with MQL.
• If you are working interactively, perform one or two changes at a time to avoid the
possibility of one invalid clause invalidating the entire statement.
• If you are working from a script, group the changes together in a single Modify
Inquiry statement.
Version 10 607
Evaluating an Inquiry
You can evaluate the Inquiry to determine if it will parse the output as you have designed
the JSP to expect to receive it.
Use the evaluate query command to execute the inquiry’s code, parse it, and display
the generated list.
To override any specified Arguments, or include input that the inquiry may otherwise
receive from the JSP, enter name/value pairs. Include only a space between multiple
inputs, using quotes around values that contain spaces.
The syntax is:
evaluate inquiry NAME [NAME VALUE [NAME VALUE [...]]];
If an inquiry is no longer required, you can delete it using the Delete Inquiry statements
delete inquiry NAME:
After this statement is processed, the inquiry is deleted and you receive an MQL prompt
for another statement.
Version 10 609
610 MQL Guide
30
Working With Channels
Channels Defined ......................................................................................... 612
Creating a Channel ....................................................................................... 613
Description Clause.......................................................................................... 613
Icon Clause..................................................................................................... 613
Label Clause................................................................................................... 614
Href Clause..................................................................................................... 614
Alt Clause ....................................................................................................... 614
Height Clause ................................................................................................. 614
Command Clause ........................................................................................... 614
Setting Clause ................................................................................................ 615
Property Clause .............................................................................................. 615
Copying and/or Modifying a Channel ......................................................... 616
Copying (Cloning) a Channel Definition.......................................................... 616
Modifying a Channel ....................................................................................... 616
Deleting a Channel ....................................................................................... 618
Version 10 611
Channels Defined
Channels are essentially a collection of commands. They differ from menus in that they
are not designed for use directly in an ADK application, but are used to define the contents
of a portal. Channels and portals are installed with the AEF and used in MatrixOne
applications to display PowerView pages, but may also be created for use in custom Java
applications.
Matrix Business Administrators can create channel objects if they have the portal
administrative access. Since commands are child objects of channels, commands are
created first and then added to channel definitions, similar to the association between
Matrix types and attributes. Likewise, channels are created before portals and then added
to portal objects. Changes made in any definition are instantly available to the applications
that use it.
To define a channel from within MQL use the add channel statement:
add channel NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the channel you are defining. Channel names cannot include
asterisks.
You cannot have both a channel and a portal with the same name.
ADD_ITEM is an add channel clause that provides additional information about the
channel. The add channel clauses are:
description STRING_VALUE
icon IMAGE_PATH
label VALUE
href VALUE
alt VALUE
height VALUE
Each clause and the arguments they use are discussed in the sections that follow.
Description The Description clause of the add channel statement provides general information about
Clause the function of the channel. Since there may be subtle differences between channels, you
can use the description clause to point out the differences.
The description can consist of a prompt, comment, or qualifying phrase. There is no limit
to the number of characters you can include in the description.
For example, if you were defining a channel named “Tasks” you might write a Description
clause similar to one of the following. Each channel might differ considerably.
description "My Tasks"
description "Tasks for My Routes"
description "Incomplete Tasks"
Icon Clause Icons help users locate and recognize items by associating a special image with a channel.
You can assign a special icon to the new channel or use the default icon. The default icon
is used when in view-by-icon mode. Any special icon you assign is used when in
Version 10 613
view-by-image mode. When assigning a unique icon, you must use a .gif image file. Refer
to Icon Clause in Chapter 1 for a complete description of the Icon clause.
.gif filenames should not include the @ sign, as that is used internally by Matrix.
Label Clause The Label clause of the add channel statement specifies the label to appear in the
application in which the channel is assigned.
Href Clause The Href clause of the add channel statement is used to provide link data to the JSP. The
Href link is evaluated to bring up another page. Many channels will not have an Href value
at all. However, channels designed for the “tree” channels require an Href because the root
node of the tree causes a new page to be displayed when clicked. The Href string generally
includes a fully-qualified JSP filename and parameters, which can contain embedded
macros and expressions for mapping to database schema. Refer to Using Macros and
Expressions in Configurable Components for more details.
The syntax is:
href VALUE;
Alt Clause The alt clause of the add channel statement is used to define text that is displayed until any
image associated with the channel is displayed and also as “mouse over text.”
The syntax is:
alt VALUE;
Height Clause The height clause of the add channel statement is used to indicate the height size in pixels
the channel will occupy on the page. The default is 260. The syntax is:
height VALUE;
Command Clause The command clause of the add channel statement is used to specify existing commands
to be added to the channel you are creating. Each command will be a separate tab in the
channel and displayed in the order in which they are added. Separate items with a comma.
The syntax is:
command NAME{,NAME};
Setting Clause The Setting clause of the add channel statement is used to provide any name/value pairs
that the channel may need. They can be used by JSP code, but not by hrefs on the Link tab.
Refer to Using Macros and Expressions in Configurable Components for more details.
The syntax is:
setting NAME [STRING];
Property Clause Integrators can assign ad hoc attributes, called Properties, to the channel. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add channel NAME property NAME [to ADMINTYPE NAME] [value STRING];
Version 10 615
Copying and/or Modifying a Channel
Copying (Cloning) After a channel is defined, you can clone the definition with the Copy channel statement.
a Channel Cloning a channel definition requires Business Administrator privileges.
Definition This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy channel SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
Modifying a Use the Modify channel statement to add or remove defining clauses or change the value
Channel of clause arguments:
modify channel NAME [MOD_ITEM {MOD_ITEM}];
Version 10 617
Deleting a Channel
If a channel is no longer required, you can delete it using the Delete channel statement
delete channel NAME:
After this statement is processed, the channel is deleted and you receive an MQL prompt
for another statement.
Version 10 619
Portals Defined
Portals are a collection of channels, as well as the information needed to place them on a
Web page. Some portals are installed with the AEF and used in MatrixOne applications to
display PowerView pages, but they may also be created for use in custom Java
applications. Matrix Business Administrators can create portal objects if they have the
portal administrative access.
Before creating a portal, the channels that it will contain must be defined. Channels are
child objects of portals — channels are created first and then added to portal definitions,
similar to the association between Matrix types and attributes. Changes made in any
definition are instantly available to the applications that use it.
To define a portal from within MQL use the add portal statement:
add portal NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the portal you are defining. Portal names cannot include asterisks.
ADD_ITEM is an add portal clause that provides additional information about the portal.
The add portal clauses are:
description STRING_VALUE
icon IMAGE_PATH
label VALUE
href VALUE
alt VALUE
Each clause and the arguments they use are discussed in the sections that follow.
Description The description clause of the add portal statement provides general information about the
Clause function of the portal. Since there may be subtle differences between portals, you can use
the description clause to point out the differences.
The description can consist of a prompt, comment, or qualifying phrase. There is no limit
to the number of characters you can include in the description.
For example, if you were defining a portal named “Management” you might write a
Description clause similar to one of the following. Each portal might differ considerably.
description "Engineering Manager"
description "Program Manager"
description "Specification Manager"
Icon Clause Icons help users locate and recognize items by associating a special image with a portal.
You can assign a special icon to the new portal or use the default icon. The default icon is
used when in view-by-icon mode. Any special icon you assign is used when in
view-by-image mode. When assigning a unique icon, you must use a .gif image file. Refer
to Icon Clause in Chapter 1 for a complete description of the Icon clause.
.gif filenames should not include the @ sign, as that is used internally by Matrix.
Version 10 621
Label Clause The label clause of the add portal statement specifies the label to appear in the application
in which the portal is assigned.
Href Clause The href clause of the add portal statement is used to provide link data to the JSP. The href
link is evaluated to bring up another page. Many portals will not have an href value at all.
The href string generally includes a fully-qualified JSP filename and parameters, which
can contain embedded macros and expressions for mapping to database schema.
The syntax is:
href VALUE;
Alt Clause The alt clause of the add portal statement is used to define text that is displayed until any
image associated with the portal is displayed and also as “mouse over text.”
The syntax is:
alt VALUE;
Setting Clause The setting clause of the add portal statement is used to provide any name/value pairs that
the portal may need. They can be used by JSP code, but not by hrefs on the Link tab.
Refer to Parameters and Settings for Channels in the Application Exchange Framework
Guide for appropriate settings for the type of portal you are creating. Also refer to Using
Macros and Expressions in Configurable Components for more details.
The syntax is:
setting NAME [STRING];
For example, an image setting with the image name can be specified to display when the
portal is used in a toolbar:
setting Image iconSmallMechanicalPart.gif;
Property Clause Integrators can assign ad hoc attributes, called Properties, to the portal. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add portal NAME property NAME [to ADMINTYPE NAME] [value STRING];
Version 10 623
Copying and/or Modifying a Portal
Copying (Cloning) After a portal is defined, you can clone the definition with the Copy portal statement.
a Portal Definition Cloning a portal definition requires Business Administrator privileges, except that you can
copy a portal definition to your own context from a group, role or association in which you
are defined.
This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy portal SRC_NAME DST_NAME [MOD_ITEM {MOD_ITEM}];
When modifying a portal, you can make the changes from a script or while working
interactively with MQL.
• If you are working interactively, perform one or two changes at a time to avoid the
possibility of one invalid clause invalidating the entire statement.
• If you are working from a script, group the changes together in a single modify portal
statement.
Version 10 625
Deleting a Portal
If a portal is no longer required, you can delete it using thedelete portal statement
delete portal NAME:
After this statement is processed, the portal is deleted and you receive an MQL prompt for
another statement.
Version 10 629
Context Defined
Setting context identifies the user to Matrix, telling Matrix the areas of access the current
user maintains. For example, setting context to a person who is defined as a Business
Administrator allows access to Matrix Business Administrator functions such as adding a
Type. In addition, a default vault is associated with context so that newly created objects
are assigned to that user’s typical vault (unless specified otherwise).
Personal settings that a user creates such as saved sets, queries, views and visuals (filters,
cues, tips, toolsets and tables) are accessed only when context is set to that person.
Context is defined by persons’ names and vault they are working on. As described in Vault
Defined in Chapter 4, a vault defines a grouping of objects. For example, a vault may
contain all the information and files associated with a particular project, product line,
geographic area, or period of time.
MQL defaults the context as follows:
• For a newly installed (empty) Matrix database, MQL assumes the context of
“creator."
• If Matrix has a person whose name matches the operating system user ID, the context
is set to that person.
• If the operating system user ID does not match a person in Matrix (and the user
“guest” has not been deleted, made inactive, or assigned a password), the context is
set to “guest.”
If Matrix does not (cannot) set a context as listed above, no default context is set.
Context identifies a person to Matrix, indicates the type of person (such as a System
Administrator), and optionally, provides security with a password. Any user can set
context, but restrictions apply based on the type of person and password. For example,
only a System Administrator can perform System Administrator functions.
Setting the context of a user implies that you are the user. Once the context is set, any
statements you enter are subject to the same policies that govern the defined person. This
is useful when you need to perform a large number of actions for a defined user.
For example, assume you want to include a person’s files in the Matrix database. When
you include them, you want the person to maintain ownership. Also, you do not want to
create objects the person cannot access or perform actions prohibited to the person. You
need to act as the person when those files are processed. In other words, you want to
identify yourself to Matrix as the person in question so that the actions you take appear to
have been done by the actual owner of the files.
Context is controlled with the Set Context statement which identifies a user to Matrix by
specifying the person name and vault:
set context [ITEM {ITEM}];
password VALUE
newpassword VALUE
vault VAULT_NAME
The Person clause can be replaced with the User clause. In both cases a defined person
must be entered. A group or role is not allowed.
How you set the context varies based on whether the person definition includes a
Password, No Password, or Disable Password clause. Each situation is described in the
sections that follow.
Setting Context When a person is added to the Matrix database, the Business Administrator may include a
With Passwords Password clause as part of the person’s definition. This clause assigns a Matrix password
to the person. Once assigned, the password is required to access this person’s context
(unless the password is removed).
The password should be kept secret from all unauthorized users. If the defined person
never shares its password with any other user, the effect is the same as using the Disable
Password clause in the person’s definition (refer to Disable Password Clause in Chapter
11). Use the following Set Context statement if a person is defined as having a password:
set context person PERSON_NAME password VALUE [vault VAULT_NAME];
Version 10 631
PERSON_NAME is the name of a user defined in the Matrix database.
VALUE is the password value assigned to the named person in the person definition that
was created by the Matrix Business Administrator.
VAULT_NAME is a valid vault defined in the Matrix database.
In this statement, you must enter both a person name and the password associated with the
person. If either value is incorrect, an error message is displayed. However, if you are the
Business Administrator, you can bypass a defined password. If you are assigned a user
type of Business Administrator, you can change your context to that of another person by
entering the following statement:
set context person PERSON_NAME [vault VAULT_NAME];
If you are defined as a Full User and want to set your context to mcgovern, you would
enter:
set context user mcgovern password PostModern;
In this case, the Password clause must be included in the Set Context statement. If you are
defined as a Business Administrator, you can set your context to mcgovern by entering:
set context person mcgovern;
No password is required even though a password was assigned. For more information on
the different user types, see Type Clause in Chapter 11.
Setting Context When a person is defined with a No Password Clause, anyone can set context to that
Without person name. Since no password is required, the Set Context statement is:
Passwords set context person PERSON_NAME [vault VAULT_NAME];
After this statement is executed, you have the same privileges and business objects as
MacLeod.
Setting Context When a person is defined with a Disable Password Clause, the security for logging into
With Disabled the operating system is used as the security for setting context in Matrix. When a user
Passwords whose password is disabled attempts to set context in Matrix, the system compares the
user name used to log into the operating system with the list of persons defined in Matrix.
If there is a match, the user can set context without a password. (The context dialog puts
the system username in as default, so the user can just hit enter.) If they do not match, the
system denies access.
When Disable Password is chosen for an existing person, Matrix modifies the password so
that others cannot access the account. This means that the user with a disabled password
can only log into Matrix from a machine where the O/S ID matches the Matrix ID. This is
similar to the way automatic SSO-based user creation is handled. To re-enable a password
for such a person, create a new password for the person as you normally would.
Setting Context The context settings provided by the user at login time define what types of accesses that
Temporarily user has to Matrix. Programs, triggers and wizards may be available to users who do not
have appropriate access privileges to run them, so context must be changed within the
program and then changed back to the original user’s context when the program
completes.
For example, a trigger program may need to switch context to perform some action which
is not allowed under the current user context. It must then return to the original context to
prohibit invalid access or ownership for subsequent actions.
Two MQL commands are available that are useful in scripts that require a temporary
change to the session context.
Version 10 633
For example, a user needs to run a wizard that requires checkin access for a business
object. Since the creator of the wizard does not know if all users who run the wizard will
have checkin access, the wizard first changes context to assure checkin access:
push context user Taylor password runwizard vault Denver;
The user Taylor is a person who has checkin access. It might even be a person definition
created specifically for the purpose of running wizards.
The last thing the wizard does before the program terminates is to use the pop context
statement to set context back to whatever it was before the wizard was run. The wizard
creator does not have to know who is running the wizard or what the original context was.
Version 10 635
Overview of IconMail
Matrix offers an internal mail system, called IconMail, to enable Matrix users to easily
exchange business objects and text messages. This mail utility is similar to other
electronic mail systems. However, as its name suggests, the icon of the discussed object is
sent with the message, allowing the recipient to view or edit the object from within the
mailbox.
While the IconMail utility is most often used from within Matrix itself, you can access it
through MQL. This enables the Business or System Administrator to send messages while
performing other MQL statements. For example, the Administrator may use MQL to load
external files for a group’s use or assign a person to a role. Once the action is completed,
while still in MQL the Administrator could send a mail message to notify the appropriate
persons that the job is done.
Every user has access to IconMail unless it has been disabled in the user’s person
definition by the Business Administrator. For example, a user may create business objects
and could use IconMail to notify the appropriate people about the existence and states of
the objects.
The sender of mail does not know how it is received. It could be received as IconMail,
email, or both. With email, the type, name, and revision of sent objects are added; but the
email recipient has no direct access to objects from the mail message.
You use the Send Mail statement to send mail to another Matrix user:
send mail businessobject TYPE NAME REVISION [in VAULT] {ITEM};
Or
send mail businessobject ID {ITEM};
cc USER_NAME {,USER_NAME}
subject VALUE
text VALUE
Although the clauses are optional, at least a Subject or Text clause is recommended.
Each clause and the arguments they use are discussed in the sections that follow.
To Clause The To clause of the Send Mail statement identifies who should receive the message you
are sending. It can contain a list of users:
to USER_NAME {,USER_NAME}
USER_NAME is the name of a person, group, role, or association defined within the Matrix
database. Depending on your system setup, user’s names may be case sensitive. If the
name is not found, an error message is displayed. The fact that you can insert a role name
or group name means that you not only have existing mailing lists, but also can send a
message to a person whose name you do not know but whose function it might be to
process the information you have.
For example, you may want to send an announcement to everyone working on your
project to inform them that certain materials are available for use:
send mail to “Vehicle Manufacturing”
subject “Materials Now Available”
text “The materials for the V34 Solar Vehicle are now available.
For more information contact Mike Zimmerman at ext 511.”;
When this message is sent, it will go to every user defined in the Vehicle Manufacturing
group. If additional groups are needed, you can list them also by separating the names
with a comma.
Version 10 637
CC Clause The CC clause of the Send Mail Statement circulates the mail to additional people. While
the message may be intended for a single individual, this clause lets you notify others that
the correspondence has taken place. Use the following syntax:
cc USER_NAME {, USER_NAME}
USER_NAME is the name of a person, role or group within the Matrix database.
Depending on your system setup, user’s names may be case sensitive. If the name is not
found, an error message is displayed.
Subject Clause The Subject clause places a header on the mail message. This header is usually a short
synopsis of the message’s content. Use this syntax:
subject VALUE
Depending on the purpose of the message you are sending, you may not include any text at
all. It is possible to send one or more business objects or messages within the Subject
clause only.
Text Clause The Text clause contains the bulk of your mail message:
text VALUE
VALUE is any length character string you want to enter. The message may be short or
quite lengthy.
When writing the text of your mail message, you must enclose the entire content within
either single quotes (‘ ’ ) or double quotes (“ ”). If your message includes apostrophes,
enclose the message in double quotes. If your message includes double quotes, enclose the
message in single quotes.
Matrix IconMail is always sent to the server to which you’re connected. However, in a
distributed environment, you must point to the server from which you want to read mail.
You can read mail from MQL using the Print Mail statement:
print mail [server SERVER_NAME] [# | all];
SERVER_NAME is the name of the server from which you want to read mail messages.
# is the message number to print. The message number equals the mail message OID
(Object ID).
Use all to print all messages from the specified server, or from the default server if no
server is specified.
The print mail statement without arguments prints all messages in the current user’s
mailbox.
Version 10 639
Deleting an IconMail Message
After you are through with a mail message, you can delete it with the Delete Mail
statement:
delete mail [server SERVER_NAME] [# | all];
SERVER_NAME is the name of the server from which you want to delete mail messages.
# is the number of the specific message to be deleted. The message number equals the
mail message OID (Object ID).
Use all to print all messages from the specified server, or from the default server if no
server is specified.
When this statement is processed, Matrix searches the list of existing mail messages. If the
number is found, the mail message associated with that number is deleted along with any
mail references to any business objects. If the number is not found, an error message is
displayed.
If you want to delete all your IconMail, use the Delete Mail All statement:
delete mail all;
When this statement is processed, all your IconMail messages and the references to any
business objects associated with them are deleted.
Only the mail reference to a business object is deleted—the business object remains
untouched. Do not worry about inadvertently deleting an object when deleting an
IconMail message.
Deprecated The renumber mail command is no longer supported. As of version 9.0.6.0, IconMail
Function messages are not numbered sequentially, but rather equal the mail message OIDs. This
change resolved a database contention/locking issue.
Version 10 641
Overview of Workflows
Before a workflow can be created, a process definition must exist, since workflows are
based on processes. For information on creating a process definition, see Defining a
Process in Chapter 20.
A workflow is created with the Add Workflow statement:
add workflow PROCESS NAME [ADD_ITEM {ADD_ITEM}];
image FILENAME
vault VAULT_NAME
owner USER_NAME
All these clauses are optional. You can define a workflow by simply assigning a name to
it. Each Add Workflow clause is described in detail in the sections that follow.
A validation check is run during workflow instance creation. The validate code is called
during an add workflow and gives appropriate errors if the process on which the
workflow is based is not valid.
Description The Description clause of the Add Workflow statement provides general information for
Clause you and the user about the workflow and the overall function of the workflow. There may
be subtle differences between workflows; the description can point out the differences.
There is no limit to the number of characters you can include in the description. You can
enter a string of any length. However, keep in mind that the description is displayed when
the mouse pointer stops over the workflow in the Workflow chooser. Although you are not
required to provide a description, this information is helpful when a choice is requested.
Image Clause The Image clause of the Add Workflow statement associates a special image, called an
ImageIcon, with a workflow. While it is optional, it can assist a user in locating a desired
workflow. For example, you may have several different workflows within a vault. By
having an ImageIcon of each workflow, a user can easily locate the workflow s/he desires
by using the associated ImageIcon as a guide.
For example, if you have workflows to create parts, you might specify a GIF file of a
drawing of each part as their ImageIcons. Then, as you were scanning a set of workflows
using the Matrix Navigator (not MQL), you could easily identify a particular workflow.
Version 10 643
This would be true even if the workflows had names such as “New Part 41053” or “New
Part 91617.”
While ImageIcons are very similar to icons, they require more display time and probably
should be displayed only at specific times. Also, while an icon is associated with items
such as policies, types, and formats, ImageIcons are associated only with business objects,
persons and workflows. A workflow may or may not have an ImageIcon associated with
it.
The GIF file needs to be accessible only during definition using the Add or Modify
Workflow clause. Once an accessible file in the correct image type is used in the
Workflow clause, Matrix will read the image and store it with the workflow definition in
the database. Therefore, the physical icon files do not have to be accessible for every
Matrix session. (If the file is not accessible during definition, Matrix will be unable to
display the image.)
To write an Image clause, you need the full directory path to the ImageIcon you are
assigning. For example, the following statement assigns an ImageIcon of the actual part to
the workflow:
add workflow “Create Part” “New Part 41590”
image $MATRIXHOME/demo/part41590.gif;
You can view an image with the View menu options or by setting the Session Preferences
options in Matrix Navigator.
Specifying redundant icons adds redundant information in the database that requires
more work to display. When the default icon is desired, do not specify it because it
requires more work to display.
The Image clause of the Add Workflow statement is optional unless there is a need to
distinguish between workflows of the same type. If you do not specify an image, the
default icon of the process is used.
retrieves the image of workflow “Create Part” “New Part 41093” and saves it to
the $MATRIXHOME directory with the name “New Part 41093.gif”.
Since a vault is not specified, Matrix will use the current vault, “Corporate,” to store the
workflow. But you might rather have all workflows related to purchasing in the Finance
vault. You could include a Vault clause:
add workflow “Purchase Req” “Order Materials”
vault “Finance”;
In many ways, vaults resemble and operate like directories on computers. Your context is
similar to your default directory. If the workflow (like a file) is not in the default directory,
you must include the directory as part of the workflow definition.
Owner Clause The Owner clause of the Add Workflow statement defines who the owner of the workflow
will be. The Owner clause is optional. If you do not include one, MQL will assume the
owner is the current user. The current user is defined by the present context. This means
that the System and Business Administrators can create workflows for other users by first
setting the context to that of the desired user and then creating the workflows, or by using
the Owner clause.
If the user name you give in the Owner clause is not found, an error message will result. If
that occurs, use the List User statement to check for the presence and spelling of the user
name. Names are case-sensitive and must be spelled using the same mixture of uppercase
and lowercase letters.
For example, the following workflow definition assigns the role “Jan Engineer” to a
workflow titled “Module Design:”
add workflow “Software Development” “Module Design” owner “Jan Engineer”;
Attribute Clause The Attribute clause of the Add Workflow statement allows you to assign a specific value
to one of the workflow’s attributes. A workflow’s process may or may not have been
designed to include process level attributes. If it was, you can assign a specific value to the
attribute using the Attribute clause.
If you are unsure of either of the ATTRIBUTE_NAME or the VALUE to be assigned, you
can use the Print Process and Print Attribute statements, respectively.
Version 10 645
For example, the following Add Workflow statement assigns values to two attributes of
the Purchase Part workflow, based on the Ordering process.
add workflow Ordering “Purchase Part”
description “to purchase parts for manufacturing process”
“Projected Duration” 5
Quantity 16
Only the attributes associated with the process on which the workflow is based can be
assigned values for the instance.
After a workflow is defined, workflow owners can change the disposition (state) of the
workflow, reassign it to a new owner, or check the workflow path or status.
Starting a Workflows can be started only by the owner of the workflow instance. When the
Workflow workflow is started, it immediately sends out task assignments for the first activity in the
workflow.
The following statement lets you start a previously-defined workflow:
start workflow PROCESS NAME;
Stopping a When the workflow is stopped, all tasks which have been sent to users’ IconMail inboxes
Workflow are rescinded. Any users who are already working on tasks within the workflow receive an
IconMail message stating that tasks have been rescinded.
The following statement lets you stop a workflow that is in progress:
stop workflow PROCESS NAME;
Suspending a When a workflow is suspended, no new tasks are assigned until the workflow is resumed.
Workflow A workflow is automatically suspended if an OR-split does not have a valid path to follow
(that is, none of the transition expressions are satisfied).
The following statement lets you suspend a workflow that is in progress:
suspend workflow PROCESS NAME;
Resuming a When a workflow is resumed, the workflow engine checks which tasks have been
Workflow completed since the workflow was suspended and if necessary, proceeds to the next
activity and assigns new tasks.
The following statement lets you resume a workflow that has been suspended:
resume workflow PROCESS NAME;
Version 10 647
NAME is the name of the workflow you want to resume.
Reassigning a Only the workflow owner can reassign the workflow to a different user. Initially, the
Workflow owner of the workflow is the person who creates it. That person can then reassign the
workflow to a new owner. For example, you may have one person in the group who
creates workflow instances, and then reassigns them to other users to manage.
The following statement lets you reassign a workflow to a new owner:
reassign workflow PROCESS NAME owner PERSON_NAME;
Planning Workflow The MQL select node command is available to find the name of the next node or
Execution activity that follows a specified node. This can be used to determine what paths a
workflow would take once execution commences or to determine the current status of a
workflow. To use the next selectable, the workflow must first be created from a defined
process, but it does not need to be started.
Since the path a workflow takes depends mostly on how attribute values of the workflow
and its component activities are set, you could use the selectable to determine the path that
would be taken and adjust attribute values as needed. This allows you to ensure that the
workflow instance will take the desired path before actually starting the workflow.
The print workflow command includes the following selectable for this purpose:
print workflow PROCESS WORKFLOW select node[WORKFLOW NODE].next;
where:
PROCESS is the name of the process definition that is used for the workflow.
WORKFLOW is the name of the workflow instance.
NODE is the name of a node in the Process definition
Version 10 649
Modifying a Workflow Definition
Modifying a After a workflow is defined, you can change the definition with the Modify Workflow
Workflow statement.
Definition The following statement lets you add or remove defining clauses and change the value of
clause arguments:
modify workflow PROCESS NAME [MOD_ITEM] {MOD_ITEM};
Assigning Ad hoc Multiple users of any type can be added to the assignee list for an interactive activity,
Workflow Activity causing IconMail to be sent to all users specified. Ownership of the activity is not resolved
to Multiple Users until someone accepts the task. Using this assignee list allows the workflow owner to
expand the number of IconMail recipients on an ad hoc basis, allowing multiple groups to
be added during workflow execution. This means that two workflow instances that use the
same process definition are able to distribute their IconMails to different sets of
individuals. To summarize:
• An activity’s assignees are those users who receive the IconMail for the activity. This
includes the users assigned to the process definition, as well as users that are assigned
to the workflow’s activity.
• An activity owner is the person who accepts the task. The owner may not always be
resolved, but once it is, it is always a single person user. Once a task is accepted, the
IconMails to all others are rescinded.
You can add assignees to activities before the workflow has been started, while it is
started, or by stopping (and restarting) it. (You cannot add assignees to activities when the
workflow has been suspended or stopped.) When you restart a workflow, it returns to the
beginning of the process.
For example:
Version 10 651
mod workflow “Simple Process” “Simple Workflow” interactive activity1 remove user
“Technical Writer”;
You can use the print workflow command to show all assignees, including both
those defined in the process and those added by the workflow owner. For example:
print workflow “Simple Process” “Simple Workflow” select
interactive[activity4].assignee;
If a workflow is no longer required, you can delete it with the Delete Workflow statement:
delete workflow PROCESS NAME;
Version 10 653
654 MQL Guide
35
Creating and Modifying
Business Objects
Business Objects.......................................................................................... 656
Specifying a Business Object Name........................................................... 657
Business Object Type..................................................................................... 657
Business Object Name ................................................................................... 657
Business Object Revision Designator............................................................. 658
Object ID......................................................................................................... 659
Adding a Business Object ........................................................................... 660
Description Clause.......................................................................................... 660
Image Clause.................................................................................................. 661
Vault Clause ................................................................................................... 662
Revision Clause.............................................................................................. 663
Owner Clause ................................................................................................. 663
Policy Clause .................................................................................................. 663
State Clause ................................................................................................... 664
Attribute Clause .............................................................................................. 665
Viewing Business Object Definitions ......................................................... 667
Print Businessobject Statement...................................................................... 667
Select Statements........................................................................................... 668
Copying and Modifying a Business Object................................................ 673
Copying/Cloning a Business Object ............................................................... 673
Modifying a Business Object .......................................................................... 674
Creating a Revision of an Existing Business Object ................................ 680
Handling Files ................................................................................................. 681
Adding an Object to a Revision Sequence ..................................................... 681
Deleting a Business Object and Its Files.................................................... 683
Version 10 655
Business Objects
Business objects form the body of Matrix. They contain much of the information an
organization needs to control. Each object is derived from its previously-defined type and
governed by its policy. Therefore, before users can create business objects, the Business
Administrator must create definitions for the types (see Working With Types in Chapter
13) and policies (see Working With Policies in Chapter 17) that will be used. In addition,
the users (persons, groups, and roles) must be defined in Matrix before they can have
access to the application (see Working With Users in Chapter 11).
When creating a business object, the first step for the user is to define (name) the object
and assign an appropriate description and attribute values for it. File(s) can then be
checked into the object and it can be manipulated by establishing relationships, moving it
from state to state and perhaps deleting or archiving it when it is no longer needed. This
chapter describes the basic definition of the object and its attributes. In the next chapter,
relationships, connections, states, checking files in and out, and locking objects are
described in more detail.
When you create or reference a business object, you must give its full business object
name. The full business object name must contain three elements:
TYPE NAME REVISION
Each element must appear in the order shown. If any element is missing or if the values
are given in the wrong order, the business object specification is invalid.
You can also optionally specify the vault in which the business object is held. When the
vault is specified in this manner, only the named vault needs to be checked to locate the
business object. This option can improve performance for very large databases.
TYPE NAME REVISION [in VAULT]|ID [in VAULT]
See Adding a Business Object later in this chapter for more information about additional
elements.
The full business object specification includes TYPE NAME REV: the type from which
the object was created, the object name—the user-supplied identifier that is associated
with the definition and identifies the object to the end user(s)—and the revision.
In the sections that follow, each of the three required elements is discussed and sample
values are given.
Business Object The first element in a business object specification is the object’s type. Every object must
Type have a type associated with it. When you specify the object’s type, remember that it must
already be defined.
If the type name you give in the business object specification is not found, an error
message will display. If this occurs, use the List Type statement (described in List
Admintype Statement in Chapter 1) to check for the presence and spelling of the type
name. Names are case-sensitive and must be spelled using the same mixture of uppercase
and lowercase letters.
When you are assigning a type to a business object, note that all types have attributes
associated with them. These attributes appear as fields when the object is accessed in
Matrix Navigator. These fields can then be filled in with specific values or viewed for
important information.
For example, you might assign a type of “Metallic Component” to an object you are
creating. With this type, you might have four attributes: type of metal, size, weight, and
strength. If you use an Attribute clause in the add businessobject statement or
modify the attributes, you can insert values that will appear whenever the object is
accessed. If attributes are not specified when a business object is added or modified, the
attribute defaults (if any) are used.
Business Object The second element in a business object specification is the business object name. This
Name consists of a character string that will be used to identify the business object and to
reference it later. It should have meaning to you and guide you as to the purpose or
contents of the business object. While the Description clause can remind you of an
Version 10 657
object’s function, it is time-consuming to have to examine each object to find the one you
want. Therefore, you should assign a name that clearly identifies and distinguishes the
object.
Matrix is designed for you to use your exact business terminology rather than cryptic
words that have been modified to conform to the computer system limitations. Matrix has
few restrictions on the characters used for naming business objects. Names are
case-sensitive and spaces are allowed. You can use complete names rather than
contractions, making the terminology in your system easier for people to understand.
Generally, name lengths can be a maximum of 127 characters. Leading and trailing spaces
are ignored.
You should avoid using characters that are programmatically significant to Matrix, MQL,
and associated applications. These characters include:
In Matrix, while commas are allowed in a business object’s name, they are not
recommended. In many statements a comma is the most common delimiter. Any of the
characters listed above should be avoided when naming an object, a query or a set.
When specifying an existing business object, if the name you give is not found, an error
message will result. Names are case-sensitive and must be spelled using the same mixture
of uppercase and lowercase letters. If an error occurs, use the Temporary Query statement
with wildcards to perform a quick search. For example, to find an object with a name
beginning with the letters “HC” and unknown type and revision level, you could enter:
temporary query businessobject * HC* *
Use: the first * for the unknown type, the HC* for the name beginning with “HC”, and
the third * for the unknown revision level. The result would be all the objects beginning
with “HC”.
Product HC-430 A
Product HC-470 B
Business Object The third element in a business object specification is the revision label or designator. The
Revision revision must be specified if the object requires the revision label in order to distinguish it
Designator from other objects with the same name and type. Depending on the object’s policy,
revisions may or may not be allowed. If they are not allowed or a revision designator does
not exist, you must specify "" (a set of double quotes) for MQL.
The ability (access privilege) to create revisions can be granted or denied depending on
the object’s state and the session context. When an object is revised, the revision label
changes. This label is either manually assigned at the time the revision is created or
automatically assigned if a revision sequence has been defined in the governing policy.
Revision sequences provide an easy and reliable way to keep track of object revisions. If
the revision sequencing rules call for alphabetic labels, a revised object might have a label
such as B or DD. If the Sequence clause in the policy definition specifies custom revision
labels, you might see a label such as Unrevised, “1st Rev,” “2nd Rev,” and so on. In any
case, the revision label you provide must agree with the revision sequencing rules. If it
does not, an error message will result.
The first specification has no revision designator and must be specified as such. This
might be because Component types cannot be revised under the governing policy. It might
also be because this is the original object that uses a sequence where the first object has no
designator.
For more information about revision sequences, see Sequence Clause in Chapter 17.
Object ID When business objects are created, they are given an internal ID. As an alternative to
TYPE NAME REV, you can use this ID when indicating the business object to be acted
upon. The ID of an object can be obtained by using the print businessobject selectable
“ID”. Refer to Viewing Business Object Definitions later in this chapter for more
information on select statements.
Version 10 659
Adding a Business Object
image FILENAME
vault VAULT_NAME
owner USER_NAME
policy POLICY_NAME
ATTRIBUTE_NAME VALUE
The Policy clause is required when adding a new business object. It specifies the policy
that will govern this object.
The Vault clause indicates the name of the vault where the object will reside. If the vault is
not specified, the business object is created in the current context vault setting. The vault
must be specified only if you want the business object to be created in another vault.
All Add Businessobject clauses provide information about the business object being
defined. Only the Policy clause is required. You will learn more about each Add
Businessobject clause in the sections that follow.
Description The Description clause of the Add Businessobject statement provides general information
Clause to both you and the user about the information associated with this business object. When
a user creates a business object, this description will guide him/her to understand the
information, function, or files associated with the object. There may be subtle differences
between business objects—the Description clause enables you to point out these
differences to the user.
For example, assume you have two versions of a project that you decide to develop
concurrently. The resulting two business objects might have similar names such as “Solar
Vehicle X29” and “Solar Vehicle X30.” Even if the reason for the different versions is
contained elsewhere in business object’s contents, you can specify the reason in the
Description clause. For example:
add businessobject “Energy Efficient Vehicle” “Solar Vehicle X29” A
description “Uses traditional batteries”;
policy “Solar Vehicle”
add businessobject “Energy Efficient Vehicle” “Solar Vehicle X30” A
description “Uses prototype batteries”;
policy “Solar Vehicle”
Image Clause The Image clause of the Add Businessobject statement associates a special image, called
an ImageIcon, with a business object. While it is optional, it can assist a user in locating a
desired object. For example, you may have several different components, blueprints, or
designs within a vault. By having an ImageIcon of each item associated with its object
name, a user can easily locate the object s/he desires by using the associated ImageIcon as
a guide.
For example, you might specify a GIF file of a drawing of each object as their ImageIcons.
Then, as you were scanning a set of business objects using the Matrix Navigator (not
MQL), you could easily identify a particular object. This would be true even if the objects
had names such as “J391” or “X19.”
While ImageIcons are very similar to icons, they require more display time and probably
should be displayed only at specific times. Also, while an icon is associated with items
such as policies, types, and formats, ImageIcons are associated only with objects and
persons. An object may or may not have an ImageIcon associated with it. Excluding an
ImageIcon from this object will not affect other objects that are created with the same
type, policy, state, and owner. You can even have two revisions of an object with different
ImageIcons since each revision represents a different object.
The GIF file needs to be accessible only during definition using the Add or Modify
Businessobject clause. Once an accessible file in the correct image type is used in the
Businessobject clause, Matrix will read the image and store it with the object definition in
the database. Therefore, the physical icon files do not have to be accessible for every
Matrix session. (If the file is not accessible during definition, Matrix will be unable to
display the image.)
To write an Image clause, you need the full directory path to the ImageIcon you are
assigning. For example, the following statement assigns an ImageIcon of the actual
vehicle to the business object:
add businessobject “Energy Efficient Vehicle” “Solar Vehicle X29” A
policy “Solar Vehicle”
description “Uses traditional batteries”
image $MATRIXHOME/demo/vehicleX29.gif;
You can view an image with the View menu options or by setting the Session Preferences
options in Matrix Navigator.
Specifying redundant icons adds redundant information in the database that requires
more work to display. When the default icon is desired, do not specify it.
The Image clause of the Add Businessobject statement is optional unless there is a need to
distinguish between objects of the same type. If you do not specify an image, the default
icon of the type is used.
Version 10 661
Retrieving the Image
If you associate an image with a business object using the Image clause, you can retrieve
the image as a GIF file using the Image statement. The GIF file is placed in the
MATRIXHOME directory, unless overridden by the optional clause, directory.
image businessobject OBJECTID [directory DIRNAME] [file FILENAME] [verbose];
OBJECTID is the OID or Type Name Revision of the business object instance from
which you want to get the image.
DIRNAME is the full pathname where you want to save the image file. If no pathname is
specified, the file is saved in the $MATRIXHOME directory.
FILENAME is the name to be given to the image .gif file. If the file name is not
specified, the file is given the name of the object with a .gif extension.
Using verbose prints the file name on the screen.
For example:
image bus Assembly 12345 0;
retrieves the image of object Assembly 12345 0 and saves it to the $MATRIXHOME
directory with the name 12345.gif.
Vault Clause The Vault clause of the Add Businessobject statement specifies the name of the vault
where the object will reside. If you include a Vault clause in your definition, it must be
placed after the Policy clause and before any other Add Businessobject clauses.
Matrix must know which vault is associated with the business object. This element is
optional because if not explicitly stated, Matrix will use the current vault (as set in the
current context) as a default value. If the object you are creating should not be in the
current vault, you must include the vault’s name in the object’s definition.
For example, assume you are in a vault named “Car Loans.” You decide to create an
object with the specification “Car Loan” “Alan Broder.” You could do this by entering the
following statement:
add businessobject “Car Loan” “Alan Broder” A
policy “Bank Loans”;
Since a vault is not specified, Matrix will use the current vault, “Car Loans,” to store the
business object named “Alan Broder.” But what if Mr. Broder also had a mortgage with
the same company and you were in the “Mortgages” vault instead of the “Car Loans”
vault? You would have to include a Vault clause:
add businessobject “Car Loan” “Alan Broder” A
policy “Bank Loans”
vault “Car Loans”;
In many ways, vaults resemble and operate like directories on computers. Your context is
similar to your default directory. If the object (like a file) is not in the default directory,
you must include the directory as part of the object name.
Owner Clause The Owner clause of the Add Businessobject statement defines who the owner of the
business object will be. The Owner clause is optional when defining a business object. If
you do not include one, MQL will assume the owner is the current user, which is defined
by the present context. This means that the System and Business Administrators can create
objects for other users by first setting the context to that of the desired user and then
creating the desired objects, or by using the Owner clause.
The owner of an object can be assigned special access in the policy. The user who is
assigned ownership of an object has access privileges defined in the Owner subclause of
the policy. That user can be an individual, a group, or a role.
Access privileges for the owner of an object are assigned in the Owner subclause of the
policy. The owner can be an individual, a group, or a role.
If the user name you give in the Owner clause is not found, an error message will result. If
that occurs, use the List User statement to check for the presence and spelling of the user
name. Names are case-sensitive and must be spelled using the same mixture of uppercase
and lowercase letters.
For example, the following object definition assigns the role “Software Developer” as the
owner of a business object titled “Graphics Display Routine:”
add businessobject “Computer Program” “Graphics Display Routine” A
policy “Software Development”
description “Routine for displaying information on a color monitor”
owner “Software Developer”;
In this example, the administrator may not have a specific name of a user to assign to the
business object. Therefore, the name of a role is used. All persons assigned the role of
Software Developer can access the object as the owner. At a later time, a Person can be
reassigned as the owner according to the reassign access rules specified in the governing
policy.
Policy Clause The Policy clause of the Add Businessobject statement assigns a policy to the business
object. A policy controls a business object. It specifies the rules that govern access,
approvals, lifecycle, versioning and revisioning capabilities, and more. If there is any
question as to what you can do with a business object, it is most likely answered by
looking at the object’s policy. Specifically, a policy defines the following information:
• The types of objects the policy will govern.
• The types of formats that are allowed for file checkin and the default format.
• Where and how checked-in files are managed.
• How revisions will be labeled.
• The number and order of each object state.
Version 10 663
• The restrictions, if any, associated with each object state.
Since this information is required for a business object to be usable, a Policy clause must
be included in the business object definition. If you are unsure about the policy, you
should examine the policy definition with the Print Policy statement (see Working With
Policies in Chapter 17).
The policy specified must be defined to govern the type of business object being created.
If the policy name you give in this clause is not found, an error message results. If that
occurs, use the List Policy statement to check for the existence and spelling of the policy
name.
For example, the following object definition assigns the “Software Development” policy
to a business object titled “Graphics Display Routine:”
add businessobject Routine “Graphics Display Routine” 1
policy “Software Development”;
description “Routine for displaying information on a color monitor”
After this statement is processed, the business object will be created and the “Software
Development” policy will control who can access the object and the object’s lifecycle
states.
State Clause The lifecycle of a business object is assigned as part of the policy and consists of a series
of object states. A state identifies a stage in the lifecycle of an object. Depending on the
type of object involved, the lifecycle might contain only one state or many states. The
states control the actual object instances and specify what can be done with an object after
it is created. Each state defines who will have access to the object in that state, what type
of access is allowed, whether or not the object can be revised, whether or not files within
the object can be revised, and the conditions required for changing state.
The State clause of the Add Businessobject statement is used to specify the scheduled
target date for this object in a particular state. The State clause is optional. It is not
necessary to assign a date for any particular state. There may be situations where the
change from one state to another may occur at any time. For example, if automobile
insurance is contained within an object, the object might change when an accident occurs.
Since accidents are not usually planned, no schedule date can be assigned. If, however,
you have a state for policy renewal, the date can be scheduled since you know when the
policy renewal is due.
Note that this is a target date only. The object will not automatically enter that state on the
given date. The object can only be promoted after all required conditions are met—this
date will not influence those conditions. The date is intended for informational purposes
only.
When specifying the name of the state to which you want to assign a date, you must make
sure it is a valid name. If the state name given in the State clause is not found in the policy
you are assigning to the object, an error message will result. If that occurs, use the Print
Policy statement to check for the existence and spelling of the state name.
When specifying the date within a State clause, you must use the date/time formats
defined in your initialization file. If nothing is set there, the defaults are used. Consult the
Matrix Installation Guide for more information about defining date and time formats.
The date also can include the time of day. In the following example, the meridian and
timezone information are optional:
01:30:00 PM EST
When you enter both the date and time, the time should follow the date. For example:
February 1, 1999 12:52:30 GMT
The actual date/time is calculated based on the current time and date obtained from your
system clock. The acceptable range is January 1, 1902 to December 31, 2037.
For example, the following object definition will schedule the object to be in the
“Re-evaluation and Renewal” state on June 30, 2002.
add businessobject “Homeowner’s Insurance” “Hebron Family” B
policy “Primary Homeowners”
description “Homeowner’s Insurance for Hebron’s Primary Residence”
image $MATRIXHOME/demo/house.gif
state “Re-evaluation and Renewal” schedule “June 30, 2002”;
In this example, you want to remind the agent of when the homeowner’s insurance policy
should be renewed. By inserting this date, an agent might promote the object to the
“Re-evaluation and Renewal” state even if the date is June 26 (since it is close enough to
the target date of June 30th.)
Attribute Clause The Attribute clause of the Add Businessobject statement allows you to assign a specific
value to one of the object’s attributes. As stated earlier, you must assign a type to any
object being created. An object’s type may or may not have attributes associated with it. If
it does, you can assign a specific value to the attribute using the Attribute clause.
If you are unsure of either of the ATTRIBUTE_NAME or the VALUE to be assigned, you
can use the Print Type and Print Attribute statements, respectively.
For example, assume you are defining an object of type “Shipping Form” by using the
following Add Businessobject statement:
add businessobject “Shipping Form” “Lyon’s Order” A
policy “Shipping”;
description “Shipping Form for the Lyon’s Order”
image $MATRIXHOME/demo/label.gif
Only the attributes associated with an object’s type can be assigned values for the
instance.
If you were to examine the definition for the type “Shipping Form,” you might find it has
three attributes associated with it called “Label Type,” “Date Shipped,” and “Destination
Version 10 665
Type.” When this type is assigned to the object called “Lyon’s Order,” these attributes are
automatically associated with the object. It is up to you as the user to assign values to the
attributes.
If you do not assign values, they remain blank or the default is used if there is one. To
assign values, you can insert an Attribute clause into the object definition.
When you are specifying an attribute value, be sure the value is in agreement with the
attribute definition. In other words, only integer values are assigned to integer attributes,
character string values are assigned to character string attributes, and so on. Also, if the
attribute has a range of valid values, the value you give must be within that range.
You can use the Print Attribute statement to examine an attribute’s definition. For
example, assume you are unsure of the definition of “Label Type.” If you examine the
attribute definition, you might see that it is a character string value with no predefined
range. With this knowledge, you can insert an Attribute clause to define a value similar to
the following:
“Label Type” “Overnight Express”
String attributes (as well as description fields) have a limit of 2,048 KB. If you expect to
enter more data, consider checking in a file instead.
If you want to assign values to each of the three attributes, you can write the object
definition as:
add businessobject “Shipping Form” “Lyon’s Order” A
policy “Shipping”
description “Shipping Form for the Lyon’s Order”
“Label Type” “Overnight Express”
“Date Shipped” 12/22/1999
“Destination Type” “Continental U.S.”;
With this definition, each attribute associated with the type “Shipping Form” will have a
specific value and those values can be viewed whenever the “Lyon’s Order” object is
accessed.
You can view the definition of a business object at any time by using the Print
Businessobject statement and the Select Businessobject statement. These statements
enable you to view all the files and information used to define the business object. The
system attempts to produce output for each select clause input, even if the object does not
have a value for it. If this is the case, an empty field is output.
There are four forms for the Print Businessobject statement and the Select Businessobject
statement:
print businessobject OBJECTID [select SELECTABLE] [DUMP ["SEPARATOR_STR"]] [output
FILENAME] [sortattributes];
print businessobject selectable;
OBJECTID is the OID or Type Name Revision of the business object that you want to
view.
SELECTABLE specifies a subset of the business object contents.
DUMP allows you to insert formatting data into the printed information;
SEPARATOR_STR is the character used to separate business object details. A comma is
often used as the separator string.
FILENAME identifies a file where the print output is to be stored.
Print The Print Businessobject statement is the common form of the Print statement. Without
Businessobject any of the Print statement options, this statement appears as:
Statement print businessobject OBJECTID;
OBJECTID is the OID or Type Name Revision of the object you want to print.
If the OBJECTID you give is not found, an error message results. If this occurs, use the
List Businessobject statement to check the spelling of the business object name and to be
sure it exists.
The Print Businessobject statement is similar to using the object inspector in Matrix
Navigator (desktop version only).
When this statement is processed, MQL displays all information that makes up the named
business object’s definition. This information appears in alphabetical order according to
names of the object’s fields. For example, you could obtain the definition for the
“Shipping Form” “Lyon’s Order” A business object by entering:
print businessobject “Shipping Form” “Lyon’s Order” A;
Unlike the other Print statements, the Print Businessobject statement uses three optional
Print statement clauses:
• Select clause
• Dump clause
• Tcl clause
• Output clause
Version 10 667
The optional forms of the Print Businessobject statement enable you to specify the
information you want to retrieve from a business object. This subset is created by
identifying the desired fields of the business object. The field contents can be prepared for
formatting and stored in an external file. But which fields can you print and how do you
specify them? The Print Businessobject Selectable statement addresses these questions.
This statement enables you to view a listing of field choices and specify those choices, as
described in the following sections.
Select Statements Select statements enable you to view a listing of the field names that make up the business
object definition. Each field name is associated with a printable value. By selecting and
listing the field names that you want, you can create a subset of the object’s contents and
print only that subset. The system attempts to produce output for each select clause input,
even if the object does not have a value for it. If this is the case, an empty field is output.
Select can be used as a clause of the print businessobject and expand
businessobject statements (See Displaying and Searching Business Object
Connections in Chapter 36 for more information), as well as in query where clauses (See
Using Select Clauses in Queries in Chapter 39).
The Selectable clause is similar to using the ellipsis button in the graphical applications—
it provides a list from which to choose.
Notice that some of the fields are followed by square brackets and/or a ".*". The asterisk
denotes that the field can be further expanded, separating the subfields with a period. If
only one value is associated, the name appears without an asterisk. For example, the Name
and Description fields each have only a single value that can be printed. On the other
hand, a field such as type has other items that can be selected. If you expand the Type
field, you might find fields such as type.name, type.description, and
type.policy. This means that from any business object, you could select a description
of its type and find out other valid policies for it:
print businessobject Drawing 726590 B select type.description type.policy;
Version 10 669
The above may output something like this:
business object Assembly 726590 B
type.description = Assembly of parts
type.policy = Production
type.policy = Production Alternative
All items that can be further expanded have a default subfield that is used when that field
is specified alone. For example, selecting type is the same as selecting type.name, because
the default for types is the type name. Refer to Select Expressions in the Matrix PLM
Platform Programming Guide for tables of the expandable items with default values and
additional examples of Select Expression usage.
The use of square brackets in the above selectable list indicates one of two things:
• The assigned name may also be included as part of the selection. For example, an
object generally has several attributes. To select a particular attribute, you must give
the assigned name of the attribute as part of the field name.
print bus Component 45782 A select attribute[Color];
If you select attribute without specifying anything, a list of all attributes with their
values are returned. The same is true for state, format, relationship, etc.
• With the from and to selectables only, you can provide a comma delimited list of
patterns that may include wildcard characters, as a means of filtering on relationship
names and connected object types. For example:.
print bus Guide “Owners Manual” 2004 select to[N*,S*].from.name
to[N*,S*].from.revision;
For more information on selecting information on related items, refer toDisplaying and
Searching Business Object Connections in Chapter 36
FIELD_NAME can be a string, list of strings, or wildcard character (*) that represents a
printable field value associated with a business object. Each field name obeys the
following syntax:
FIELD_NAME [ASSIGNED_NAME_PATTERN].SUBFIELD_PATTERN
This yields:
business object Drawing 726596 B
name = 726596
description = Piston Assembly
type.name = Drawing
Notice that the fields appear in the order they were specified in the Select clause.
Dump Clause
When printing selected objects, notice that the returned data includes the field names. If
you do not want to print the field names, include the Dump clause. For example:
print businessobject Drawing 726596 B select name description type.name dump;
Use of the Dump clause requires explicitly specified select clauses. MQL print commands
using dump without explicitly specified select clauses are not supported.
Tcl Clause
Use the Tcl clause after the dump clause and before the output clause to return the
results in Tcl list format. This facilitates the parsing of output from MQL select
commands within Tcl code since the built-in list handling features of Tcl are used directly
on the results. For more information, see Tcl Format Select Output in Chapter 1.
Output Clause
The results of a print select statement can be saved to a text file with the use of the output
clause. For example:
print businessobject Component 12345 A select name description
dump output c:\description.txt;
Version 10 671
As shown in the above example the path can be expressed as part of the file name.
Otherwise the file will be placed in the $MATRIXHOME directory.
Sortattributes Clause
When printing business objects, the Sortattributes clause causes the command to list
attributes in the same order as in Matrix.
Copying/Cloning a After a business object is added and its values defined, you can copy or clone the object
Business Object with the Copy Businessobject statement. This statement lets you duplicate a business
object’s defining clauses and change some of the values at the same time. You might first
view the object’s contents using the Print Businessobject statements just described in
Viewing Business Object Definitions.Then you can use the Copy Businessobject clauses
listed below to modify the values you want to change. You should recognize these clauses
since they are the same in the Add Businessobject statement.
copy businessobject OBJECTID [!file] to NAME REVISION [ITEM
{ITEM}];
OBJECTID is the OID or Type Name Revision of the existing business object.
NAME is the name for the new business object. If you use the same type, name and revision
as the original business object, an error will occur and the business object will not be
copied.
REVISION is the revision label or designator. If a revision is desired, it should be
specified. Otherwise, it is "" (a set of double quotes).
ITEM is a Copy Businessobject clause. For each value you want to change in the new
business object, you specify the new value with the appropriate clause.
description VALUE
image FILENAME
vault VAULT_NAME
owner USER_NAME
policy POLICY_NAME
type TYPE_NAME
ATTRIBUTE_NAME VALUE
Any of these values can be changed as you copy the business object. Note that you only
need to include clauses for the values that you want to change. If you do not make any
changes, the values remain the same as the original business object with the new name you
have assigned.
Handling Files
If you want to clone an object without including the original files in the new object, use
the following syntax:
copy bus OBJECTID [!file] to NEWNAME REVISION [Vault];
Version 10 673
The placement of the !file clause must follow the above exactly or an error will occur.
Since files are included by default, include the !file clause and they won’t be copied. For
example:
copy businessobject “Shipping Form” “Lyon’s Order” 5 !file to
“Ryan’s Order” 1;
Modifying a After a business object is added, you can change it with the Modify Businessobject
Business Object statement. This statement lets you add or remove defining clauses or change some of their
values.
modify businessobject OBJECTID [ITEM {ITEM}];
OBJECTID is the OID or Type Name Revision of the business object you want to modify.
ITEM is the type of modification you want to make. Each is specified in a Modify
Businessobject clause, as listed in the following table. Note that you only need to specify
fields to be modified.
As you can see, each modification clause is related to the clauses and arguments that
define the business object. When you modify a business object, you first name the object
to be changed (by type, name, and revision) and then list the modification using the
appropriate clauses.
Version 10 675
The additional functionality may affect the performance of the change vault operation if
the object belongs to many sets and/or IconMails, which is why you must explicitly ask
the system to do this.
Business administrators can execute the following MQL command to enable/disable this
functionality as the default behavior for system-wide use:
set system changevault update set | on | off |;
Granting Access
Any person can grant accesses on an object to any other user as long as the person has
“grant” access. The grantor is allowed to delegate all or a subset of his/her accesses on the
current state.
The MQL command and ADK methods for granting business objects allow users to:
• grant an object to multiple users
• have more than one grantor for an object
• grant to any user (person/group/role/association)
• use a key to revoke access without specific grantor/grantee information
Custom ADK programs and MatrixOne applications can take advantage of the
enhancements by using the MQL and ADK methods. However, desktop Matrix and
Matrix Web Navigator user interfaces do not support these changes.
The Matrix history feature records one entry for each grant with the corresponding
grantor, grantee, granteeaccess, and granteesignature. Previously, when there was a new
access delegation, history recorded the new grantee and the previous grantee. However,
with multiple grants, the new grantee is recorded but there is no historical record of the
previous grantee.
For details on accesses, see User Access in Chapter 10.
For example:
modify bus Assembly 123 0 grant stacy access all key Buyer;
Revoking Access
You can use several approaches to revoke granted access to a business object:
• If you have Revoke access, you can remove all granted access on a business object
with:
mod bus TYPE NAME REVISION revoke all;
For example:
mod bus Part Sprocket 3 revoke all;
• You can revoke all accesses granted by a specific grantor with:
mod bus TYPE NAME REVISION revoke grantor USER;
For example:
Version 10 677
mod bus Part Sprocket 3 revoke grantor Jo;
The above command removes all grants made by grantor Jo. This command
completes successfully if the context user is Jo, or if the context user has Revoke
access; otherwise, an error is generated.
• You can revoke all accesses granted to a specific grantee with:
mod bus TYPE NAME REVISION revoke grantee USER;
For example:
mod bus Part Sprocket 3 revoke grantee Jackie;
This will revoke all grants where Jackie is the grantee. This command executes
successfully if the current context is Jackie or if the current context has Revoke
access; otherwise, an error is generated.
• You can specify both grantee and grantor to revoke the grant made between them
with:
mod bus TYPE NAME REVISION revoke grantor USER grantee USER;
For example:
mod bus Part Sprocket 3 revoke grantor Jo grantee Jackie;
This will revoke the grant between grantor Jo and grantee Jackie. If the context
user is Jo, or if the context user has Revoke access, this command will succeed;
otherwise, an error will be generated.
• To revoke the grant without specific grantor/grantee information, you can specify an
identifier, or key, defined when the grant was made:
mod bus TYPE NAME REV revoke key KEY;
In addition, the key is selectable as follows:
print bus|set TYPE NAME REV select grantkey;
expand bus|set TYPE NAME REV select grantkey;
The following example demonstrates the use of keys to grant and revoke access, and
includes MQL print bus output on the object:
MQL< >mod bus Assembly 123 0 grant bill access read,checkin,show key Supplier;
MQL< >mod bus Assembly 123 0 grant bill access read,checkin,checkout,show key
SupplierEngineer;
MQL< >mod bus Assembly 123 0 grant stacy access all key Buyer;
MQL< >print bus Assembly 123 0 select grant.*;
business object Assembly 123 0
grant[creator,bill].grantor = creator
grant[creator,bill].grantor = creator
grant[creator,stacy].grantor = creator
grant[creator,bill].grantee = bill
grant[creator,bill].grantee = bill
grant[creator,stacy].grantee = stacy
grant[creator,bill].granteeaccess = read,checkin,show
grant[creator,bill].granteeaccess = read,checkin,checkout,show
grant[creator,stacy].granteeaccess = all
grant[creator,bill].granteesignature = FALSE
grant[creator,bill].granteesignature = FALSE
grant[creator,stacy].granteesignature = FALSE
grant[creator,bill].grantkey = Supplier
grant[creator,bill].grantkey = SupplierEngineer
grant[creator,stacy].grantkey = Buyer
Be aware that Revoke access is a very powerful access. By giving a user Revoke access,
you are saying that this user can revoke anyone’s grants.
Moving Files
You can move files from one object to another (or another format of the same object)
using the modify bus command, provided you have checkout access to the from object
and checkin access to the to object. Moving files is equivalent to doing a checkout, delete
file and then checkin to a new format or object. However, the files are not actually moved
at all (the files stays in the same store - same physical machine location). The command
simply changes the metadata so that the files no longer appear to belong to the original
object but now belong to the new object.
modify businessobject BO_NAME move [format FORMATNAME] from BO_NAME FILE_TO_COPY;
Files are copied (appended) from the object specified in the from clause (the “from
object”) to the object being modified (the “to object”). If a format is specified just after the
keyword move, the files will be moved to that format. Otherwise, each file will keep its
existing format as long as that format is available in the to object. If not, it will use the
default format of the to object.
If only a format is given for the from object (part of FILES_TO_COPY), all files of that
format are moved. If no format is specified, then the default format is assumed. If any of
the specified files is not found with the specified or assumed format, an error is issued and
no action is taken.
Version 10 679
Creating a Revision of an Existing Business
Object
The ability to create revisions can be granted or denied depending on the object’s state and
the session context. For example, let’s assume you are an editor working on a cookbook.
A cookbook is composed of Recipe objects. Recipe objects are created by the Chef who
writes the recipe, perhaps in the description field of the object. He then promotes the
Recipe to the “Test” state, where he makes the dish and tastes it. At this point, he either
approves it and sends it to the next state (perhaps “Submitted for Cookbook”), reassigning
ownership to you (the editor), or he may want to revise it, incorporating different
ingredients or varying amounts. Therefore, the “Test” state would have to allow revisions
by the owner. The Recipe object could then be revised, the new revision starting in the
first state of the lifecycle. Once the Recipe is approved, revisions should not be allowed;
so, the “Submitted for Cookbook” state would not allow revisions.
To revise a business object, use the Revise Businessobject statement:
revise businessobject OBJECTID [to REVISION_NAME] [!file];
OBJECTID is the OID or Type Name Revision of the object you want to revise.
REVISION_NAME is the revision designator to be assigned.
In order to maintain revision history, the new object should be created with the revised
business object statement even though it is possible to create what looks like a new
revision by manually assigning a revision designator with the Add or Copy Businessobject
statement. (However, you can add existing objects to a revision chain, if necessary. Refer
to Chapter 35, Adding an Object to a Revision Sequence for more information.) The table
below shows the differences between using the revise businessobject statement
and the copy businessobject statement.
Not all business objects can be revised. If revisions are allowed, the Policy definition may
specify the scheme for labeling revisions. This scheme can include letters, numbers, or
Since no revision designator is given, the new business object may be called the following
(assuming the revision scheme of 1, 2, 3 ...):
“Shipping Form” “Lyon’s Order” 6
If you want to skip over the next revision number and assign a different number, you can
do so as:
revise businessobject “Shipping Form” “Lyon’s Order” 5 to 10;
Now the revised business object has a revision designator equal to ten.
Note that you cannot use a designator that has already been used. If you do, an error
message will result.
Handling Files If you want to revise an object without including the original files in the new object, use
the following syntax:
revise businessobject OBJECTID [to REVISION_NAME] [!file];
The placement of the !file clause must follow the above exactly or an error will occur.
Since files are included by default, include the !file clause and they won’t be inherited. For
example:
revise businessobject “Shipping Form” “Lyon’s Order” 5 !file;
Adding an Object You can use MQL to add an object to the end of an existing revision sequence, as long as
to a Revision the object is not already a member of another revision sequence. Attempts to add an object
Sequence in the middle of an existing revision chain, or to add an object that is already part of a
revision sequence will cause the MQL command to error.
Creating new revisions has several side affects. When appending to a revision sequence
with the MQL command, these behaviors are handled as described below:
Version 10 681
• Float/Replicate rules. Ordinarily the float/replicate rules for relationships cause
relationships to be moved/copied to new revisions. These rules are ignored; no
relationships are added or removed to/from the inserted object, nor are any
relationships added or removed to/from any of the previously existing members of the
target sequence.
• File Inheritance. Ordinarily, a new revision of an existing object inherits all files
checked into the original object. When using this interface, if the appended object
already has checked in files, it does not inherit any files from the revision sequence. If
the appended object has no files checked in, the behavior is controlled by the file
keyword in MQL.
• Triggers. No triggers will fire.
• History. Revision history records will be recorded on both the new object and its
previous revision (that is, both objects that are specified in the MQL command).
To add an object to an existing revision sequence, use the Revise Businessobject
statement:
revise businessobject OBJECTID bus NEWOBJECTID [file];
OBJECTID is the OID or Type Name Revision of the last object in a revision chain.
NEWOBJECTID is the OID or Type Name Revision of an existing object that is not
already part of any revision sequence.
The optional file keyword applies only if the new object has no files checked in, in
which case it specifies whether files should or should not be inherited from the revision
sequence to which it is being added. The default is !file, so no files are inherited. This
flag is ignored if NEWOBJECTID contains files.
You can remove an entire business object (including all checked in files) or you can
remove single files from the business object with the Delete Businessobject statement:
delete businessobject OBJECTID [[format FORMAT_NAME] file FILENAME{,FILENAME}];
Or
delete businessobject OBJECTID [[format FORMAT_NAME] file all];
OBJECTID is the OID or Type Name Revision of the business object to be deleted or
from which files should be deleted.
FORMAT_NAME is the name of the format of the files to be removed from the business
object. If none is specified the default format is assumed.
FILENAME indicates a checked in file to be removed from the business object. You can
use the All argument (rather than FILENAME) to remove all checked in files for a given
format.
When this statement is processed, Matrix searches the list of business objects. If the
named business object is found, any connections it has are first removed, (so that history is
updated on the object on the other ends) and then that object is deleted along with any
associated files. If the name is not found, an error message results.
For example:
delete businessobject Person “Cheryl Davis” 0;
After this statement is processed, the business object is deleted and any relationships with
that object are dissolved. You will receive the MQL prompt for another statement.
To remove a checked in file of format ASCII text, enter the following statement:
delete businessobject Assembly “Telephone Model 324” AD
format “ASCII Text”
file assemble324.doc;
When deleting files from the last object in a revision chain, only the link to the files is
deleted. However, when deleting a file/format from a business object that is not the last in
a revision chain, the file is first copied to the next object in the revision chain, if a
reference to that file exists. This latter case may impact performance.
Version 10 683
684 MQL Guide
36
Working with
Business Objects
Making Connections Between Business Objects...................................... 686
Connect Businessobject Statement................................................................ 686
Disconnect Businessobject Statement ........................................................... 687
Preserving modification dates......................................................................... 688
Modify Connection Statement......................................................................... 688
Displaying and Searching Business Object Connections........................ 690
From Clause ................................................................................................... 691
To Clause ....................................................................................................... 691
Relationship Clause........................................................................................ 692
Type Clause.................................................................................................... 692
Select To/From Patterns................................................................................. 693
Filter and Activefilter Clauses ......................................................................... 695
Recurse Clause .............................................................................................. 695
Set Clause ...................................................................................................... 696
Structure Clause ............................................................................................. 696
SELECT_ BO and SELECT_REL Clauses .................................................... 697
Dump Clause and Output Clause ................................................................... 699
Tcl Clause....................................................................................................... 700
Recordseparator Clause................................................................................. 700
Terse Clause .................................................................................................. 700
Limit Clause .................................................................................................... 700
Working with Saved Structures................................................................... 701
Checking Files In and Out of a Business Object ....................................... 702
Checking In Files ............................................................................................ 702
Checking Out Files ......................................................................................... 705
Moving Files.................................................................................................... 707
Locking and Unlocking a Business Object ................................................ 708
Locking a Business Object ............................................................................. 708
Unlocking a Business Object .......................................................................... 709
Modifying the State of a Business Object .................................................. 710
Approve Businessobject Statement................................................................ 710
Ignore Businessobject Statement ................................................................... 711
Reject Businessobject Statement ................................................................... 711
Unsign Signature ............................................................................................ 712
Disable Businessobject Statement ................................................................. 712
Enable Businessobject Statement .................................................................. 712
Override Businessobject Statement ............................................................... 713
Promote Businessobject Statement................................................................ 714
Demote Businessobject Statement................................................................. 714
Version 10 685
Making Connections Between Business
Objects
Connect The Connect Businessobject statement links one business object to another. For example,
Businessobject you could have a business object that contains information about a particular course. That
Statement information might include the course content, schedule date, instructor, student list, cost,
and so on. As each student enrolls in the course, you might create a business object for that
student. This object might include the student’s background, experience, and personal
information.
After a student record object is created, it stands alone with no relationships attached to it.
However, if you view the course object, you might want to see the student objects
associated with it. Also, if you view the student object, you might want to see the course
objects associated with that person.
Use the Connect Businessobject statement to establish the relationship between the
business object containing the student record and the object containing the course
information:
connect businessobject OBJECTID relationship NAME [to|from] OBJECTID [ATTRIBUTE_NAME
VALUE {ATTRIBUTE_NAME VALUE}] [preserve];
OBJECTID is the OID or Type Name Revision of the business object. It can also include
the in VAULTNAME clause, to narrow down the search.
NAME is the name of the relationship type to use to connect the two named business
objects. If the relationship name is not found or defined, an error message will result.
ATTRIBUTE_NAME VALUE indicates attributes assigned to the relationship you are
creating.
The Connect Businessobject statement has two forms: TO and FROM. The form you
choose depends on the placement of the two objects you are connecting. You specify
which business object will be associated with the TO end and which will be associated
When this relationship is established, Cheryl’s object is again assigned to the FROM end
and the course is assigned to the TO end.
If you are defining equivalent objects, either object could be defined as the TO end or the
FROM end. However, in hierarchical relationships, direction is important. With these
relationships, you should consult the relationship definition before creating the
connection. Otherwise, you may have difficulty locating important objects when needed.
If you assigned the wrong object to the connection end, you will have to dissolve the
relationship and re-define it.
Disconnect The Disconnect Businessobject statement dissolves a link that exists between one business
Businessobject object and another. For example, a student enrolled in a class might discover that other
Statement commitments make it impossible to attend. Since the student is withdrawing from the
class, you no longer need a relationship that was established between that student and the
class.
Use the Disconnect Businessobject statement to dissolve the relationship between the
business object containing the student record and the object containing the course
information:
disconnect businessobject OBJECTID relationship NAME [to|from] OBJECTID [preserve];
OBJECTID is the OID or Type Name Revision of the business object. It may also include
the in VAULTNAME clause, to narrow down the search.
NAME is the name of the relationship type that exists between the two named business
objects. If the relationship name is not found or defined, an error message will result.
The Disconnect Businessobject statement has two forms: TO and FROM. The form you
choose depends on the placement of the two objects you are disconnecting. In our
Version 10 687
example, the student was assigned to the FROM end and the course was assigned to the
TO end. Therefore, to dissolve this relationship, you can write either of these statements:
disconnect businessobject Student “Cheryl Davis” Sophomore
relationship “Student/Course Relationship”
to Course “C Programming Course” 1;
disconnect businessobject Course “C Programming Course” 1
relationship “Student/Course Relationship”
from Student “Cheryl Davis” Sophomore;
In the first statement, the TO form is used. You are dissolving the relationship of student
to the course. In the second statement, the FROM form is used. You are dissolving the
relationship from the student.
Regardless of the form you use, once processed, the relationship that was established
between the student and the course is removed.
The direction you select makes a difference when you are dissolving relationships. If you
reversed the order of the two business objects, the names would not be found. For
example, assume you entered this statement:
disconnect businessobject Student “Cheryl Davis” Sophomore
relationship “Student/Course Relationship”
from Course “C Programming Course” 1;
This statement assumes that the student is the TO end and the course is the FROM end. If
Matrix searched for this relationship, a match would not be found and an error message
would result. You should check to be sure you know the correct direction before writing
your Disconnect Businessobject statement. See Displaying and Searching Business Object
Connections in the next section to learn how to search for relationships.
Preserving By default when connection are created or deleted (with connect bus or disconnect bus
modification dates statements), the modification dates of the objects on both ends of the connection are
updated, which means that they are locked. You can use the preserve option on both the
mql connect and disconnect statements to avoid this update and the locking of the business
objects.
Modify Connection To change a Relationship type, the relationship instance can be specified by its defined
Statement name together with the objects on both ends of the connection as follows:
OBJECTID is the OID or Type Name Revision of the business object. It may also include
the in VAULTNAME clause, to narrow down the search.
REL_NAME is the new Relationship type name.
For example:
modify connection bus Assembly 50463 A to Component 33457-4 G type “As Designed”;
If the object is connected to another object by more than one instance of the specified
relationship type, the above command will generate an error. To make modifications when
The following is an example of the result, which could be saved to a file if an output
clause was used in the above command:
1 Drawing from Drawing 50402 A
id = 19.24.5.16
1 Process Plan from Process Plan 50402-1 C
id = 19.26.6.6
The returned list of IDs can then be used to make changes to any of the relationships,
using the following syntax:
modify connection ID type REL_NAME;
For example:
modify connection 19.10.6.13 type Documents;
Or
modify connection bus OBJECTID from|to OBJECTID relationship
NAME from|to NEW_OBJECTID;
Notice that any combination of IDs and full specification by type name and revision (or
relationship name) are allowed. When using type, name and revision you may also include
in VAULTNAME.
Deleting History
System administrators only can purge the history records of a connection via MQL. For
details, see Deleting History in Chapter 37.
Version 10 689
Displaying and Searching Business Object
Connections
The Expand Businessobject statement enables you to view connected objects. Depending
on the form of this statement that you use, you can list the objects that lead to an object,
from it, meet selected criteria, or are of a specific type. Then you can place the list of
objects into/onto a set, or output the information to a file.
The Expand Businessobject statement also allows you to select properties of either
connected business objects or the relationship which links them. To expand a business
object use the following syntax:
expand businessobject OBJECTID {EXPAND_ITEM};
relationship PATTERN
type PATTERN
filter PATTERN
activefilters [reversefilters]
recurse [to | N |]
| all |
structure NAME
SELECT_BO
SELECT_REL
DUMP [RECORDSEP]
tcl
output FILENAME
terse
limit N
The Expand Businessobject statement is similar to using the Star or Indented browser in
Matrix Navigator. Use of the clauses that specify criteria is like applying a filter in one of
the relationship browsers. In addition to a list of connected business objects that meet the
specified criteria, the Expand Businessobject statement provides information about the
connections. The level number of the expansion and the relationship type of the
connection are provided along with the business object name, type, and revision.
The following example shows basic use of the Expand Businessobject statement. It tells us
that there is one drawing attached to a component (with the relationship of “Drawing to”),
When using the Expand Businessobject statement you must provide a business object
specification as your starting point. Depending on the keyword (and values) that follow,
you will expand in one direction only or in both. In addition, you can use the recurse
argument to indicate that you also want to expand the business objects connected/related
to the initially specified business object.
The expansion happens one level at a time, and any relationships/business objects that do
not satisfy the where clause are removed from the list and those expansion paths are
abandoned. Consider the following example:
Assembly -> Part -> Doc
expand bus Assembly from recurse 2 where 'type == Doc' will
return nothing, since the first level expansion finds Part, which is not of type Doc, so the
second expansion is not performed at all.
Each clause is described in the sections that follow.
From Clause When you use the From clause, you expand away from the starting object. This gives you
all of the related objects defined as the TO ends in a relationship.
Think of the starting object as the tail of the arrow—you are looking for all of the arrow
heads.
For example, assume you have an object that contains a component used within larger
assemblies. If you have the name of the component, you might want to know which
objects (larger assemblies) it goes into:
expand businessobject Component “Mini Numeric Keypad” C from;
This might produce a list of objects that could include a calculator, telephone, and VCR.
Since no other criteria is specified, this statement gives you ALL objects that occupy the
TO end of a relationship definition.
To Clause When the To clause is used, the named business object is used as the starting point.
However, it is assumed that the object is defined as the TO end of the relationship
definition. Therefore, you are looking for all objects that lead to the named object—the
objects defined as the FROM ends in a relationship definition.
Using the To clause can be useful to work backward. For example, you may want to
determine components that make up a particular subassembly. If you know the name of
the subassembly object, you can do this by writing a statement similar to:
expand businessobject Component “Mini Numeric Keypad” C to;
This might produce a list of objects that contain buttons, plastic housings, and printed
circuit boards. All related objects defined as the FROM connection end are listed. This
may include additional objects that you don’t need. To help reduce the number of objects
Version 10 691
listed and to allow you to look in both directions, you can use the Relationship or Type
clauses of the Expand Businessobject statement.
Relationship The Relationship clause of the Expand statement returns all objects connected to the
Clause starting object with a specific relationship. The command can be made to be more
particular by specifying the direction of the relationship and/or the types of objects to
return.
The Relationship clause is useful when you are working with an object that may use
multiple relationship types. If the starting object can connect with only one relationship,
this clause has the effect of listing all of the connection ends used by the starting object. It
does not matter if the end is defined as a TO end or a FROM end. Only the relationship
type is important.
For example, assume you have an object that contains a drawing. This drawing may use a
number of relationships such as a User Manual Relationship, Design Relationship,
Marketing Relationship, and Drawing Storage Relationship. You may want to examine all
objects that use a particular relationship type. For example, you might want to learn about
all objects that have used the drawing for marketing. To do this, you might enter a
statement similar to:
expand businessobject Drawing “Mona Lisa” 1
relationship “Marketing Relationship”;
This statement lists all related objects that have the Marketing Relationship type. It
searches through all connections that use the Marketing Relationship definition for the
named business object. If it finds the object, MQL displays the other connection end and
identifies the end’s directional relationship. It does not matter if the related objects are
defined as the FROM end or the TO end of the relationship. Only the relationship type is
important.
Type Clause The Type clause of the Expand Businessobject statement displays all related objects of a
specific object type. This clause is useful when you are working with an object that may
be connected to multiple object types. (If the starting object can connect with only one
object type, this form is similar to the Relationship form using a wild character pattern.)
For example, assume you have an object that contains a training course. To this object you
might have related objects that are of type Evaluation, Student, Materials, and Locations.
You may want to examine all the Evaluation type objects to trace the course’s progress in
meeting student needs. You might enter a statement similar to:
expand businessobject Course “Money & Marketing” 3 type Evaluation;
This statement lists all related objects that have the Evaluation type. Those objects might
belong to multiple relationship types (such as Professional Evaluation Relationship or
Student Evaluation Relationship). It does not matter if the related objects are defined as
the FROM end or the TO end of the relationship. Only the object type is important to
locate and display the output objects.
If the specified type has sub-types, these are also listed. For example:
expand bus Assembly 12345 1 type Part;
Version 10 693
• If there are no connected objects that meet the criteria, such as if
to.from[X*].name were specified, there is no output.
Filter and The filter clause of the Expand Businessobject command allows you to specify an
Activefilter existing filter(s) that is defined within your context to be used for the expansion. You can
Clauses use wildcard characters or an exact name. For example:
expand bus Assembly 12345 1 filter OpenRecs;
In addition, you can use the activefilter clause to indicate that you want to use all filters
that are enabled within your context. For example:
expand bus Assembly 12345 1 activefilter;
Recurse Clause Once you have a list of related objects, you may also want to expand these objects. This
would be like using the There and Back feature in the Star browser of Matrix Navigator.
The Recurse clause of the Expand Businessobject statement expands through multiple
levels of hierarchy by applying the Expand statement to each business object found:
recurse to [N|all]
N is any number indicating the number of levels that you want to expand.
all indicates that you want to expand all levels until all related business objects are
found.
It is recommended that you specify a recursion level with the Recurse clause. Recurse to
all may be time-consuming.
This example shows use of the Expand Businessobject statement with the Recurse (to all)
clause:
MQL<40> expand businessobject Drawing 726592 A recurse to all;
Version 10 695
6 Photo from Photo 017012 1
6 Photo from Photo 117012 1
6 Drawing from Drawing 726591 C
7 Markup from Markup 002715 1
6 As Designed from Assembly 726596 B
7 As Designed to Component R0056-48 A
7 As Designed from Assembly 726590 A
8 As Designed to Component R0045-62 B
8 As Designed to Component 23348S C
8 As Designed to Component W2236-8S A
8 Comment from Comment 013070 1
8 Drawing from Drawing 726590 B
8 Layout from Layout 100265 F
8 Analysis from Stress Analysis 100345 D
9 Specification from Specification 2278 C
10 Specification Change from Spec. Change Notice 00247 1
10 Specification Change from Spec. Change Notice 00252 1
7 Drawing from Drawing 726596 B
Set Clause Once you have a list of related objects, what do you do with them? In some cases, you will
simply search for a particular object and will not need to reference the output object again.
In other cases, you may want to capture the output business objects and save them for
another time. That is the purpose of the Set clause of the Expand Businessobject
statement.
When the Set clause is included within the Expand Businessobject statement, the related
objects are placed within a set and assigned a set name. This set may already contain
values or it may be a new set created for the purpose of storing the output.
When it is an existing set, the previous values are either replaced or appended, depending
on the keyword you use. If the Set clause begins with the keyword INTO, the existing set
contents are discarded and only the current output is saved. If the Set clause begins with
the keyword ONTO, the new output is added onto the existing set contents. (This is the
same as when working with queries, described in Query Overview in Chapter 39.)
The Set clause is optional. It can be used in conjunction with the other Expand
Businessobject clauses according to the following guidelines:
• You can specify a set (with the Set clause) OR select properties for output (with the
Select clause) but not both in the same command.
• You can specify that the results are saved in a set OR request that output be saved in a
file (with dump/output clauses), but not both in the same command.
Structure Clause If you expand an object using the filter, from, to, relationship, and/or
type clauses of the Expand Businessobject command, you have defined a structure that
is not necessarily easy to define again. If you want to reuse this structure you can save it to
your workspace using the structure clause. For example:
expand bus Assembly 12345 1 from relationship “As Designed” filter Part structure
“Assigned Parts”;
A structure stores all the information—including objects, relationships, and relative level
number — necessary to recreate the printed output. The structure clause is optional. It can
SELECT_ BO and The Expand Businessobject statement provides a means of displaying information about
SELECT_REL the connected business objects. Information contained in the connected business object
Clauses can be selected as well as data on the relationship that connects the objects. It works in a
similar manner on the expand statement as it does on the print statement. The differences
are:
• a list of the selected values, one for each object or relationship that meets the criteria,
is presented.
• the keyword businessobject or relationship must be used with the select
clause before the requested items so that Matrix knows from where the information is
to come.
For example:
expand bus Assembly "MTC 1234" C select bus description select relationship id;
The system attempts to produce output for each select clause input, even if the object does
not have a value for it. If this is the case, an empty field is output. For information on the
select clause, see Select Statements in Chapter 35. Also refer to Appendix A, Select
Expressions in the Matrix Navigator Guide .
When you use the select clause to expand on both business objects and relationships,
business object selectables are always listed before relationship selectables in the output,
even if they appear in the opposite order in the select list.
Version 10 697
connected objects or expanded relationships (unless another SELECT_BO or
SELECT_REL clause is included.
Dump Clause and You can use the Set clause (described above) or the Dump/Output clause, but not both
Output Clause clauses.
You can specify a general output format for listing the expanded information to a file and
for output. This is done with the Dump clause:
[dump "SEPARATOR_STR"] [output FILENAME]
SEPARATOR_STRING is a character or character string that will appear between the field
values. It can be a tab, comma, semicolon, carriage return, and so on. If you do not specify
a separator string value, a space is used. If a tab or carriage return is used as a separator,
double quotes (“ ”) are required.
FILENAME identifies a file where the print output is to be stored.
The Dump clause specifies that you do not want to print the leading field name (a space)
and that you want to separate the field names with the separator string you provide.
Separator strings can make the output more readable. If many of the business objects have
similar field values, using tabs as separators will make the values appear in columns. The
Output clause prints the expanded information to a file that you specify (FILENAME).
This example shows use of the Expand Businessobject statement with the Dump clause:
MQL<42> expand businessobject Drawing 726592 A recurse to all dump “::”;
1::Drawing::from::Component 726592 A
2::As Designed::from::Assembly 726590 A
3::As Designed::to::Component 726590 A
4::Drawing::from::Drawing 726593 A
5::Comment::from::Drawing 012528 1
6::Comment::to::Drawing 725492 A
7::Markup::from::Markup 002670 1
3::As Designed::to::Component 726594 A
4::Drawing::from::Drawing 726594 A
5::Markup::from::Markup 002590 1
3::As Designed::to::Component 726595 A
4::Drawing::from::Drawing 726595 A
5::Markup::from::Markup 002733 1
4::Note::from::Note 014258 1
5::Note::to::Component 726591 B
6::Note::from::Note 012499 1
6::Photo::from::Photo 017012 1
6::Photo::from::Photo 117012 1
6::Drawing::from::Drawing 726591 C
7::Markup::from::Markup 002715 1
6::As Designed::from::Assembly 726596 B
7::As Designed::to::Component R0056-48 A
7::As Designed::from::Assembly 726590 A
8::As Designed::to::Component R0045-62 B
8::As Designed::to::Component 23348S C
8::As Designed::to::Component W2236-8S A
8::Comment::from::Comment 013070 1
8::Drawing::from::Drawing 726590 B
8::Layout::from::Layout 100265 F
8::Analysis::from::Stress Analysis 100345 D
Version 10 699
9::Specification::from::Specification 2278 C
10::Specification Change::from::Spec. Change Notice 00247 1
10::Specification Change::from::Spec. Change Notice 00252 1
7::Drawing::from::Drawing 726596 B
Tcl Clause Use the Tcl clause after the dump clause, if used, and before the output clause to return the
results in Tcl list format. This facilitates the parsing of output from MQL select commands
within Tcl code since the built-in list handling features of Tcl are used directly on the
results. For more information, see Tcl Format Select Output in Chapter 1.
Recordseparator The Recordseparator clause of the Expand Businessobject statement allows you to define
Clause which character or character string you want to appear between the dumped output of each
object when the expand command requests information about multiple objects.
recordseparator [”SEPARATOR_STR”]
Terse Clause You can specify the terse clause so that object IDs are returned instead of type, name, and
revision. This is done with the Terse clause. For example, the following statement returns
a list of object IDs for objects connected to the specified Part:
expand businessobject Part "35735" A terse;
Limit Clause Since you may be accessing very large databases, you should consider limiting the number
of objects to display. Use the Limit clause to define a value for the maximum number of
objects to include in the expansion. For example, to limit the expansion to 25 objects, you
could use a statement similar to the following:
expand businessobject Part "35735" A limit 25;
Once you have saved a structure using the Structure Clause of the Expand Businessobject
command, you can list, print, delete, and save it to another user’s workspace using the
following commands.
list structure;
The print structure command displays the results in the same manner as expand
bus does. For example, after executing the above statement (which outputs the data to the
MQL window, as well as saving it as a structure), you could execute the following to
generate the output again:
print structure “Assigned Parts”;
Within the print structure command you can also use select clauses on either the business
object or the relationship as well as use the output/dump or terse clauses.
The copy structure command lets you copy structures to and from any kind of user.
Including overwrite will replace the copied structure with any structure of the same
name that was in the touser’s workspace.
If an object has been disconnected or deleted, it is no longer listed as part of the structure.
On the other hand, if other objects were connected since the structure was saved, they
would not automatically appear in the output of the print structure command. Another
expand statement would need to be executed with the structure clause to update the
structure.
Version 10 701
Checking Files In and Out of a Business Object
An individual file or an entire directory including all files and subdirectories can be
checked in/out of a business object.
Checking In Files A business object does not need to have files associated with it. It is possible to have
business objects where the object’s attributes alone are all that is required or desired.
However, there will be many cases where you will want to associate external files with a
business object within Matrix. To make this association, you must check the files into the
object. This is called file checkin.
Checking in a file allows other Matrix users to access a file that might not otherwise be
accessible. For example, assume you have a file in your personal directory. You would
like to make this file accessible to your local group and the quality assurance group. In a
typical computer environment, there is no way to allow selective groups to have access
while denying others. You could give the file Group Access or World Access. The Group
Access takes care of your immediate group but not the quality assurance group. If you
give World Access to the file, ANYONE can access it, not just quality assurance. You can
overcome this problem with Matrix.
The policy definition can designate when specified persons, groups, and roles have access
to an object. When an object is accessible, any files that are checked into that object are
also accessible. Therefore, if a group has read access to an object, they also have read
access to any files checked into the object. If the policy definition for an object includes
enforced locking, no checkin for that object is allowed until the lock is released, regardless
if the file being checked in is going to replace the checked-out file which initiated the lock
or not.
When working with checked in files, keep in mind that the copy you check in will not
change if you edit your own personal copy. While you maintain the original, any edits that
you make to that file will not automatically appear in Matrix. The only way to have those
changes visible to other Matrix users is to either check in the new version or to make the
edits while you are within Matrix (i.e., with Open for Edit).
Checking in files is controlled by the Checkin Businessobject statement.
In this example, it is assumed that the default format is for document files. If a default
format is some other format, you would need to modify the above statement to include the
Format clause. Let’s assume that the two files are standard ASCII text files. Since that is
not the default format, the above statement would have to be modified as:
checkin businessobject Assembly “Phone Model 324” AD
format “ASCIItext”
$MATRIXHOME/telephones/assemble324.doc
$MATRIXHOME/telephones/disassemble324.doc;
If someone wants to access the files, the associated format will define the statements used
to view, edit, and print the files.
Although the format identifies how the files are to be accessed, it does not necessarily
mean that access is permitted. Access is controlled by the policy. Also, editing access can
be controlled by the use of exclusive editing locks (see Locking and Unlocking a Business
Object).
Unlock Clause
When an object first has files checked in, it is probably not locked. However, when files
are later checked out to be updated, the object should be locked to prevent other users
from editing the file’s contents. Checking in the file has the effect of updating the Matrix
database with the latest version of the file. But typically, the object owner will want to
maintain editing control over the file. For example, the owner may be editing a CAD file
and the file is still undergoing changes. If the owner checks in the file, others can monitor
the process even though they cannot make changes. After the edit is complete the owner
would remove the lock. The owner would include the Unlock clause in the Checkin
statement. Alternatively, if access permitted, the lock could be removed with the unlock
businessobject statement.
If locking is enforced in the object’s policy, the checkin will fail if:
• the object is not locked
• the user performing the checkin in is not the one who locked it
When an object is locked, no files can be checked in to the object. This means that
attempts to open for edit, as well as checkin, will fail. Files can be checked out of a locked
object, and also opened for view.
This behavior ensures that one user is not overwriting changes made by another.
Version 10 703
Client and Server Clauses
The client and server clauses allow programmers to specify where files are to be
located when their programs are executed from a Web client (either downloaded or run on
the Collaboration Server). These clauses are used to override the defaults and are ignored
when executed on the desktop client.
The default file location for checkin from the Web is the Collaboration Server.
Programmers can specify client to have the file copied from the Web client machine
instead. For example:
mql checkin bus Assembly Wheel 0 format ascii file \tmp\text.txt;
would look for the file text.txt on the server, while the following would look for it on the
client:
mql checkin bus Assembly Wheel 0 client format ascii file \tmp\text.txt;
The server clause can be specified to force the default location. For example:
mql checkin bus Assembly Wheel 0 server format ascii file \tmp\text.txt;
Append clause
The append clause is used when the files should be added to the contents of the object.
Without this flag, the checkin command will overwrite any files that are contained in the
object, even if the file names are unique. For example:
checkin businessobject Assembly “Phone Model 324” AD
format “ASCIItext”
$MATRIXHOME/telephones/assemble324.doc;
checkin businessobject Assembly “Phone Model 324” AD
format “ASCIItext”
append $MATRIXHOME/telephones/disassemble324.doc;
Without the append flag, the Assembly Phone Model 324 AD would contain just one file:
disassemble324.doc.
Be aware that when you use the append clause to check in a file, and the business object
already contains a file of the same name, the file is overwritten without a prompt for
verification.
Store clause
The store clause can be used to override the default store (defined in the policy) that
determines where a governed business object’s files are kept. For example, a business
application’s checkin page may be used by several different companies, each with its own
file store. The logic on the page could be designed to check which company the current
user is employed by, and check the file into the store assigned to that company. For
example:
checkin bus Part Sprocket 3 append store CAD c:\sprocket.cad;
Edit—To open files and launch the appropriate application for editing, use the following
statement:
openedit businessobject OBJECTID [format FORMAT_NAME] [file FILENAME];
Checking Out Files Once a file is checked in, it can be modified by other Matrix users who have editing access
(if the object is not locked). This means that the original file you checked in could undergo
dramatic changes. As the file is modified, you may want to replace your original copy
with one from Matrix, or you may want to edit the file externally. This is done by checking
out the file.
When a business object file is checked out, a copy is made and placed in the location
specified. This copy does not affect the Matrix copy. That file is still available to other
Matrix users. However now you have your own personal copy to work on.
In some situations, a person may be denied editing access but allowed checkout privilege.
This means the user may not be allowed to modify the Matrix copy, but can obtain a
personal copy for editing. This ensures that the original copy remains intact. For example,
a fax template is checked in but each user can check out the template file, fill in individual
information, and fax it.
Checking out files is controlled by the Checkout Businessobject statement, as discussed
below.
OBJECTID is the OID or Type Name Revision of the business object. It can also include
the in VAULTNAME clause, to narrow down the search.
FORMAT_NAME is the name of the format of the files to be checked out. (Formats are
defined in the Format Clause of the Policy associated with the object Type.) If no format
is specified, only files of the default format are checked out. If a format is specified, but no
filename(s), all files of the specified format are checked out.
Version 10 705
FILENAME is a specific file (or files) that you want to check out, or specify all to
checkout all files in the specified format.
DIRECTORY is the complete directory path where you want the checked out copies. If the
directory is omitted, the checked out copies are copied to the current system directory.
For example, assume you have written procedures for assembling and disassembling a
telephone. After checking them in, you allow Matrix users to edit the procedures to correct
errors or ambiguities. To do this, they might write a statement similar to:
checkout businessobject Assembly “Phone Model 324” AD
file assemble324.doc $MATRIXHOME\telephones;
After this statement is processed, a copy of the named file will appear in directory
specified. If the directory is not specified, the files are copied to the current system
directory.
If you have checked out an earlier version of a file to edit it, be careful not to overwrite the
external file with the new checked out file. If the same file name already exists in the target
directory, no error message appears in MQL. The new file will overwrite the existing file
without further warning.
Lock Clause
In the Checkout statement, it is assumed that the file being checked out is unlocked to
allow other users to edit the file’s contents. To prevent other users from checking files in,
lock it by including the keyword Lock within the Checkout statement. Only the person
who locks the object will be allowed to check in files. For example, the following
statement locks and checks out a file:
checkout businessobject Assembly “Phone Model 324” AD lock;
Using the lock to prevent editing is useful when you are making extensive changes to a
file externally from Matrix. While those changes are being made, you do not want to
worry about any other users modifying the original file without your knowledge. When
you have completed your changes, you can check the file in and remove the lock at the
same time.
It is possible for a locked object to be unlocked by a user with unlock access. For example,
a manager may need to unlock an object locked by an employee who is out sick.
If locking is enforced in the object’s policy the object MUST be locked within the checkout
command if the updated file is to be checked back in.
The client clause can be specified to force the default location. For example:
mql checkout bus Assembly Wheel 0 client format ascii file text.txt \tmp;
Format Clause
In addition to checking out all files of the default format from the object, you can check
out only specific formats of the file. Files can be checked in using multiple formats. For
example, a text file may be checked in using two formats that represent two different
versions of a word processing program. You can check out only the file associated with
the specific format by using the Format clause.
The Format clause of the Checkout Businessobject statement specifies the format of the
file(s) to check out. If no format is specified, the default format is assumed. For example,
the following statement checks out all files associated with the 1998 word processing
program.
checkout businessobject “Phone Book” “Boston Region” K format 1998;
Moving Files You can move files from one object to another (or another format of the same object)
using the modify bus command. This is virtually the same thing as doing a checkout,
delete file and then checkin to a new format or object. Refer to Chapter 35, Modifying a
Business Object, for more information.
Version 10 707
Locking and Unlocking a Business Object
A business object can be locked to prevent other users from editing the files it contains.
Even if the policy allows the other user to edit it, a lock prevents file edit access to
everyone except the person who applied the lock.
Locking a business object protects the object’s contents during editing. When an object is
opened for editing, it is automatically locked by Matrix, preventing other users from
checking in or deleting files. However, if they have the proper access privileges, other
users can view and edit attribute values and connections of the object and change its state.
A lock on an object prohibits access to the files it contains, but still allows the object to be
manipulated in other ways.
But, if the checkout and edit are separate actions, the object should be manually locked.
Without a lock, two people might change an object’s file at the same time. With a lock,
only the person who locked the object manually is allowed to check files into the object.
As with an automatic lock, other users can view attributes, navigate the relationships, and
even checkout an object’s file. But, they cannot change the contents by checking in or
deleting a file without unlocking the object.
It is possible for a locked object to be unlocked by a user with unlock access. For example,
a manager may need to unlock an object locked by an employee who is out sick. See User
Access in Chapter 10.
If another user has unlock privileges and decides to take advantage of them, the person
who established the lock will be notified via IconMail that the lock has been removed and
by which user. This should alert the lock originator to check with the unlocker (or the
history file) before checking the file back in to be sure that another version of the same file
(with the same name and format) has not been checked in, potentially losing all edits made
by the unlocker.
If the object is governed by a policy which uses enforced locking, the object must be
locked for files to be checked in. Users must remember to lock an object upon checkout if
they intend to checkin changes, since the separate lock statement will be disabled when
locking is enforced.
In the sections that follow, you will learn more about the statements that lock and unlock a
business object.
Locking a A business object can be locked using either the Lock statement or the Checkout
Business Object statement. The Checkout statement is used to copy files from an object (as discussed in
Checking Out Files). The Lock statement is used for general locking purposes.
If locking is enforced in the policy, the lock must be part of the checkout statement.
Attempts to use the lock statement will fail.
The first statement sets the context and identifies the person placing the lock. The second
statement applies the lock to the object. Unless Barbara or someone with unlocking
privileges removes the lock, no one else can alter the object’s contents.
Unlocking a A business object can be unlocked using either the Unlock statement or the Checkin
Business Object statement. The Checkin statement is used when you are associating files with the object
(as discussed in Checking In Files). The Unlock statement removes a lock from a business
object:
unlock businessobject OBJECTID [comment TEXT];
The first statement sets the context and identifies the person removing the lock. This must
be the same person who placed the lock on the object or someone who has unlocking
privileges. The second statement unlocks the object. Unless Barbara or someone with
unlocking privilege removes the lock, no one else can alter the object’s contents.
Under some circumstances, it may be necessary to have someone other than the lock
owner remove the lock. For example, in the case of extended illness, a manager may
decide to have someone else edit the object. When the manager removes the lock, the
original lock owner will receive a notice (IconMail) that the lock was removed. If desired,
an additional message can be sent along with the notification. This is the purpose of the
Comment clause of the Unlock statement.
Version 10 709
Modifying the State of a Business Object
Approve The Approve Businessobject statement provides a required signature. When a state is
Businessobject defined within a policy, a signature can be required for the object to be approved and
Statement promoted into the next state. You provide the signature with the Approve Businessobject
statement. For example, to approve an object containing an application for a bank loan,
you might write this Approve Businessobject statement:
approve businessobject “Car Loan” “Ken Brown” A
signature “Loan Accepted”
comment “Approved up to a maximum amount of $20,000”;
In this statement, the reason for the bypass is clearly defined so that users understand the
reason for the initial bypass of the signature. As time passes, this information could easily
become lost. For that reason, you should include a Comment clause in the statement even
though it is optional.
The Ignore Businessobject statement involves control over a single signature. An object is
promoted to the next state automatically when all requirements are met if the state was
defined with the Auto Promote clause. Bypassing the Ignore Businessobject signature
does not necessarily mean that the object will meet all of the requirements for promotion
to the next state. It only means that one of the requirements for promotion was
circumvented. Depending on the state definition, another user or condition may be
required to approve the program.
Reject The Reject Businessobject statement provides a required signature. In this case, the
Businessobject signature is used to prevent an object from being promoted to the next state.
Statement For example, a bank manager may decide that more clarification is required before s/he
will approve of car loan. S/he can enter this information by writing the following Reject
Businessobject statement:
reject businessobject “Car Loan” “Ken Brown” A
signature “Loan Accepted”
comment “Need verification of payoff on student loan before I’ll approve
a loan up to a maximum amount of $20,000”;
Any other users can see the reason for the rejection. Since the signature was provided, the
object cannot be promoted unless someone else overrides the signature or the reason for
rejection is addressed.
Version 10 711
The Reject Businessobject statement provides a single signature. However, this signature
does not necessarily mean that the object will be demoted or completely prevented from
promotion to the next state. It only means that one of the requirements for promotion was
denied. Depending on the state definition, another user may override the rejection.
Unsign Signature The Unsign Signature statement is used to erase signatures in the current state of an object.
Any user with access to approve, reject, or ignore the signature has access to unsign the
signature.
For example the command to unsign the signature "Complete" in object Engineering
Order 000234 1 is:
unsign businessobject "Engineering Order" 000234 1 signature Complete;
Disable The Disable Businessobject statement holds an object in a particular state indefinitely.
Businessobject When a business object is in a disabled state, it cannot be promoted or demoted from that
Statement state. Even if all of the requirements for promotion or demotion are met, the object cannot
change its state until the state is enabled again.
Use the Disable Businessobject statement to disable a business object within a state:
disable businessobject OBJECTID [state STATE_NAME];
Labeling an object as disabled within a state does not affect the current access. This means
that the designer can continue to work on the object in that state.
Enable The Enable Businessobject statement reinstates movement of an object. When a business
Businessobject object is in a disabled state, it cannot be promoted or demoted from that state. If you then
Statement decide to allow an object to be promoted or demoted, you must re-enable it using the
Enable Businessobject statement.
When an object is first created, all states are enabled for that object. If a manager or other
user with the required authority decides that some states should be disabled, s/he can
Override The Override Businessobject statement turns off the signature requirements and lets you
Businessobject promote the object. Since a policy is a generic outline that addresses the majority of needs,
Statement it is possible to have special circumstances in which a user, such as a manager, may decide
to skip a state rather than have the object enter the state and try to meet the requirements of
the state. This is done using the Override Businessobject statement.
Use The following syntax to write an Override Businessobject statement:
override businessobject OBJECTID [state STATE_NAME];
Now, assume that the object is currently in the Initial Release state and a promotion would
place it in the Testing state. How does the Override Businessobject statement affect the
object when it is promoted? The object will be promoted directly from the Initial Release
state into the Final Release state.
Version 10 713
Promote The Promote Businessobject statement moves an object from its current state into the next
Businessobject state. If the policy specifies only one state, an object cannot be promoted. However, if a
Statement policy has several states, promotion is the means of transferring an object from one state
into the next.
The order in which states are defined is the order in which an object will move when it is
promoted. If all of the requirements for a particular state are met, the object can change its
state with the Promote Businessobject statement.
promote businessobject OBJECTID;
Demote The Demote Businessobject statement moves an object from its current state back into its
Businessobject previous state. If the policy has only one state or is in the first state, an object cannot be
Statement demoted. However, if a policy has several states, demotion is the means of transferring an
object backward from one state into the previous state.
If an object reaches a state and you determine that it is not ready for that state, you would
want to send the object back for more work. This is the function of the Demote
Businessobject statement:
demote businessobject OBJECTID;
When using the Demote Businessobject statement, an object cannot be demoted if:
• The current state is disabled.
• The signature requirements for rejection were not met or overridden (ignored).
• There are no other states prior to the current state.
Version 10 715
History Overview
Matrix provides a history for each business object, detailing every activity that has taken
place since the object was created.
An object’s historical information includes:
• The type of activity performed on the object, such as create, modify, connect, and so
on.
• The user who initiated the activity.
• The date and time of the activity.
• The object’s state when the activity took place.
• Any attributes applicable when the activity took place.
You can add a customized history through MQL to track certain events, either manually or
programmatically.
History records can be selected when printing or expanding business object, set, or
connection information using the MQL select clause. In addition, when printing all
information about a business object, set, or connection, history records can be excluded.
System administrators only can purge the history records of a business object or
connection via MQL. In addition, all history records of a business object or connection
can be deleted with one command.
History can be turned off in a single session by a System Administrator for the duration of
the session or until turned back on. In addition, if an implementation does not require
history recording, or requires only custom history entries, Matrix “standard” history can
be disabled for the entire system. Turning history recording off can improve performance
in very large databases, though certain standards may require that it is turned on.
You can add a customized history record through MQL to track certain events, either
manually or programmatically. Two parts of the entry are definable: the Tag, and the
Comment. The Tag appears at the beginning before the hyphen. Then the user/time/date/
current stamp is automatically made, followed by the comment defined by the
implementer. The MQL syntax for defining a history entry is:
modify bus OBJECTID add history VALUE [comment VALUE];
modify connection ID add history VALUE [comment VALUE];
modify connection bus OBJECTID from|to OBJECTID relationship NAME add history VALUE
[comment VALUE];
For example, the following command could be added to an MQL/Tcl program which
backs up the database:
modify bus $OBJECT add history Backup comment Backup was completed to tape #12345;
The history entry for the above would look something like:
(Backup) - user: billy time: Mon Mar 30, 1998 11:28:15 AM Eastern Standard Time state:
planned comment: Backup was completed to tape #12345.
All custom history event entries are enclosed in parentheses in order to distinguish them as
such.
Custom history entries do not respond to the history off or set system history
off commands.
Version 10 717
Selecting History Entries
History records of either business objects or connections can be selected with the select
clause of the following MQL commands:
In addition, when using the above commands to print all information about a business
object, set or connection, history records can be excluded.
Excluding History When all information about a business object or connection is printed with the print
when Printing or commands listed above, everything about the object(s) or connection, including its
Expanding history, is listed.
The !history clause allows you to exclude the history of a business object or
connection, which can be quite lengthy, when printing all the other information. For
example, the following command:
print bus Assembly RB45621 A !history;
prints out all information about the business object except its history.
Selecting History History can be selected from either business objects or connections, in a manner similar to
selecting the owner or current state of an object. For more information on the MQL select
mechanism refer to the Select Expressions appendix in the Matrix Navigator Guide.
To select history from a business object use the following syntax:
print bus OBJECT select history.ITEM [history.ITEM];
Where:
OBJECT is the Type, Name, and Revision of the business object or its object ID.
ITEM can be one of the following:
EVENT
time
user
state
EVENT
time
user
ID is the identification of the connection as returned with the select connection ID print
command.
The second command listed will actually return the history of all connections on the
specified OBJECT.
Each ITEM clause is described in the sections that follow.
history.EVENT clause
The history.EVENT clause can also be used on a business object or connection. It
returns a list of history records of the EVENT event type. For business objects, EVENT
can be one of the following:
Example 1
For example, if a user enters:
print bus Assembly PR6792 A select history.modify;
Version 10 719
modify - user: ted time: Mon Aug 6, 1998 8:50:11 PM state: Assigned
description: test3
Example 2
You may want to find the date when a signature has been satisfied. Use a statement similar
to the following:
print bus ECR 000122 "" select history.approve;
Example 3
To return a list of customized history entries created with the add history VALUE
[comment VALUE] clause of the modify bus statement, use the custom event. For
example:
print bus 2340988 select history.custom;
might return:
(Backup) - user: billy time: Mon Mar 30, 1998 11:28:15 AM Eastern
Standard Time state: planned comment: Backup was completed to tape
#12345.
Note that freezethaw is one event that can be selected and will return both freeze and
thaw entries.
history.time clause
The history.time clause can be used on a business object or connection to return a list
of the timestamps of every history record. For example:
print connection 1234568 select history.time;
returns a list of the different times that the connection was updated in the database:
time: Fri, Jan 2, 1998 1;48:41 PM
time: Thurs, Feb 6, 1998 2:20:13 PM
time: Wed, April 8 1998 10:15:12 AM
history.user clause
The history.user clause can be used on a business object or connection. It essentially
gives a list of all users who have operated on the object or connection. For example, the
following:
print bus Manual NewBook 1 select history.user;
may output:
user: sue
user: tim
user: jerry
gives a list of all states the business object was in after every change to the business
object:
state: Proposed
state: Assigned
state: Described
Version 10 721
Deleting History
System administrators only can purge the history records of a business object or
connection via MQL. History records can be deleted based on:
• the type of event (for example, checkout, checkin);
• the user who performed the event (for example, angie);
• the date the operation took place (for example, on, before, or after a specified date).
In addition, all history records of a business object or connection can be deleted with one
command. Users can optionally write the purged entries to a file. The purge history event
itself is recorded in history.
While the various forms of the command provide flexibility and control over exactly
which history records are purged, very complicated variations are not supported. This is to
ensure that accidental deletions of important historical events do not occur. In other
words, as the criteria for deletion becomes more complex, more delete history statements
will be required.
In the History of an object, other objects are sometimes referred to. This is an issue if
“Show” access has been denied for a particular user or object in the database. The
performance impact of determining whether the current user has access to see the Type,
Name and Revision of such objects would be significant and unavoidable. Individual
history records can be deleted using the delete history clause of the modify
businessobject or modify connection command. This can be used in action
triggers to remove such records.
delete history The delete history clause of the modify businessobject or modify connection
clause clause can be used alone, or with other refining ITEM clauses. If there are no ITEMS
specified, then all history records associated with the business object or connection are
deleted. The syntax is:
modify businessobject OBJECT delete history [ITEM {ITEMS}];
OR
Where:
OBJECT is the Type, Name, and Revision of the business object or its object ID.
event EVENT
by USER
| on |
| before | DATE
| after |
Notice that the keywords “keep” and “last” are mutually exclusive. Also, only one form of
the DATE item is allowed in a single statement.
For example:
modify bus Document PO567932 1 delete history;
deletes all history records and adds a history entry similar to the following:
History Records Purged by ted on 11/9/98 12:02:03 PM.!!!
Each ITEM that can be used with the history delete clause is described in the sections
that follow.
Notice that the purge history event record itself can be deleted; however, doing so will be
generate a new purge history record.
A list of events can be specified, separated by a space and a comma. For example:
modify bus Document PO567932 1 delete history event changetype, changename;
Version 10 723
removes all freeze and thaw history entries on the connection. Note that freezethaw is one
selectable EVENT.
To purge customized history entries created with the add history VALUE [comment
VALUE] clause of the modify bus statement, use the custom event. For example:
by USER item
All history entries that log events performed by a particular user can be deleted from a
business object or connection using the by USER item.
USER is the person listed in the history entry as the user who performed the operation, and
so is, or was, a valid Matrix Person.
A list of persons can be specified, separated with a space and a comma. Also, the by
USER clause can be used with or without the keyword by and in conjunction with other
ITEMS. A few examples:
modify bus Document PO567932 1 delete history by chris, tom;
deletes the records of all events performed by either chris or tom from the object’s history.
modify bus Document PO567932 1 delete history event changetype by chris, tom;
DATE items
History entries can be deleted from a business object or connection based on when the
event occurred using one of the following DATE items.
on DATE
before DATE
after DATE
DATE is the timestamp in the history entry, and may include the time of day, or just the
date of the event. If the time of day is not included, then the input is considered a date.
Otherwise the timestamp is taken into account. For example:
modify bus Document PO567932 1 delete history date 11/04/98;
deletes the record of all events that occurred on November 4, 1998. On the other hand:
modify bus Document PO567932 1 delete history before “11/04/98 12:00:00 PM EST”;
deletes all entries for events that occurred before November 4, 1998 at 12:00:00 PM EST.
The after keyword can be used in the same manner.
Quotes must be used when including the time of day in the DATE.
Dates and times can be entered in the command as specified in the initialization file. Refer
to the Matrix Installation Guide for more information on date/time formats.
keep item
The keep item is used in conjunction with the other ITEMS and provides a way of
reversing what is specified. The ITEMS that follow keep, are NOT deleted, but all other
records are. The one exception is that any purge history records are always kept.
In addition to what is specified with the keep clause of the delete history statement,
purge history entries are always kept, unless ALL history is deleted.
Keep can be used with any of the other ITEMS except last, but it must be specified
immediately following the delete history clause. For example:
modify bus Document PO567932 1 delete history keep event create;
deletes all records except those for checkin events performed by bill on the date specified.
When used, keep must be specified immediately following the delete history clause,
and may NOT be used in conjunction with last.
last item
The last item is used in conjunction with the other ITEMS (except for keep) to purge
the most recent history records that meet the criteria. When used, last must be specified
immediately following the delete history clause. For example:
modify bus Document PO34675 1 delete history last event checkin by bill;
deletes only one entry - for the last checkin event performed by bill.
When used, last must be specified immediately following the delete history clause,
and can NOT be used in conjunction with keep.
Version 10 725
For example:
modify bus Document PO34675 delete history event checkin output history.txt;
deletes all “checkin” records and stores them in the file “history.txt.” The file will be
saved in MATRIXHOME unless a path is specified. For example, on a PC, the following
could be used:
modify bus Document PO34675 delete history event checkin output
“d:\archive\history.txt”;
Important Notes • Every time a purge is performed for either business objects or connections, a history
record is added which says:
history = purge - user: USER time: TIMESTAMP 'History Records Purged'
These purge entries are deleted only when all history is deleted, or when explicitly
deleting them, with something like the following:
modify bus Document PO34675 1 delete history event purge;
However, if you use the keep clause to save all “modify” records, for example, all
“modify” and “purge” records will actually be kept.
• If NO ITEMS are specified, then ALL history records associated with a business
object or connection are purged, including any purge history entries.
• Once history records are purged, they are completely deleted from the database. So a
system administrator should take extra care before purging records. If the output
clause is used, the text file could be checked into an object, but entries cannot be
imported back into the history log.
• History deletion operations cannot be strung together into one single command. For
example, THE FOLLOWING IS NOT SUPPORTED:
modify bus TYPE NAME REVISION delete history event lock keep event lock by Jo;
The delete history clause has been kept as simple as possible, to ensure that unwanted
deletions do not occur. To actually do something like the above, (delete only lock
records but keep lock records performed by one user), a different selection criteria
must be formulated and accomplished using more than one command.
History can be disabled for a session, or until re-enabled. This improves performance
when creating or importing many objects. This is also useful when bulk loading business
objects, or if a different history logging mechanism is implemented.
System Administrators can execute the following MQL command.
history off;
After this command is executed, events that occur on the local machine do not cause a
history record to be logged in the database. This command affects only the local machine;
concurrent user’s sessions are not affected. In addition, subsequent sessions on the local
machine will have history enabled by default.
To enable history recording for the session again, a System Administrator should use:
history on;
MQL also allows history to be enabled or disabled with the use of a toggle command.
Depending on the current setting, history can be enabled/disabled using the same
command.
To enable/disable history as a toggle, a System Administrator should use:
history;
When the recording of history is turned off in a program object, it is important that it gets
turned back on. While this may be done at the bottom of the program object’s code
section, history recording is re-enabled automatically when a top-level program ends its
execution even if the code is exited before reaching the command that turns it back on
(either successfully or in error).
When used with the ADK MQLCommand class, an MQL session lasts for only the
duration of one command and not throughout the ADK program’s session. This means
that the history off command has no effect, since the MQL session ends and so
history is turned back on. This is the design intent, to ensure that history is not
inadvertently turned off for longer than intended.
Since logging history affects performance as well as the size of the database, in some
implementations it may be desirable to turn history off permanently. Refer to Controlling
System-wide Settings in Chapter 3 for more information.
The system history setting should not be issued within program objects, since it affects all
users. In these cases, the temporary MQL history off command should be used instead.
Version 10 727
728 MQL Guide
38
Working With Sets
Set Defined .................................................................................................... 730
Understanding Differences ............................................................................. 730
Creating a Set ............................................................................................... 731
Copying or Modifying a Set Definition........................................................ 734
Copying (Cloning) a Set Definition.................................................................. 734
Modifying a Set Definition ............................................................................... 734
Expanding Objects Within Sets................................................................... 736
Relationship Expressions ............................................................................... 736
Expanding From ............................................................................................. 736
Expanding To.................................................................................................. 737
Relationship Clause........................................................................................ 738
Type Clause.................................................................................................... 738
Filter and Activefilter Clauses ......................................................................... 739
Recurse Clause .............................................................................................. 739
Set Clause ...................................................................................................... 739
Dump and Output Clauses ............................................................................. 740
Tcl Clause....................................................................................................... 740
Terse Clause .................................................................................................. 740
Limit Clause .................................................................................................... 741
Viewing Set Definitions ................................................................................ 742
Select Clause.................................................................................................. 742
Pagination....................................................................................................... 743
Dump Clause .................................................................................................. 743
Recordseparator Clause................................................................................. 743
Tcl Clause....................................................................................................... 744
Output Clause................................................................................................. 744
Sorting sets ................................................................................................... 745
Expressions on Sets .................................................................................... 746
Count .............................................................................................................. 746
Sum ................................................................................................................ 746
Maximum, Minimum, Average ........................................................................ 747
Median ............................................................................................................ 747
Standard Deviation ......................................................................................... 747
Correlation ...................................................................................................... 748
Deleting a Set ................................................................................................ 749
Version 10 729
Set Defined
A set is a logical grouping of business objects created by an individual user. Sets are often
the result of a query made by a user. For example, the user may want to view all drawings
created for a particular project or find information about objects having a particular
attribute or range of attributes. While sets can be manually constructed based on the needs
and desires of the individual, queries are a fast means of finding related business objects.
The contents of a set can be viewed at any time and objects can be added or deleted from a
set easily. However, a user has access only to sets created while in session under his/her
context.
Understanding It is important to realize that sets are not the same as connections between business
Differences objects. Connections also group business objects together in a window for users to
analyze; however, connections are globally known links rather than local links.
Sets are often the result of a query. To save the contents of a query in a set, see Evaluating
Queries in Chapter 39.
To manually define a set from within MQL, use the Add Set statement:
add set NAME [ADD_ITEM {ADD_ITEM}];
member businessobject ID
BUS_OBJ_COLLECTION_SPEC
[!|not]hidden
Member Clause
After assigning a set name, specify the business objects to include in the set. Business
objects can be referenced by their complete business object name/specification or by their
ID:
member businessobject TYPE NAME REVISION [in VAULT]
Or
member businessobject ID
When using the complete specification, you must include the object type, the name of the
object, and the revision designator in this order. Note that some business objects may not
have a revision designator. If a revision designator was not assigned to an object, “”
(double quotes) are required in MQL.
Version 10 731
The following are examples of complete business object names:
businessobject Assembly "Keyboard" ""
businessobject Assembly Monitor E
businessobject Assembly "Laptop Computer" AA
To group these business objects into a set, you can write a statement similar to the
following:
add set "Computer Set"
member businessobject Assembly "Keyboard" ""
member businessobject Assembly Monitor E
member businessobject Assembly "Laptop Computer" AA;
When this statement is processed, a set called “Computer Set” is created. It contains three
business objects. These objects will appear grouped in a window whenever the set name is
referenced.
You can also optionally specify the vault in which the business object is held. When the
vault is specified, only the named vault needs to be checked to locate the business object.
This option can improve performance for very large databases.
When business objects are created they are given an internal ID. As an alternative to TYPE
NAME REVISION, you can use this ID when indicating the business object to be acted
upon. The ID of an object can be obtained by the use of the print
businessobject... selectable statement. Refer to Viewing Business Object
Definitions in Chapter 35 for information.
Hidden Clause
You can specify that the new set object is “hidden” so that it does not appear in the set
chooser in Matrix. Users who are aware of the hidden set’s existence can enter its name
manually where appropriate. Hidden objects are accessible through MQL.
Property Clause
Integrators can assign ad hoc attributes, called Properties, to the set. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add set NAME property NAME [to ADMINTYPE NAME] [value STRING];
Version 10 733
Copying or Modifying a Set Definition
Copying (Cloning) After a set is defined, you can clone the definition with the Copy Set statement. If you are
a Set Definition copying the set to another user, you must have set context privileges for that user.
This statement lets you duplicate set definitions with the option to change the value of
clause arguments:
copy set SRC_NAME DST_NAME [COPY_ITEM {COPY_ITEM}] [MOD_ITEM {MOD_ITEM}];
MOD_ITEMs are modifications that you can make to the new definition. Refer to the table
below for a complete list of possible modifications.
Modifying a Set You can use the Modify Set statement to modify any set that you have defined. Users with
Definition set context privileges can modify a set of another user.
This statement lets you add or remove business objects and change set options:
modify set NAME [MOD_ITEM {MOD_ITEM}];
Each modification clause is related to the clauses and arguments that define the set.
For example, assume you have a set named “Product Comparison.” You want to add two
new business objects and remove an old one. You could write a statement similar to the
following:
modify set "Product Comparison"
add businessobject "Scent Formula" "Perfume P39" B;
add businessobject "Scent Formula" "Perfume P40" A;
remove businessobject "Scent Formula" "Scent P13" D;
To remove a set entirely, use the Delete Set statement, as described in Deleting a Set. To
change the name of the set, remove the current set and create a new set.
Version 10 735
Expanding Objects Within Sets
Viewing Business Object Definitions in Chapter 35 describes how you can use the Expand
Businessobject statement to display connections made between two objects. The Expand
Businessobject statement enables you to see other objects connected to the one you have.
Depending on which form of this statement you use, you can display the objects that are
connected to it, connected from it, meet selected criteria, or are of a specific type.
When using the Expand Businessobject statement, you are working with a single business
object. To expand multiple objects, use the Expand Set statement, which expands each of
the objects contained within a set. The Expand Set statement also lets you search for
relationships that meet the search criteria.
expand set NAME [from|to [relationship PATTERN [type PATTERN]]] filter PATTERN
activefilters [reversefilters] [recurse [to N|all]] [into|onto set NAME][dump]
[tcl] [output FILENAME] [terse] [limit N];
Relationship Select expressions are applied directly to relationship instances, enabling selection of its
Expressions relationship attribute values for use in Indented Tables and Visual Cues.
For example, the following can be used in a table column definition:
relationship [Drawing].attribute[Quantity] =
Expanding From When you use the From form of the Expand Set statement, you expand away from the
starting object. This gives you all the related objects that are defined as the TO ends in a
relationship. Consider the starting object as the tail of the arrow and you are looking for all
the arrow heads. The From form uses the syntax:
expand set NAME from [relationship PATTERN] [type PATTERN] [RECURSE_CLAUSE]
[SET_CLAUSE|DUMP CLAUSE]];
Expanding To When the To form of the Expand Set statement is used, the set’s business objects are again
used as the starting point. However, now it is assumed that each object is defined as the
TO end of the relationship definition. Therefore, you are looking for all objects that lead to
the named object. These are the objects defined as the FROM ends in a relationship
definition.
The To form of the Expand Set statement uses the syntax:
expand set NAME to [relationship PATTERN] [type PATTERN] [RECURSE_CLAUSE]
[SET_CLAUSE|DUMP CLAUSE];
The To form of the Expand clause returns all objects connected to the starting object (the
arrow points in) regardless of the relationship used.
Version 10 737
Relationship The Relationship form of the Expand Set statement displays all objects connected in a
Clause specific relationship. This is useful when you are working with an object that may use
multiple relationship types. If the starting object can only connect with one relationship,
this form has the effect of listing all the connection ends used by the starting object. These
ends may be defined as a TO end or a FROM end—it does not matter. Only the
relationship type is of importance.
The Relationship clause uses the syntax:
expand set NAME [from|to] [relationship PATTERN] [type PATTERN] [RECURSE_CLAUSE]
[SET_CLAUSE|DUMP CLAUSE];
The Relationship clause of the Expand Set statement returns all objects connected to the
starting object with a specific relationship. The command can be made more particular by
specifying the direction of the relationship and/or the types of objects to return.
Type Clause The Type clause of the Expand Set statement displays all related objects of a specific
object type. This is useful when you are working with a set of objects that may be
connected to multiple object types. If the starting object can only connect with one object
type, this form is similar to the Relationship form using a wildcard pattern. The Type form
uses the syntax:
expand set NAME [from|to] [relationship PATTERN] [type PATTERN] [RECURSE_CLAUSE]
[SET_CLAUSE|DUMP CLAUSE];
This statement expands each of the objects contained in the “Training Courses” set. It lists
any related objects that have the Evaluation type. Those objects might belong to multiple
relationship types (such as “Professional Evaluation Relationship” or “Student Evaluation
Relationship”). It does not matter if the related objects are defined as the FROM end or the
TO end of the relationship. Only the object type matters in the location and display of the
output objects.
Filter and The filter clause of the Expand Set command allows you to specify an existing
Activefilter filter(s) that is defined within your context to be used for the expansion. You can use
Clauses wildcard characters or an exact name. For example:
expand set Assembly 12345 1 filter OpenRecs;
In addition, you can use the activefilter clause to indicate that you want to use all filters
that are enabled in within your context. For example:
expand set Assembly 12345 1 activefilter;
Recurse Clause Once you have a list of related objects, you may also want to expand these objects. The
Recurse clause of the Expand Businessobject statement expands through multiple levels
of hierarchy by applying the Expand statement to each business object found:
recurse to [N|all]
N is any number indicating the number of levels that you want to expand.
all indicates that you want to expand all levels until all related business objects are
found.
Set Clause Once you have a list of related objects, what do you do with them? In some cases, you can
simply search for a particular object and you will not need to reference the output object
again. In that case, you might want to display the expansion output on your terminal.
However, in other cases, you may want to capture the output and save it. That is the reason
for the Set clause of the Expand Set statement.
Version 10 739
The Set clause uses the following syntax:
into|onto set SET_NAME
onto The new output is appended onto the existing set contents. This is the same
as when working with queries and sets.
The Set clause is optional. If no Set clause is included with the Expand Set statement, the
output listing of related objects is displayed.
Dump and Output You can specify a general output format for listing the expanded information to a file and
Clauses for output. This is done with the Dump clause:
[dump “SEPARATOR_STR”] [output FILENAME]
SEPARATOR_STR is a character or character string that should appear between the field
values. It can be a tab, comma, semicolon, carriage return, etc. If you do not specify a
separator string value, a space is used.
FILENAME identifies a file where the print output is to be stored.
The Dump clause specifies that you do not want to print the leading field name (a space)
and that you want to separate the field names with the separator string you provide.
Separator strings can make the output more readable. If many of the business object have
similar field values, using tabs as separators will make the values appear in columns.
The Output clause prints the expanded information to a file that you specify (FILENAME).
Tcl Clause Use the Tcl clause after the dump clause, if used, and before the output clause to return the
results in Tcl list format. This facilitates the parsing of output from MQL select commands
within Tcl code since the built-in list handling features of Tcl are used directly on the
results. For more information, see Tcl Format Select Output in Chapter 1.
Terse Clause You can specify the terse clause so that object IDs are returned instead of type, name, and
revision. This is done with the Terse clause. For example, the following statement returns
a list of object IDs for objects connected to the specified Part:
expand set Part "35735" A terse;
Version 10 741
Viewing Set Definitions
You can view the definition of a set using the Print Set statement. This statement enables
you to view all the clauses used to define the set name:
print set NAME [SELECT] [start START_RANGE] [end END_RANGE]
[dump [SEPARATOR_STR]] [recordseparator SEPARATOR_STR] [tcl]
[output FILENAME];
If the set name is not found, an error message will result. If that occurs, use the List Set
statement to check for the presence and spelling of the set name.
Each clause is described in the sections that follow.
Select Clause The Select clause of the Print Set statement enables you to obtain more information than
just the type, name or revision of the object.
To first examine the general list of field names, use this statement:
print businessobject selectable;
The selectables for sets are the same as for business objects. Refer to Select Statements in
Chapter 35 for this list.
The Selectable clause is similar to using the ellipsis button in the graphical applications—
it provides a list from which to choose.
The Select clause enables you to list all the field names whose values you want to print.
select [+] FIELD_NAME [ [FIELD_NAME] ... ]
When this clause is included in the Print Set statement, the values of these fields are
printed for each business object contained within the set. For example, assume you have
four objects within a set named Components. You can see the names and descriptions of
each object with the following statement:
print set Components select name description;
Dump Clause You can specify a general output format with the Dump clause. The Dump clause
specifies that you do not want to print the leading field name and that you want to separate
the field names with a separator string that you provide:
dump [”SEPARATOR_STR”]
SEPARATOR_STR is a character or character string that you want to appear between the
field values. It can be a tab, comma, semicolon, carriage return, etc. If you do not specify a
separator string value, the default value of a comma is used. If tabs or carriage returns are
used, they must be enclosed in double quotes (“ ”).
When using the Dump clause, all the field values are printed on a single line unless a
carriage return is the separator string. This is very useful when you are processing many
business objects in a single print statement. Since the contents of one business object are
contained on each line, you can easily use another program to process the print output.
When the program reads a carriage return, it knows it has finished with the current
business object.
For example, assume you entered the following statement:
print set Components select name description
attribute[“Date Shipped”] dump;
Separator strings can make the output more readable. If many of the business objects have
similar field values, using tabs as separators makes the values appear in columns.
Recordseparator The Recordseparator clause of the Print Set statement allows you to define which
Clause character or character string you want to appear between the dumped output of each object
when the Print command requests information about multiple objects.
recordseparator [”SEPARATOR_STR”]
Version 10 743
Tcl Clause Use the Tcl clause after the dump clause, if used, and before the output clause to return the
results in Tcl list format. This facilitates the parsing of output from MQL select commands
within Tcl code since the built-in list handling features of Tcl are used directly on the
results. For more information, see Tcl Format Select Output in Chapter 1.
Output Clause The Output clause of the Print Set statement provides the full file specification and path to
be used for storing the Print Set statement output. For example, to store the above
information in an external file called components.lst, you might write a statement similar
to:
print set Components select name description attribute[“Date Shipped”] dump output
$ORDERHOME/shipping/components.lst;
By default, Matrix presents business objects in sets sorted alphabetically by Type, then
Name, then revision. You can disable sorting or specify other “Basic” properties by which
objects in sets should be sorted, by using the MX_SET_SORT_KEY environment
variable, which can set any number of basic select items (type, name, revision, owner,
locker, originated, modified, current, and policy) by which objects in sets will be
presented. Refer to the Matrix PLM Platform Installation Guide for details.
In addition to this sorting, you can explicitly sort a set by any list of select values in MQL
using the following syntax:
sort set SET_NAME [into SET_NAME] [select VALUE1 VALUE2...];
As with the sorting environment variable, you can specify ascending or descending order
by prefixing the select with + or - (ascending (+) is the default.) For instance:
sort set x select +name -owner;
This command will perform a sort on both name and owner fields. Names will be sorted
in ascending order, then owners will be sorted in descending order.
Version 10 745
Expressions on Sets
Certain kinds of Expressions are applicable to collections of business objects (as can be
obtained from Sets and Queries), returning a single answer for the entire collection. These
Expressions are formed by using one of several keywords. They are:
count
sum
maximum
minimum
average
median
correlation (cor)
All but the last of these keywords is expected to be followed by one expression, its
argument, that applies to business objects. The last one, correlation, needs to be followed
by two such expressions. Alternative spellings are indicated in parentheses. For each
keyword, you can use all lowercase, all uppercase, or first character uppercase followed
by all lowercase.
Count The count keyword takes as its argument a where-clause expression that evaluates to
TRUE or FALSE. It returns an integer that is the number of items in the collection that
satisfy the argument. A simple example of such an expression is “count TRUE”, which
evaluates to the number of objects in a collection of business objects.
For example, the following statement returns 37, indicating the number of objects of Type
‘Body Panel’ in the database:
eval expr 'count TRUE' on temp query bus 'Body Panel' * *;
The following statement returns the number of objects in the set “NewBooks” whose cost
is between 10 and 50:
eval expr 'count ( attribute[cost] >= 10 AND attribute[cost] <=
50 )' on set NewBooks;
To do the same, but exclude children’s books, you might use the following statement:
eval expr 'count ( attribute[cost] >= 10 AND attribute[cost] <=
50 LESS attribute[Reading Level] == Child )' on set NewBooks;
Sum Sum returns a real number that represents a total of all the values of the specified attribute
for all business objects in the collection. For example, the following statement returns the
The following statement returns the ratio of total price to total cost for all objects in the set
“Components”:
eval expression '( sum attribute[price] ) / ( sum attribute[cost] )' on set
Components;
Maximum, Maximum returns a real number that represents the single largest value for the specified
Minimum, Average attribute for all business objects in the collection. For example, the following expression
checks the value contained in the “diameter” attribute of each business object in the set
“o-rings,” and returns whichever value is the highest:
eval expr 'maximum attribute[diameter]' on set “o-rings”;
Minimum returns a real number that represents the single smallest value for the specified
attribute for all business objects in the collection.
eval expr 'minimum attribute[diameter]' on set “o-rings”;
Average returns a real number that represents the average of all values for the specified
attribute for all business objects in the collection.
eval expr 'average attribute[diameter]' on set “o-rings”;
Median Median returns a real number that represents the middle number of all values for the
specified attribute for all business objects in the collection.
For example, the following shows the values, listed in numerical order, for the attribute
Actual Weight for seven business objects that comprise the set FprSet:
7 15 19 25 26 31 35
Since the middle number of seven numbers is the fourth number, the median in this case is
25. That is the value returned for the following statement:
eval expr 'median attribute[Actual Weight]' on set FprSet;
Standard Standard deviation, generally used in statistical analysis, tells how closely data
Deviation conforms to the mean in a set of data. In Matrix, it can be used to compare the values of
business object attributes. The returned value is a real number.
For example, if you know the average age of all employees, you might want to know how
many people are close to that age. The standard deviation will tell you, on average, how
much the ages of the group differ from the mean. If the standard deviation is a small
number, it could indicate that most of the people are close to the average age. If the
standard deviation is a large number, it could indicate that there is a broader spread of
ages.
Version 10 747
The following example performs a standard deviation on the age attribute of all persons in
the set Employees:
eval expr 'stddev attribute[age]' on set Employees;
If you decide that a set is no longer desired, you can delete it using the Delete Set
statement:
delete set NAME;
When a set is deleted, there is no effect on the business objects. Grouping business objects
together in a set is not the same as connecting them. While connecting business objects
makes a global link between the objects, sets provide only a local linkage that has no value
outside the local user’s context.
Version 10 749
750 MQL Guide
39
Working With Queries
Query Overview ............................................................................................ 752
Performing a Temporary Query................................................................... 753
Defining a Saved Query ............................................................................... 755
Businessobject Clause ................................................................................... 756
Hidden Clause ................................................................................................ 756
Owner Clause ................................................................................................. 757
Vault Clause ................................................................................................... 757
Expandtype Clause......................................................................................... 757
Where Clause ................................................................................................. 757
Using Select Clauses in Queries .................................................................... 767
Expressions on Queries.................................................................................. 774
Using the Escape Character ........................................................................ 777
To Enable Escaping........................................................................................ 777
How It Works .................................................................................................. 778
Using Escaping With Tcl................................................................................. 779
Exceptions ...................................................................................................... 779
Query Strategies ........................................................................................... 781
Where Clause Guidelines ............................................................................... 781
Modeling Considerations ................................................................................ 788
Avoiding Unbounded Queries......................................................................... 789
Avoiding Large Expands................................................................................. 789
Object Existence............................................................................................. 789
Query Instantiation.......................................................................................... 789
Nested Queries............................................................................................... 790
Modifying a Query Definition....................................................................... 791
Evaluating Queries ....................................................................................... 792
Deleting a Query ........................................................................................... 794
Version 10 751
Query Overview
A query is a search on the database for objects that meet the specified
criteria. The query is formulated by an individual and, in MQL, it must be
saved for subsequent evaluation. A user has access only to queries created
during a session under her or his own context. It is then run or evaluated and
Matrix finds the objects that fit the query specification. The found objects
are displayed in Matrix or listed in MQL. If the found objects are often
needed as a group, they can be saved in a set which can be loaded at any time
during a Matrix or MQL session under the same context.
There are two steps to working with queries:
• Define either a saved query that you want to use again, or a temporary
query to be used only once for a quick search.
• Evaluate the query. The query is processed and any found objects can
be put into a set.
Temporary queries allow you to perform a quick search for objects you need
only once. In this case you don’t have to first save the query itself as an
object. For example, you might want to modify a particular object that is
named HC-4....., but you have forgotten its full name or capitalization. You
could perform a temporary search (without saving the actual query) using
“HC-4*” to find all objects that have a name beginning with the letters
“HC-4”. From the resulting list, you could enter the correct name in your
modify statement.
Saved queries allow you to find, for example, all drawings created for a
particular project. You can save the results of the query in a set. As the
project proceeds, you can also name and save the query itself to use again to
update the set contents. Or you might want to repeatedly search for any
objects having a particular attribute or range of attributes. Saved queries
provide a way of finding all the objects that contain the desired information.
You can perform a temporary query that is not first named or saved within the MQL
database. In other words, a query can be evaluated without first adding it to the database as
an object. The syntax is as follows:
temporary query businessobject TYPE NAME REV
[!expandtype]
[vault VAULTNAME]
[owner USERNAME]
[limit VALUE]
[querytrigger]
[where]
[select]
[dump "SEPARATOR_STR"]
[recordseparator "SEPARATOR_STR"]
[tcl]
[output FILENAME];
For example, to find all business objects in a small database use the following:
temporary query bus * * *;
The owner, vault, and where clauses can be used with or without
businessobject. For example, you could find all business objects owned by user
cslewis, or all business objects of type Part owned by user cslewis:
temporary query owner cslewis;
temporary query bus Part * * owner cslewis;
Use the limit clause to control the number of items returned in the search. The system
will stop searching after it has reached the specified number of items.
Use the tcl clause after the dump clause, if used, and before the output clause to
return the results in Tcl list format. This facilitates the parsing of output from MQL
select commands within Tcl code since the built-in list handling features of Tcl are
used directly on the results. For more information, see Tcl Format Select Output in
Chapter 1.
Include the querytrigger clause when you want a program named ValidateQuery to
be executed. Even with triggers turned off, when querytrigger is included in a query
command, the ValidateQuery program gets run. Refer to Validate Query Trigger in the
Matrix PLM Platform Programming Guide for more information.
temp query select output is the same as print bus or set select, unless the
dump keyword is used. Note the following examples:
Version 10 753
Example 1. Temp query without dump keyword:
MQL<7>temp query bus Note *e* * select owner;
businessobject Note BingTest 1
owner = creator
businessobject Note CapTest 1
owner = creator
businessobject Note attrtest 1
owner = creator
businessobject Note attrtest1 1
owner = creator
businessobject Note attrtest2 1
owner = creator
To define a saved query from within MQL, use the Add Query statement:
add query NAME {ITEM};
NAME is the name of the query you are defining. The query name cannot include asterisks.
ITEM specifies the characteristics to search for.
When assigning a name to the saved query, you cannot have the same name for two
queries. If you use the name again, an error message will result. However, several
different users could use the same name for different queries, since queries are local to the
context of individual users.
For example, several users could each have a query called Current Project. But the
contents of each Current Project query may differ from user to user depending on the
individual needs of each person. As the user adds business objects regarding Current
Project, contents may change also. If you change context from one user to another,
evaluating the Current Project query will most likely produce different results.
{Item} defines what you are searching for. You can include any or all of the following:
businessobject TYPE_PATTERN PATTERN REVISION_PATTERN
[!|not]hidden
owner PATTERN
vault PATTERN
[!|not]expandtype
where QUERY_EXPR
None of these clauses is required. The default is an asterisk (*), indicating that the query
will find all business objects in the database.
Most of these clauses use PATTERN rather than NAME values. This offers greater
flexibility in specifying possible name values. Patterns enable you to use wildcard
characters and to list multiple values when specifying a name.
The most commonly used wildcard character in Matrix queries is the asterisk (*). If only
an asterisk is used for the PATTERN, all definitions for that field will be searched. When
an asterisk is inserted into a name, it acts as a substitute for a group of letters. This group
may contain many letters or none. For example, if you specify a business object name as
Ca*, you might find objects named Catalogue93, CadDrawingA49, CaseLog, Ca668, etc.
Matrix searches for all objects that begin with the letters “Ca” and lists any that are found.
If you enter a value of dr*t, you will find all objects whose names begin with “dr” and
end in “t.”
In this sample query definition below, Matrix will search for all objects that start with the
letters A, B, and C. Each of the other clauses uses only an asterisk for a value. Matrix will
search to include all vaults and all owners. To restrict the search further, you could include
specific values in those clauses.
add query “Name Search”
businessobject * A*,B*,C* *
vault *
owner *;
Version 10 755
The first and last asterisks (*) in the businesobject clause indicate that all types and
revisions should be included.
The following sections explain how each Add Query clause is used to filter out and locate
desired business objects.
Businessobject The Businessobject clause of the Add Query statement searches for business objects with
Clause a particular or similar name.
businessobject TYPE_PATTERN PATTERN REVISION_PATTERN
TYPE_PATTERN is a value that translates into one or more business object types.
PATTERN is a value that represents a business object name.
REVISION_PATTERN is a value that translates into one or more revision designators.
For example, the following is a valid Businessobject clause:
businessobject Customer Tre*,How* *
The first value is an actual object type name: Customer. The second value uses wildcard
characters, multiple values, and character strings. A user might search for a customer
named Howard Trevor. But the user is unsure of the name spelling and does not know if
the customer is stored as Howard or Trevor. By specifying the object name with this
pattern, Matrix searches for all object names that begin with the letters “Tre” or “How.” If
any are found that are of type Customer, they are listed. The final asterisk indicates that all
revisions are allowed.
When listing multiple values as part of a pattern, you cannot have spaces within the
pattern unless the spaces are enclosed within quotation marks. If you accidentally include
spaces, Matrix may read the value as the next part of the object specification. For example,
the following clause would produce false values:
businessobject Customer Tre*, How* *
When Matrix processes this clause, Customer is again used for the object type. However,
rather than searching for names that begin with “Tre” or “How,” Matrix searches only for
objects whose names begin with “Tre”. How* is interpreted as the revision pattern, not
part of the name pattern.
For a complete listing of all defined business objects regardless of their exact
specification, you can simply insert an asterisk into each pattern of the Businessobject
clauses:
businessobject * * *
Since this clause could produce a large number of objects, it is usually desirable to restrict
the query searches in some way. Rather than use an asterisk for each pattern, you may
want to use an asterisk in only one or two of the required patterns.
The goal is to provide enough information to filter out unwanted objects. However, you do
not want to make your search too narrow or you might miss an important object.
Hidden Clause You can specify that the new query is “hidden” so that it does not appear in the chooser in
Matrix. Users who are aware of the hidden query’s existence can enter its name manually
where appropriate. Hidden objects are accessible through MQL.
This statement might find objects created by owners patricia, patty, and thurston.
Vault Clause The Vault clause of the Add Query statement searches for business objects that are in a
particular or similar vault:
vault PATTERN
Vaults defined as remote (for a loosely coupled database) must be explicitly listed in order
to be searched. Using an asterisk in the Vault clause searches only local and Foreign
(Adaplet) vaults.
Expandtype The Expandtype clause of the Add Query statement is used to find all the specified type
Clause hierarchy of types. This is the default.
For example, a type of Frame Assembly may have derived types of Handle and Guard. To
limit the search to objects with a type of Frame only, use !expandtype:
add query “Frame Assembly”
businessobject Frame * *
!expandtype;
Where Clause The Where clause of the Add Query clause is the most powerful and the most
complicated. It searches for selectable business object properties. This involves examining
each object for the presence of the property and checking to see if it meets the search
criteria. If it does, the object is included in the query results; otherwise, it is ignored.
Version 10 757
While the Where clause can test for equality, it can test for many other characteristics as
well. The syntax for the Where clause details the different ways that you can specify the
search criteria, using familiar forms of expression:
where "QUERY_EXPR"
Or
where ‘QUERY_EXPR’
Comparative Expressions
This form of a Boolean expression considers comparisons such as greater than, less than,
and equality. You have two arithmetic expressions and a relational operator:
ARITHM_EXPR RELATIONAL_OP ARITHM_EXPR
ARITHM_EXPR is an arithmetic expression that yields a single value. This value may be
numeric, a character string, a date, or a Boolean. Arithmetic expressions are further
described below.
RELATIONAL_OP is a relational operator. Relational operators and the comparison they
perform are summarized in the table Relational Operators (RELATIONAL_OP).
ARITHM_EXPR can be a selectable field name that yields a numeric value, an arithmetic
operand (value), or another arithmetic expression. While arithmetic expressions include
all data types, arithmetic expressions apply only to Integer or Real value types.
BINARY_ARITHMETIC_OP is one of four arithmetic operators:
• Plus sign (+) for addition
• Minus sign (-) for subtraction
• Asterisk (*) for multiplication
• Slash (/) for division
Arithmetic expressions can be written three ways:
FIELD_NAME Matrix uses the value contained within the named field for each object. This field name and its
notation can be found by using the Print Businessobject Selectable statement (see Select Statements
in Chapter 35.)
VALUE Matrix uses the value that you provide.
ARITH_EXPR Matrix performs one or more arithmetic operations to arrive at a single numeric value.
attribute[Units] eq Inches Compares the values of the Units attribute to see if it is equal to
Inches. If it is, the object is included with the query output.
“attribute[Product Cost]” > Compares the value of the Product Cost attribute with the value of
“attribute[Maximum Cost]” the Maximum Cost attribute. If the Product Cost exceeds the
Maximum Cost, the object will be included in the query output.
(“attribute[Parts In Stock]” - 10) Evaluates the results of each arithmetic expression and checks to
< (“attribute[Parts Needed]” + 5) see if the first result is less than the second. If it is, the object is
included in the query output.
In the last comparative expression, all three forms of an arithmetic expression are used.
This expression compares the results of two arithmetic expressions. One value in each
arithmetic expression is a field name (Parts In Stock or Parts Needed) and one is a value
supplied by you (10 or 5). Before the comparison can take place, each arithmetic
expression must be evaluated and reduced to a single value. Then the two values can be
compared.
Version 10 759
Be sure to include a space on either side of each arithmetic operator (+, -, *, /) to
correctly separate it from the operands.
String Concatenation
When using the plus (+) operator, if the left-hand operand is a string, the system attempts
to obtain a string from the right-hand operand. If successful, the “+” operation returns a
string obtained by concatenating the two strings.
eval expr '("actual=" + attribute[Actual Weight]) + (",
target=" + attribute[Target Weight])' on bus 'Body Panel'
610210 0;
The following returns the average age of all objects in the set M6000-panels (in hours):
evaluate expr 'average ( (MX_CURRENT_TIME - state[Released].actual) / 3600)' on set
M6000-panels;
By default, Matrix is case sensitive, but this may be disabled by System administrators. When case sensitivity is turned
off, the following 4 case sensitive operators behave identically to their string match counterparts.
~= case sensitive match The pattern of the first value must match the pattern of the second value.
match The value can be included anywhere in the string. This includes testing
MATCH for uppercase and lowercase characters. For example, “Red Robbin” is
not a sensitive match for the pattern value “re* ro*” because the
uppercase “R” values will not match the pattern’s lowercase
specification.
!~= case sensitive not match The pattern of the first value must not match the pattern of the second
nmatch value. The value can be included anywhere in the string. For example, if
NMATCH the first value is “Red*” a second value of “red” would produce a true
result because the lowercase “r” is not an exact match to the first value’s
uppercase “R.”
The following operators are used for searches on description or string attribute fields that contain more than 254 bytes
of data. They do not have a symbol to represent them, and can be used only by typing in the where clause dialog. Refer
to Searching based on lengthy string fields for more information.
matchlong case sensitive match for Contains the specified value, in either the lxStringTables or the
long data lxDescriptionTables. The search is case sensitive. To find all objects
with the word “language” in the attribute Comments, and to ensure that
both tables are checked, use attribute[Comments] matchlong
“language” in the Where clause. Since the query is case sensitive,
the query will not find objects with “Language” or “LANGUAGE” in
the Comments field.
nmatchlong case sensitive not match Does not contain the specified value, in either the lxStringTables or the
for long data lxDescriptionTables. The “n” is for not match. The query is case
sensitive. To find all objects that do not contain the word “Language” in
the attribute Comments, use attribute[Comments]
nmatchlong “language” in the Where clause. Since the query is
case sensitive, it will find objects with “Language” or “LANGUAGE”
in the Comments field.
Version 10 761
Operator Operator Name Function
smatchlong string match for long Contains the specified value, in either the lxStringTables or the
data lxDescriptionTables. The search is NOT case sensitive. To find all
objects with the word “Language” in the attribute Comments, and to
ensure that both tables are checked, use attribute[Comments]
smatchlong “language” in the Where clause. Since the query is
not case sensitive, the query will find objects with “language”,
“Language” or “LANGUAGE” in the Comments field.
nsmatchlong not string match for long Does not contain the specified value, in either the lxStringTables or the
data lxDescriptionTables. The search is NOT case sensitive. The “n” is for
not match. To find all objects that do not contain the word “language” in
the attribute Comments, enter “language” for the value. Because the
query is not case sensitive, it would not find objects with the word
written as “LANGUAGE” or “Language” in the Comments attribute, as
well as those that did not contain the word at all.
To find objects where a particular property is non-blank, use a double asterisk. For
example, if you want be sure that all objects in the result of your query contain a
description, use:
where '(description=="**")';
Matchlist Expressions
Expressions can use two keywords, matchlist and smatchlist, which enable you
to specify a list of strings on the right-side of these keywords. These work the same as the
match and smatch keywords except that an additional operand is used as a separator
character for the list of strings. The format is:
matchlist 'STRING_LIST' ['SEPARATOR_CHAR']
smatchlist 'STRING_LIST' ['SEPARATOR_CHAR']
where
STRING_LIST is the list of strings to be compared
SEPARATOR_CHAR defines the character that separates the list of strings. If no separator
character is given, the first right-hand operand is treated exactly as match and smatch
treat it, that is, as one string.
Following are some examples:
temp query bus Errata * * where "current matchlist 'Open,Test'
','";
temp query bus Errata * * where "attribute[Priority] matchlist
'0,1,2' ','";
temp query bus Errata * * where "attribute[Notes] smatchlist
'*Yin*,*Williams*'','";
The last query will find all Errata in which the names “Yin” or “Williams” are included in
the Notes section, and the search will be case-insensitive.
Note that in the above examples, a comma is specified as the separator character in the
second right-hand operand. The first right-hand operand is treated as a list of strings
delimited by this separator character.
If either left or right operand is a select clause, the result of evaluating the operand is a list
of strings. In all other cases, the evaluation of the operand just gives a single string.
match, smatch, matchlist, and smatchlist are evaluated by a pair-wise
comparison of the two lists. If any comparison yields true, then the result is true.
Otherwise, it is false.
Note that when a pair-wise comparison is performed, asterisks and question marks are
treated as wildcard characters only in the string(s) from the right-hand operand. Asterisks
and question marks from the left-hand operand are treated as a literal string, and not as
wildcard characters.
When this clause is processed, Matrix looks for all objects that have this attribute and
includes the value of “Grade Point Average.” If the attribute is not found within the object
definition or if the attribute value returns false when the Where clause is evaluated, the
object is excluded from the query output. To include a selectable object property in a
Where clause, you must use its proper name and notation.
You can obtain this by using the Print Businessobject Selectable statement (see Select
Statements in Chapter 35.) This statement prints a list of all field names that can be used
and indicates how they must be written. Refer also to the selectables listed in the Select
Expressions appendix in the Matrix Navigator Guide.
Version 10 763
A Boolean expression contains one or more comparisons. These comparisons return a
value of TRUE, FALSE or UNKNOWN. For example, UNKNOWN might be returned as
a string by a string attribute. It could also be returned by a Program, since Programs can
be invoked in Expressions and return a string.
Boolean expressions, whose values can be True, False, or Unknown, should not be
confused with Boolean type attributes, whose values can be only True or False.
As with TRUE and FALSE, mixed case (Unknown) and lowercase (unknown) are allowed.
The first form of the Boolean expression assumes you have two Boolean values whose
relationship you want to compare. While there are only three Boolean operators, there are
multiple ways that these operators can be specified. Refer to the table below.
When specifying a Boolean value in this form, follow the same syntax rules as for
specifying a query expression. You can create long lists of Boolean expressions. For
example, you could write Where clauses such as:
where 'type==Student && attribute[”Grade Point Average”]==4.0'
where 'current==“Initial Testing” && attribute[compound]==steel && attribute[weight] <
2.5'
When MQL processes these clauses, it obtains the Boolean values for each field name and
then evaluates the Boolean relationship. If the results of the evaluation are true, the object
is included in the query output. If false, it is excluded.
Boolean “and” can be represented: AND, and, &&.
Boolean “or” can be represented: OR, or,||.
Boolean “unknown” can be represented: UNKNOWN, unknown.
The following table shows the results for Boolean relationships:
The second form of the Boolean expression assumes that you have a single Boolean value.
This value (represented by QUERY_EXP) can be operated upon to yield yet another
Boolean value. The unary Boolean operator is the NOT operator. This operator causes
Matrix to use the opposite value of the current Boolean value. For example, with the
Note that the type can be specified as part of the business object or in a boolean
expression.
If-Then-Else
If-then-else logic is available for Expressions. The syntax is:
if EXPRESSION1 then EXPRESSION2 else EXPRESSION3
Version 10 765
If the EXPRESSION1 term evaluates to UNKNOWN, it is treated as TRUE.
Substring
The substring operator works within an expression to provide the ability to get a part of a
string; the syntax is:
substring FIRST_CHAR LAST_CHAR EXPRESSION
Using Select The purpose of select expressions is to obtain or use information related to a particular
Clauses in Queries business object. In a query, the select expression value is used to qualify the search criteria
(in a Where clause) by comparing it with another (given) value.
Obtainable information includes not only attribute values and other business object data,
but also administrative object information, such as the governing policy, vault, and so on.
The key property of a select expression is that it can access information related to an
object.
In all cases, the expression is processed from the context of a starting object. In a query,
the starting points are business objects that meet other selection criteria (vault, type, and
so on). The phrase starting point is used because the select mechanism in Matrix actually
uses the same concept of navigation from one object to another that makes the rest of the
system so flexible. This is possible because most information in Matrix is actually
Definitions
• A select clause is single-valued if print bus T N R select <clause>
dump outputs exactly one line of text.
• A select clause is multi-valued if print bus T N R select <clause>
dump outputs multiple lines of text.
• A select clause is NULL if print bus T N R select <clause> dump
outputs zero lines of text.
format[ASCII];
format[ASCII].hasfile.
In these cases, the number of outputs is not ambiguous, and a true or false value is always
returned.
To get subfields. For example:
relationship[BOM].to.name;
from[].to.name format[ASCII].file.
Version 10 767
These may represent zero, one or many pieces of data, depending on the number of
relationships, formats, files, etc. that are possessed by the business object, so it is not
possible to guarantee that the number of outputs will equal the number of select clauses.
Therefore, selecting subfields will produce output fields only for data that is actually
present. They do NOT output empty fields to represent the absence of data.
If you enter the single-valued Print Businessobject statement for Assembly A, as follows:
print bus Assembly A '' select format[ ].file dump;
the results indicate two Word documents are included in the object Assembly AW,
separated by a comma:
andersen:d:\test\select.txt,
andersen:d:\test\Monitor FSP.doc:
NULL-valued—If you enter the NULL valued Print Businessobject statement for
Assembly NONE:
print bus Assembly NONE '' select format[ ].file dump;
the TRUE response indicates that there is a document included in the object Assembly A,
without its file details.
If you enter the Print Businessobject statement with the hasfile clause for Assembly W
print bus Assembly W '' select format[ ].hasfile dump;
the TRUE response indicates that there is a document included in the object Assembly W,
without its file details.
If you enter the Print Businessobject statement with the hasfile clause for Assembly
AW
print bus Assembly AW '' select format[ ].hasfile dump;
the NULL response indicates that there are no documents included in the object Assembly
NONE.
NULL clauses
Select clauses that are found to be NULL have special handling for the equal and not
equal logical operators: ==, ~~, ~=, !=, !~~, and !~=.
• A NULL select clause is NEVER equal (==, ~~, ~=) to anything
• A NULL select clause is ALWAYS not equal (!=, !~~, !~=) to everything.
So, for our example, we have:
temp query bus Assembly * '' where 'format[Assembly].hasfile==TRUE';
results in:
Assembly A
Assembly AW
and then:
temp query bus Assembly * '' where 'format[Assembly].hasfile != TRUE';
results in:
Assembly NONE
Assembly W
Version 10 769
If you enter:
temp query bus Assembly * * where ' "format.file" MATCH "*.doc" ';
it results in:
Assembly AW (multi-valued, and 2nd one is a match)
Assembly W
If you enter:
temp query bus Assembly * * where ' "format.file" MATCH "*.txt" ';
it results in:
Assembly A
Assembly AW (multi-valued, and 1st one is a match)
Note that using NMATCH will also pick up the objects with no files. If you enter:
temp query bus Assembly * * where ' "format.file" NMATCH "*.txt" ';
it results in:
Assembly AW (multi-valued, and NMATCH is TRUE
for the 2nd one)
Assembly W (singlevalued, and NMATCH is TRUE)
Assembly DELETED (NULL, so NMATCH is always TRUE)
Assembly NONE (NULL, so NMATCH is always TRUE)
With toset and fromset selectables, the values “True” and “False” are case
sensitive and always appear in title case (initial capital letter followed by lower case
letters). In queries with these selectables, you must type “True” or “False” using this
case to get a valid result.
What distinguishes this query from the single-statement query is that the toset condition
can be included with the other conditions when objects are gathered so that Matrix sees
only objects that satisfy all the conditions of the query. As long as the first query does not
put too many objects into set t1, this query should have much better performance.
The fromset and toset selectables can be followed by additional selectables, similar
to the way that the selectables from and to work. In such cases, the selectable that
follows is evaluated against each relationship that satisfies the condition indicated by the
fromset or toset selectable. For example,
fromset[t1,assembly,component].name returns a list of the names of the
relationships of type assembly or component from a given object to an object in set
t1.
Additionally, these selectables can be used to express conditions that cannot be expressed
in a single query. Using the example above, the following conditions:
(to[Component Substitution].from.name ~~ '*Clutch*')
and
(to[Component Substitution].from.name ~~ '*Transmission*')
each express that a given object be the to-object in a relationship of type Component
Substitution where the object at the other end satisfies a given condition. These two
conditions can be true even if no one object at the other end satisfies both conditions. But
it may be intended that the two conditions be satisfied by the same object. This query does
not express that, and no single query can. However, toset[] can be used to express this
condition by making sure that the set in question contains only objects that satisfy both
conditions. This goal is accomplished by replacing the statement that created the set by
this statement:
temp query bus * "*Clutch*" * where "name match
'*Transmission*'" into set t1;
Version 10 771
Sets in Matrix are workspace objects and are shared by anyone using the same login
name. If two people (or applications) are logged in with the same user name, they may
overwrite each other's sets if the same names (t1, t2, etc.) are used. To avoid this,
developers should wrap the creation of the set and the final query inside a transaction
boundary. This will keep the set from becoming visible to other sessions until it is no
longer needed.
kindof may not be suitable for use in all schemas. It is designed for use in large and
deep type hierarchies, where specifying TYPE in a query is inefficient.
Expressions on Certain kinds of Expressions are applicable to collections of business objects (as can be
Queries obtained from Sets and Queries), returning a single answer for the entire collection. These
Expressions are formed by using one of several keywords. They are:
count
sum
maximum
minimum
average
median
correlation (cor)
All but the last of these keywords is expected to be followed by one expression, its
argument, that applies to business objects. The last one, correlation, needs to be followed
by two such expressions. Alternative spellings are indicated in parentheses. For each
keyword, you can use all lowercase, all uppercase, or first character uppercase followed
by all lowercase.
Count
The count keyword takes as its argument a where-clause expression that evaluates to
TRUE or FALSE. It returns an integer that is the number of items in the collection that
satisfy the argument. A simple example of such an expression is “count TRUE”, which
evaluates to the number of objects in a collection of business objects.
For example, the following statement returns 37, indicating the number of objects of Type
‘Body Panel’ in the database:
eval expr 'count TRUE' on temp query bus 'Body Panel' * *;
The following statement returns the number of objects in the set “NewBooks” whose cost
is between 10 and 50:
eval expr 'count ( attribute[cost]>=10 AND attribute[cost]<=50 )' on set NewBooks;
To do the same, but exclude children’s books, you might use the following statement:
eval expr 'count ( attribute[cost]>=10 AND attribute[cost]<=50 LESS attribute[Reading
Level]==Child )' on set NewBooks;
Sum
Sum returns a real number that represents a total of all the values of the specified attribute
for all business objects in the collection. For example, the following statement returns the
Version 10 773
total of the values of the “Amount Due Employee” attribute for all business objects in the
saved query “Expense Reports”:
eval expr 'sum attribute[Amount Due Employee]' on query Expense Reports;
The following statement returns the ratio of total price to total cost for all objects in the set
“Components”:
eval expression '( sum attribute[price] ) / ( sum attribute[cost] )' on set
Components;
Minimum returns a real number that represents the single smallest value for the specified
attribute for all business objects in the collection.
eval expr 'minimum attribute[diameter]' on set “o-rings”;
Average returns a real number that represents the average of all values for the specified
attribute for all business objects in the collection.
eval expr 'average attribute[diameter]' on set “o-rings”;
Median
Median returns a real number that represents the middle number of all values for the
specified attribute for all business objects in the collection.
For example, the following shows the values, listed in numerical order, for the attribute
Actual Weight for seven business objects that comprise the set FprSet:
7 15 19 25 26 31 35
Since the middle number of seven numbers is the fourth number, the median in this case is
25. That is the value returned for the following statement:
eval expr 'median attribute[Actual Weight]' on set FprSet;
Standard Deviation
Standard deviation, generally used in statistical analysis, tells how closely data
conforms to the mean in a set of data. In Matrix, it can be used to compare the values of
business object attributes. The returned value is a real number.
For example, if you know the average age of all employees, you might want to know how
many people are close to that age. The standard deviation will tell you, on average, how
much the ages of the group differ from the mean. If the standard deviation is a small
Correlation
Correlation, generally used in statistical analysis, is a direct measure of the
relationship between variables. It can be used in Matrix to determine the relationship
between attributes of an object or group of objects. The returned value (the correlation
coefficient) is a real number between -1 and +1.
• If the returned value is between 0 and +1 (positive correlation), it indicates that an
increase in the value of one attribute results in an increase in the value of the other (or
vice-versa).
• If the returned value is between 0 and -1 (negative correlation), it indicates that an
increase in the value of one attribute results in a decrease in the value of the other (or
vice-versa).
• A returned value of 0 represents no relationship.
For example, the following expression can be used to check how well cost correlates with
price for all objects of Type “tire frame”.
eval expr 'cor attribute[Cost] attribute[Price]' on temp query bus 'tire frame' * *;
Version 10 775
Using the Escape Character
The backslash (\) character can be used in MQL commands or expressions to escape any
other character in a variety of contexts. In particular, MQL users can create attribute
values that contain both single and double quotes, and search for objects with an attribute
value of this sort.
When escaping is enabled, the character that follows a backslash loses any special
meaning it might have in the particular context.
You can specify that a backslash (\) should be treated as an escape character for any other
character when used in:
• MQL commands
• expressions, such as used in the following:
• where clauses (including queries, expand businessobject command, cues, tips,
and filters)
• object tip definitions
• table column definitions
• evaluate expression command
• expression access
• output of a range program
• program arguments, such as appear in these contexts:
• execute program command
• execute businessobject command
• triggers
• various places in wizard definitions
• combo and list boxes in wizards
This can be specified globally or on a case-by-case basis (except for wizard components).
To Enable To enable the use of the backslash as an escape character globally, Business
Escaping Administrators can use the following MQL command:
set escape on;
print escape;
• When escape is set to on, a backslash will always act as an escape character.
• Use print escape to check whether it is enabled or not.
• Use set escape off to disable it.
If you want to avoid enabling the escape character globally, you can enable it on an as
needed basis, prefixing each relevant string to be parsed with the keyword escape plus a
space. When processed on the command line, these extra characters are first stripped off
and the remainder will be processed in the usual way.
When more than one expression is specified in a command or definition, (for example, in
tip definitions and expand bus where commands) you can escape one and not the
other by including the escape clause in only the expression that needs it.
How It Works When an MQL command is processed by the system, the system first breaks the command
into parts that are called tokens. When escape processing is on for the command (whether
by the global or ad-hoc setting), it affects the breakdown of the command into tokens. An
expression embedded in a command is treated as one token, from the point of view of the
command parser. Prefixing a command with the word “escape” affects only the processing
of the command into tokens. For example the following would not work as required:
temp query bus * * * where "attribute[height]=="5'"";
Without using the escape mechanism and backslashes, this where clause would be
processed as:
attribute[height]==
The text after the equal sign would be ignored, since the second quotation mark (before
the 5) seems to indicate the end of the where clause (where clauses must be enclosed in
single or double quotes). To correctly search for objects that have a height of five feet, you
would use:
escape temp query bus * * * where "attribute[height]==\"5'\"";
With the backslashes and escape processing turned on, the where clause of this command
is correctly processed as:
attribute[height]=="5'"
In some cases, however, escape processing is needed for both parsing the command into
tokens and also for parsing the where clause for evaluation. The where clause parsing is
done after the command is parsed as a second pass. The rules for this parsing are
somewhat different, as expressions have their own syntax and special keywords. For
example, to find all objects that have a height of 5’6” is tricky, since the value itself
contains both single and double quotes and must also be surrounded by quotes. In this case
you would need to escape process the where clause (and include the escape character) in
order to make it work as a where clause, as follows:
escape attribute[height]=='5\'6"'
To perform the query, you would then need to use escape processing at the command level
as well as at the expression level. You could use the following:
escape temp query bus * * * where "escape
attribute[height]=='5\\'6\"'";
Notice that you must escape the backslash so that one would be in place after the initial
escape processing of the command, for the second pass that escape processes the where
clause. A triple backslash is required if the character used to enclose the expression is
included in the expression itself, such as:
Version 10 777
escape temp query bus * * * where 'escape
attribute[height]==\'5\\\'6"\'';
In summary, escapes are needed when you want to place a value within a string that will
be parsed; in order to have the string parsed as one token, you need to place quotes around
it. Without escape processing, this only works if the string does not itself contain the quote
character. With escape processing, you can use such quotes as a delimiter safely if you
modify the string by following these simple rules in this order:
1. Escape each escape character in the string.
2. Escape each quote character (of the same type — single or double) in the string.
Expressions and program arguments that start with “escape” will be treated similarly, as
will the output of a range program.
Using Escaping When using Tcl you can enable escaping (either globally or within the command) to put
With Tcl any kind of string into the database or pass such a string as an argument to an MQL
program regardless of which characters it contains and without the need for the user to
worry about backslashes at all—except for those necessitated in order to set Tcl variables.
In general, by using Tcl you can avoid the need to add quotes around tokens for the
purpose of making the MQL command processor treat them correctly. That then removes
the need to use an escape character with such quotes. When an MQL command is
executed in Tcl, it is Tcl that initially breaks the command into tokens. When Matrix
receives these tokens from Tcl, it attempts, as best as possible, to put them together into a
command string so that the MQL command processor will treat each of the tokens
received from Tcl as a single token. So if the token contains a space or a quote character or
any of a number of other characters, internally Matrix will put quotes around it and then
put it together with the other tokens to create an MQL command string that is parsed as
any normal MQL command is parsed. When escape processing is on, Matrix will also
escape the contents of the string properly so that it will be interpreted as one token by the
MQL command processor.
So, in Tcl programs, if you put values into a variable and then use the variable to set
attribute values, you should enable escape (either globally or within the command), and
Matrix will add the necessary backslashes to the processed commands. For example:
tcl;
set myvar { my string with many weird characters such as ';#" -
but no squiggly brace }
mql escape modify businessobject type name rev MyAttr $myvar
If you needed to use a squiggly brace inside the squiggly braces of the set command, you
would have to backslash it — to satisfy Tcl’s demands, but not MQL’s.
Exceptions One exception to escape processing is that it cannot be used for characters that are part of
a keyword in an expression. Keywords are such things as match, attribute, ge, ==,
and AND. They have a special meaning within expressions and backslashing their
characters is neither necessary nor will it work properly.
Use of special characters in administrative object names must be avoided. Even escaping
special characters in this case does not work as shown in the example below (the name of
the attribute is “My]Attr”):
escape print bus MyType MyName MyRev select attribute[My\]Attr];
Version 10 779
Query Strategies
The problem with queries is simple: poorly structured queries cause memory and
performance problems. For example, the result of a query may be so large that the
computer system depletes resources in order to handle the result. Other queries may
consume more processing time than they should.
This section contains practices and guidelines for improving query execution and
performance.
Where Clause This section contains tips on how to include where clauses within a query.
Guidelines
Using Select Fields in Indexed Queries
Type, name, and revision fields in a query are used to limit the number of objects returned
to the client. The additional criteria in the where clause are used to filter the objects
displayed. Criteria that limits the number of objects to be filtered are said to be “indexed.”
The key consideration for optimizing query performance is to use as many indexed fields
as possible.
The following selectables, when present in a query where clause, are treated as indexed
fields by the query optimizer.
You can use indexed fields with any relational operator (==, !~=, <> etc.) applied to a
constant value that may include wildcards. For example,
name ~= 'A*B'
Non-Indexed Clauses
Any selectables not on the above list are non-indexed when used in a where clause. For
example, the following are not indexed:
description
revision
grantor (and grantee, granteesignature)
state[]
revisions[]
previous (and next, first, last)
type.kindof
Note that revision is not indexed when included in the where clause, but is indexed when
included in the business object specification part of the query.
Non-indexed selectables cannot be built into the SQL commands that get objects and
connections from the database server, so these clauses are not used to limit the number of
objects that are retrieved from the server. Qualifying these clauses is very sensitive to the
number of objects retrieved, since for each such object, additional SQL calls have to be
constructed to retrieve the values of these fields, and data has to be stored in the clients
memory. Given these realities:
ALWAYS make sure that a query containing non-indexed fields also has some indexed
fields to limit the number of objects retrieved.
Here are a few examples of common queries that are bound to be slow. Note that in all of
them, the type (PART) is specified, but a production database can have huge numbers of
PARTs, so the type specification is not very limiting:
PART * * where 'description ~~ “*a word*”'
PART * * where 'state[StateName].satisfied == TRUE'
PART * * where 'revision == last'
In the above queries, it would be best to include an attribute that substantially limits the
number of PARTs that the system would have to examine.
The number of objects retrieved by the indexed fields is the biggest factor in query
performance and client memory requirements. The length (in characters) of the where
clause or number of expressions within the where clause are immaterial. Actually, a
longer where clause is desirable if much of it is comprised of indexed fields that limit the
number of objects retrieved:
Version 10 781
PART * * where ' (description ~~ “*a word*”) AND
(attribute[Keyword] ~~ “abc*”) AND (attribute[Keyword] ~~
“123*”) '
Using .value
If a query has a clause that is known not to be a good search candidate, .value will make
that clause the last thing evaluated in the query. For example, consider the two following
queries and the SQL they generate.
The following examples are not valid queries per se, but examples to show how .value is
used.
Query 1:
rev = "*", type = "A", name = "*", and attribute[A] = 'this'
SQL generated:
(type=="A") && (revision == "*") && (name == "*") &&
(attribute[A] == 'this')
Query 2:
rev = "*", type = "A", name = "*", and attribute[A].value =
'this'
SQL generated:
(type=="A") && (revision == "*") && (name == "*") ) &&
(attribute[A] == 'this')
The difference is the processing order of the query. In query 1, all the clauses are
evaluated in order. In query 2, the type, name, and revision clauses are evaluated first, then
the result is evaluated with the attribute[A].value clause. It is important to note that .value
takes an attribute that Matrix considers indexed and makes it non-indexed. Generally it is
done because the final part of the query does not help the search become more efficient
due to a schema problem. The work in this case is not done by the database, but by Matrix.
Query Syntax
You must include a space before and after the operator in all where expressions. In
complicated expressions, particularly those that use "!" or "not", use parentheses to clearly
state your intent. For example, in the following, the "!" is applied to the entire clause:
!relationship[Categorize] || relationship[Categorize].from.id
== 43482.46832.5291.38424
To apply the "!" to only the portion before the OR, change it to:
(!relationship[Categorize]) || relationship[Categorize].from.id
== 4448.10921.4769.5768
To find objects where a particular property is blank, use a double quote (no space). For
example, if you want find objects that do not contain a description, use (description ~~
“”). For Boolean attributes, searching on “” results in finding objects where the value for
the attribute is False, even if the default is True. (Boolean attributes, are either True or
False, as opposed to Boolean expressions, which may be True, False or Unknown.)
To find objects where a particular property is non-blank, use a double asterisk. For
example, if you want be sure that all objects in the result of your query contain a
description, use (description ~~ “**”).
Version 10 783
In complicated expressions, particularly those that use ! or not, use parentheses to
clearly state your intent. For example, in the following, the ! is applied to the entire
clause:
!relationship[Categorize] ||
relationship[Categorize].from.id=="43482.46832.5291.38424
To apply the ! to only the portion before the OR (||), change it to:
(!relationship[Categorize]) ||
relationship[Categorize].from.id==4448.10921.47699.5768
The syntax of a query statement affects the execution of the query. Matrix occasionally
has core changes that handle commands slightly differently, or maybe add a few new
options to a command, for additional functionality. For example, the change from Matrix
9521 to version 9601 resulted in the handling of the "relationship" keyword differently
within a "where" clause. (The "relationship" keyword can still be used in a "select" clause
without adversely affecting performance.) This caused queries that ran fast under the older
version to run much more slowly. The following query is an example:
temp query bus myType * * where
'(relationship[myRelationship].attribute[myAttribute] ...)';
In the newer version of Matrix, the solution is to get rid of the "relationship" keyword and
instead create separate clauses with "from" and"to" in them, as shown here:
temp query bus myType * * where
'(from[myRelationship].attribute[myAttribute] ...)
or
(to[myRelationship].attribute[myAttribute] ...)';
Query Parsing
The order of the query created becomes important when trying to structure a query for
performance. For example, consider a query:
where "A && (B || C)"
As the Matrix kernel parses the query, the expression passed to the database becomes:
(A && B) || (A && C)
The kernel uses ORs at the top level to separate the query into parts, then to accumulate
the results. Generally, the processing of a query is done left to right. Knowing this, a user
can structure queries so that the indexed attributes are used first. Front loading the query in
this manner restricts the sets of objects searched with non-indexed attributes.
Searching on Date/Time
In order to include Date/Time in your query, you must use the format defined for your
system initialization file. Matrix provides six different formats for the display and entry of
dates and times. Each can be modified by adding lines to the .ini file or the startup scripts.
See Configuring Date and Time Formats in the Matrix Installation Guide for details.
If your Date/Time query does not conform to the expected format, you will receive an
error message similar to the following:
Invalid date/time format ‘July 22. ‘02’.
Allowed formats are:
[day] mon dom, yr4 h12:min[:sec] [mer] [tz]
[day] mon dom, yr4
moy/dom[/yr2] h12:min[:sec] [mer]
moy/dom[/yr2]
When entering a date as a value in the Where clause box, Matrix assumes the time is 12:00
AM unless a specific time is specified as part of the query.
The following table explains the tokens used in Date formats:
Token Meaning
sec seconds, 0 - 59
min minutes, 0 - 59
Version 10 785
Using const for reserved words
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’.
temp query bus * * *
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 a list of keywords and their meanings, see the
Select Expressions appendix in the Matrix Navigator Guide.)
For this type of situation, use const to indicate that whatever follows should not be
evaluated. For example:
temp query bus * * *
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 Matrix 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*’
Modeling A big key to query performance is the data model that is used. It is much more efficient to
Considerations build queries that use attributes rather than to build non-indexed queries. Careful and
intelligent use of attributes and triggers can limit the queries created. Certain queries,
while looking simple and returning a very small subset, may actually cause extreme
performance problems.
Below is a typical query, targeting objects of type Manufacturer, Facility, Group, and
Project:
temp query bus Manufacturer,Facility,Group,Project * * where
'from[Group Assignment].to.type == Person' select id dump ¿;
This query resulted in a small set of 12 objects, but it caused the generation of nearly four
hundred select statements and excessive memory growth. A better solution would be to
create an attribute that would make the query true or false. To create an indexed query,
first add an attribute (for example, "Assigned to Person") to each of the four target types.
For the purposes of this example, the values of this attribute are "YES" and "NO". When
a business object of these particular types is created, set the value of attribute "Assigned to
Person" to "NO". Next, create triggers to modify the "Assigned to Person" attribute, either
setting the value or unsetting it. As users update objects of the desired type(s), the
assignedToPerson trigger checks the relationships of the object. The work the trigger will
do can be summarized as "if the object meets the criteria specified in the original
non-indexed query, then modify the 'Assigned to Person' attribute to show that it does
meet the criteria." The trigger will check to see whether the business object has a
relationship to a person from its group assignment. If it does, set the "Assigned to Person"
attribute to indicate "YES". If the user removes that relationship, set the attribute value to
"NO".
The new query would look something like this:
temp query bus Manufacturer,Facility,Group,Project * * where
'attribute[Assigned to Person] == YES' select id dump ¿;
It is also important to include some consideration of query performance when designing
your data model—in particular, when defining a new type.
For example, here are three modeling alternatives that minimize the need for queries on
descriptions. All three can easily be maintained using the ModifyDescription trigger on
the type:
• Add an attribute Synopsis, which holds the first 100 characters of the description
field.
• Add an attribute Keywords, and require values to be specified at create time.
• Write the description to a text file, check it into the object, and replace uses of
'description ==' by 'search[] =='.
Version 10 787
In addition to the data model, knowing the application is another key. Really
understanding how the application works enables users to create better queries. The end
user knows what search parameters return lots of objects and which ones return a limited
object collection.
Keep in mind that the Matrix core is best suited to expand/navigate operations. Queries are
not the most efficient way to access the object-oriented data that the application manages.
The best way to improve the performance of queries is to eliminate queries. A data model
focused on the expand/navigation of relationships helps tremendously. However, one
caveat concerning the use of type hierarchies and the use of "!expandtype": Performance
problems may occur when using 1000s of subtypes and then querying against the name of
a base class. Traversing giant type trees can also cause problems. Refer to kindof
selectable for types for a possible solution if large and deep type hierarchies are
unavoidable.
Avoiding Unbounded queries can pose problems, especially with large databases. For example, a
Unbounded statement similar to "temp query bus * * *" will search every single item in the database.
Queries If the database is small, this is not an issue. As the database size increases, this becomes a
tremendous performance problem. To avoid this problem you can restrict the query by
vault or type, impose a find limit on the query, or create a query trigger.
Querying Vaults
Restricting the query to objects within the same vault is an obvious way to restrict a query.
Limiting the search to objects that are all known to be stored a certain way cuts down on
processing because all SQL statements related to the query have to be duplicated for each
vault involved in the search.
Avoiding Large Similar to a large query, a large expand also causes performance problems. For example,
Expands the statement "expand bus T N R recurse all;" attempts to expand all items connected to
the specified object, expand all of those objects, and on, and on. Once again, a small
database can hide the potential problem with this query because its results do not manifest
themselves until the database size gets very large. A suggested solution is to limit the
number of levels to expand (do not use recurse all, use recurse to 2).
Object Existence Generally, you should not use temp queries to check for the existence of objects.
Rather than using “mql temp query T N R”, it is better to use “mql print bus T N R select
exists”, which will return true if the object exists, false otherwise.
Query In instantiating queries, do not use a null string, use an empty string. Declaring a query as
Instantiation “Query q = new Query()” is not as good as “Query q = new Query q("")”. The empty
string query constructor could cause stability problems if the same users modify the same
query at the same time. Also, in this case the temp query opens the query .finder, updates
it with the new type, name, revision and vault information and then runs the query. If
.finder happens to have a where clause specified, it is not cleared. As a result, the query
might not return the MQL equivalent of "temp query bus type name rev vault". Using the
Nested Queries An additional problem with queries and/or transactions results from nesting them inside
one another. For example, the first set shows a transaction nested within another; the
second set shows two separate transactions.
Invalid sequence:
Start trans1
Start trans2
Commit trans2
Commit trans1
Valid sequence:
Start trans1
Commit trans1
Start trans2
Commit trans2
Matrix does not allow nested transacations. However, savepoints can be used to divide
large transactions into smaller parts. If the start() method of the context class is called a
second time before the commit or abort methods are called for the first transaction, the
system throws a MatrixException. Use the isTransactionActive() method to determine if a
transaction is still alive before starting a transaction. If the result is false, it is safe to begin
a transaction; if true, the current transaction must be aborted or committed before starting
a new one. In addition, all exceptions within a transaction must be handled, else the
transaction could get stranded. If the transaction is stranded, it cannot be recovered. Using
a transaction timeout (to abort/commit the transaction once the threshold has been
exceeded) can help to solve the problem of stranded transactions.
Other topics in this chapter and the “Finding Objects” chapter in the Navigator Guide
explain more about queries and different strategies for query construction. The strategy
most recommended is to always use as many indexed fields as possible when forming
queries. The goal is to limit the number of business objects on which non-indexed
searches will be applied.
Version 10 789
Modifying a Query Definition
You change the search criteria for an existing query by using the Modify Query statement:
modify query NAME {ITEM};
These clauses are the same clauses that are used to define the initial query. When making
modifications, you simply substitute new values for the old.
Although the Modify Query statement allows you to use any combination of search
criteria, no other modifications can be made. To change the query name or remove the
query entirely, you must use the Delete Query statement (see Deleting a Query) and/or
create a new query.
For example, assume you have a query named “Product Comparison” with the following
definition:
query “Product Comparison”
businessobject *
revision *
type Perfume
vault “Perfume Formulas”
owner channel, taylor;
To this query, you want to add another owner for the search criteria. To make the change,
you would write a Modify Query statement similar to the following:
modify query “Product Comparison”
owner channel, taylor, cody;
Once a query is defined, you need to evaluate it, using the Evaluate Query statement, to
find the information.
evaluate query NAME;
When a query is evaluated, all business objects that meet the search criteria are displayed
in the window or listed on your screen. If you want to save this collection of objects, you
can assign a set name to it and reference the set name when you want to view the
collection. (Refer also to Set Defined in Chapter 38.)
Saving query results as a set can be useful when you have a changing environment. Even
when you use the same query, it is possible that you would get different results if the
objects are undergoing change. Therefore, to save query results for a later time, you
should place them in a set.
Use the Evaluate Query statement to process the query and optionally save the results of a
query in a set. This statement contains the following optional clauses:
into set SET_NAME
onto set SET_NAME
over set SET_NAME into|onto
querytrigger
Version 10 791
Drawing 726602 A
Drawing 726601 A
Drawing 726600 A
Drawing 726596 B
Drawing 726595 A
Drawing 726594 A
Drawing 726593 A
Drawing 726592 A
Drawing 726591 C
Drawing 726590 B
Drawing 50234 F
Drawing 50225 D
Drawing 50461 B
Drawing 50023 F
Drawing 50403 B
eval query sarah into set sarah;
print set sarah;
set sarah
member businessobject Drawing test A
member businessobject Drawing ttest A
member businessobject Drawing 726602 A
member businessobject Drawing 726601 A
member businessobject Drawing 726600 A
member businessobject Drawing 726596 B
member businessobject Drawing 726595 A
member businessobject Drawing 726594 A
member businessobject Drawing 726593 A
member businessobject Drawing 726592 A
member businessobject Drawing 726591 C
member businessobject Drawing 726590 B
member businessobject Drawing 50234 F
member businessobject Drawing 50225 D
member businessobject Drawing 50461 B
member businessobject Drawing 50023 F
member businessobject Drawing 50403 B
If a query is no longer needed, you can delete it using the Delete Query statement:
delete query NAME;
After this statement is processed, the query is deleted and you receive the MQL prompt for
the next statement.
When a query is deleted, there is no effect on the business objects or on queries performed
by other Matrix users. Queries are local only to the user’s context and are not visible to
other Matrix users.
Version 10 793
794 MQL Guide
40
Working With Filters
Filter Defined................................................................................................. 796
Creating Filters ............................................................................................. 797
Active Clause.................................................................................................. 797
Applies to Clause............................................................................................ 797
Direction Clause ............................................................................................. 797
Type Clause.................................................................................................... 798
Name Clause .................................................................................................. 798
Revision Clause.............................................................................................. 798
Vault Clause ................................................................................................... 799
Owner Clause ................................................................................................. 799
Where Clause ................................................................................................. 799
Hidden Clause ................................................................................................ 800
Property Clause .............................................................................................. 800
Copying and/or Modifying a Filter............................................................... 801
Copying (Cloning) a Filter Definition ............................................................... 801
Modifying a Filter ............................................................................................ 801
Deleting a Filter............................................................................................. 803
Version 10 795
Filter Defined
Filters limit the objects or relationships displayed in Matrix browsers to those that meet
certain conditions previously set by you or your Matrix Business Administrator. For
example, you could create a filter that would display only objects in a certain state (such as
Active), and only the relationships connected toward each object (not to and from). When
this filter is turned on, only the objects you needed to perform a specific task would
display.
From Matrix Navigator browsers, filters that limit the number of objects that display can
be very useful. Each user can create her/his own filters from Matrix Navigator (or MQL).
However, if your organization wants all users to use a basic set of similar filters
consistently, it may be easier to create them in MQL, then copy the code to each user’s
personal settings (by setting context).
Filters can be defined and managed from within MQL or from the Visuals Manager in
Matrix Navigator. Once the filters are defined, individual users can turn them on and off
from the Matrix browsers as they are needed.
In the Matrix Navigator browsers, filters display on the Filters tab page within the Visuals
Manager window, in the Filter bar and in the View menu.
It is important to note that filters are Personal Settings that are available and activated
only when context is set to the person who defined them.
To define a new filter from within MQL, use the Add Filter statement:
add filter NAME [ADD_ITEM {ADD_ITEM}];
appliesto businessobject|relationship
from|to|both
type TYPE_PATTERN
name PATTERN
revision REVISION_PATTERN
vault PATTERN
owner PATTERN
where QUERY_EXPR
[!|not]hidden
Each clause and the arguments they use are discussed in the sections that follow.
Active Clause The Active clause is used to indicate that the filter is active or not active (!active). The
default is active.
Applies to Clause The Applies to clause indicates that the filter applies to business objects or relationships.
Direction Clause The Direction clause indicates the direction of the relationships to which the filter applies:
to, from, or both.
Version 10 797
Type Clause The Type clause of the Add filter statement assigns a filter for a particular type of business
object or relationship.
type TYPE_PATTERN
TYPE_PATTERN defines the types for which you are assigning a filter.
The Type clause can include more than one type by using multiple values to define the
pattern. The Type clause can also use wildcard characters. For example, the following
definition displays a filter to display all customers and other users:
add filter “Customers and Other Users” type customer,user;
When listing multiple values as part of a pattern, separate each value with a comma and no
spaces, or enclose any multi-word type value within quotation marks (e.g., "new
customer",user). If you include spaces, Matrix reads the value as the next part of the
filter definition. For example, the following Type clause would produce an error because
MQL reads the type as “new” and the next specification for the filter as “customer”.
type new customer;
Name Clause The Name clause of the Add filter statement assigns the names of objects to include in the
filter.
name PATTERN
When listing multiple values as part of a pattern, separate each value with a comma and no
spaces, or enclose any multi-word type value within quotation marks (for example,
“International Business Machines”). If you include spaces, Matrix reads the
value as the next part of the filter definition, as described in the Type clause.
Revision Clause The Revision clause of the Add filter statement assigns a filter for a particular revision of
business objects.
revision REVISION_PATTERN
REVISION_PATTERN defines the revision for which you are assigning a filter.
The Revision clause can include more than one revision value and wildcards as in the
other clauses that use patterns. Typically, you might use a wildcard, but would not include
more than one or two revisions. Filtering by the latest revision number or all revisions A
and B can remove much of the out-dated business objects from view. This allows you to
work with only the most current objects.
When listing multiple values as part of a pattern, separate each value with a comma and no
spaces, or enclose any multi-word type value within quotation marks (for example.
“status new”,”status old”). If you include spaces, Matrix reads the value as the
next part of the filter definition.
Vault Clause The Vault clause of the Add Filter statement assigns a filter for business objects that are in
a particular or similar vault:
vault PATTERN
PATTERN defines the vault(s) for which you are assigning a filter.
The Vault clause can use wildcard characters. For example, the following definition
displays a filter for all business objects that reside in the “Vehicle Project” vault:
add filter “Vault Search”
appliesto businessobject
vault “Vehicle Project”
owner *;
Owner Clause The Owner clause of the Add Filter statement assigns a filter for business objects that
were created by a particular owner:
owner PATTERN
NAME_PATTERN defines the owner(s) for which you are creating a filter.
The Owner clause can use wildcard characters. You can also use multiple values to define
the pattern. You can specify both the first and last name of an owner. For example, the
following Owner clause specifies all objects whose owner names begin with pat or thur:
add filter “Object Owner” owner pat*,thur*;
This statement might provide a filter for objects created by owners patricia, patty, and
thurston.
Where Clause The Where clause of the Add Filter statement is the most powerful and the most
complicated. It searches for selectable business object properties. This involves examining
each object for the presence of the property and checking to see if it meets the search
criteria. If it does, the object is displayed with the filters applied; otherwise, it is ignored.
Version 10 799
While the Where clause can test for equality, it can test for many other characteristics as
well. The syntax for the Where clause details the different ways that you can apply the
filter, using familiar forms of expression:
where “QUERY_EXPR”
Or
where ‘QUERY_EXPR’
Hidden Clause You can mark the new filter as “hidden” so that it does not appear in the chooser in
Matrix. Users who are aware of the hidden filter’s existence can enter the name manually
where appropriate. Hidden objects are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the filter. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add filter NAME property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
You can modify any filter that you own, and copy any filter to your own workspace that
exists in any user definition to which you belong. As an alternative to copying definitions,
you can use the set workspace statement to make your workspace look like that of
another user. Business Administrators can change their workspace to that of another user
to work with filters that they do not own. See Setting the Workspace in Chapter 45 for
details.
Copying (Cloning) After a filter is defined, you can clone the definition with the Copy Filter statement.
a Filter Definition Cloning a filter definition requires Business Administrator privileges, except that you can
copy a filter definition to your own context from a group, role or association in which you
are defined.
This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy filter SRC_NAME DST_NAME [fromuser USER] [touser USER] [overwrite] [MOD_ITEM
{MOD_ITEM}];
The order of the fromuser, touser and overwrite clauses is irrelevant, but
MOD_ITEMS, if included, must come last.
MOD_ITEMs are modifications that you can make to the new definition. Refer to the table
below for a complete list of possible modifications.
Modifying a Filter The List statement is used to display a list of all filters that are currently defined. It is
useful in confirming the existence or exact name of a filter, since Matrix is case-sensitive.
list filter [user USER_NAME];
USER_NAME can be the name of any person, group, role, or association. If the user
modifier is used, the system displays the requested information relating to workspace
objects of the person, group, role, or association indicated.
Users can list their own workspace objects or those of any group, role, or association to
which they belong. Business Administrators can list the workspace objects of any users.
Use the list of all the existing filters along with the Print statement to determine the
search criteria you want to change. Use the Modify Filter statement to add or remove
defining clauses and change the value of clause arguments:
modify filter NAME [ITEM {ITEM}];
Version 10 801
ITEM is the type of modification you want to make. With the Modify filter statement, you
can use these modification clauses to change a filter:
These clauses are essentially the same ones that are used to define an initial filter except
that Add property and Remove property clauses are substituted for the Property clause.
When making modifications, you simply substitute new values for the old.
Although the Modify filter statement allows you to use any combination of criteria, no
other modifications can be made except the ones listed. To change the filter name or
remove the filter entirely, you must use the Delete filter statement and/or create a new
filter.
If a filter is no longer needed, you can delete it using the Delete filter statement:
delete filter NAME;
After this statement is processed, the filter is deleted and you receive the MQL prompt for
the next statement.
When a filter is deleted, there is no effect on the business objects or on queries performed
by Matrix. Filters are local only to the user’s context and are not visible to other Matrix
users.
Version 10 803
804 MQL Guide
41
Working With Cues
Cues Defined................................................................................................. 806
Creating a Cue .............................................................................................. 807
Adding a Cue .................................................................................................. 807
Active Clause.................................................................................................. 808
Appliesto Clause............................................................................................. 808
Type Clause.................................................................................................... 808
Name Clause .................................................................................................. 808
Revision Clause.............................................................................................. 808
Color, Font, Highlight, and Linestyle Clauses................................................. 809
Vault Clause ................................................................................................... 809
Order Clause .................................................................................................. 809
Owner Clause ................................................................................................. 810
Where Clause ................................................................................................. 810
Hidden Clause ................................................................................................ 810
Property Clause .............................................................................................. 810
Copying or Modifying a Cue ........................................................................ 811
Copying (Cloning) a Cue Definition ................................................................ 811
Modifying a Cue.............................................................................................. 811
Deleting a Cue............................................................................................... 814
Version 10 805
Cues Defined
Cues control the appearance of business objects and relationships inside any
Matrix browser. They make certain objects and relationships stand out visually
for the user who created them.
This appearance control is based on conditions that you specify such as
attribute value, current state, or lateness. Objects and relationships that meet
the criteria may appear in any distinct color, line, or font style.
You can save a cue and not make it active. This allows for multiple or different
sets of conditions to be used at different times or as a part of different Views.
See Using View Manager in the Matrix Navigator Guide. Cues are set using
the Visuals Manager and saved as a query in your personal settings. They can
be activated from the Visuals Manager Cue tab or from the View menu.
From Matrix Navigator browsers, cues that highlight the appearance of certain
objects can be very useful. Each user can create her/his own cues from Matrix
Navigator (or MQL). However, if your organization wants all users to use a
basic set of similar cues consistently, it may be easier to create them in MQL,
then copy the code to each user’s personal settings (by setting context).
Cues can be defined and managed from within MQL or from the Visuals
Manager in Matrix Navigator. Once the cues are defined, individual users can
turn them on and off from the Matrix browsers as they are needed.
In the Matrix Navigator browsers, they display on the Cues tab page within the
Visuals Manager window and in the View menu.
It is important to note that cues are all Personal Settings that are available and
activated only when context is set to the person who defined them.
From Matrix browsers, unique cues can be very useful when interacting with many
objects. Each user can create her/his own cues from Matrix Navigator (or MQL).
However, if your organization wants all users to see a basic set of similar cues
consistently, it may be easier to create them in MQL, then copy the code to each user’s
personal settings (by setting context).
Adding a Cue To create a new cue from within MQL, use the Add Cue statement:
add cue NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the cue you are defining. Cue names cannot include asterisks.
ITEM specifies the characteristics you are setting.
When assigning a name to the cue, you cannot have the same name for two cues. If you
use the name again, an error message will result. However, several different users could
use the same name for different cues. (Cues are local to the context of individual users.)
After assigning a cue name, the next step is to specify cue characteristics (ITEM). The
following are Add Cue clauses:
[!|in|notin|not]active
appliesto businessobject|relationship|all
type TYPE_PATTERN
name PATTERN
revision REVISION_PATTERN
color COLOR
font FONT
highlight COLOR
vault PATTERN
linestyle solid|bold|dashed|dotted
order -1|0|1
owner PATTERN
where QUERY_EXPR
[!|not]hidden
Each clause and the arguments they use are discussed in the sections that follow.
Version 10 807
Active Clause The Active clause is used to indicate that the cue is active or not active (!active). The
default is active.
Appliesto Clause The Appliesto clause indicates that the cue applies to a business object, a relationship, or
both (all). Since relationships and objects can have the same attributes, cues must specify
to which they should apply.
When defining a cue for an object, you can use color and font to highlight it. When
defining a cue for a relationship you can use color and line style, as described below.
Type Clause The Type clause of the Add Cue statement assigns a cue for a particular type of business
object or relationship.
type TYPE_PATTERN
TYPE_PATTERN defines the types for which you are assigning a cue.
The Type clause can include more than one type by using multiple values to define the
pattern. The Type clause can also use wildcard characters.
When listing multiple values as part of a pattern, separate each value with a comma and no
spaces, or enclose any multi-word type value within quotation marks. If you include
spaces, Matrix reads the value as the next part of the cue definition.
Name Clause The Name clause of the Add Cue statement assigns the names of objects to include in the
cue.
name PATTERN
Revision Clause The Revision clause of the Add Cue statement assigns a cue for a particular revision of
business objects.
revision REVISION_PATTERN
REVISION_PATTERN defines the revision for which you are assigning a cue.
The Revision clause can include more than one revision value and wildcards, as in the
other clauses that use patterns. Typically, you might use a wildcard, but would not include
more than one or two revisions. Adding a cue for the latest revision number can highlight
only the most current business objects in a view.
Color, Font, The Color, Font, Highlight, and Linestyle clauses of the Add Cue statement define the
Highlight, and visual characteristics of the objects/relationships. The options for an object are color and
Linestyle Clauses font, while the options for a relationship are color and line style.
color COLOR
font FONT
highlight COLOR
linestyle solid|bold|dashed|dotted
COLOR is the name of the color to display for the object text and/or the relationship arrow.
When COLOR is defined for highlight, this applies when the object is highlighted
(selected).
You can enter a style of solid, bold, dashed, or dotted for the relationship arrow displayed
between objects. This control is available only if you are applying the cue to relationships.
Vault Clause The Vault clause of the Add Cue statement assigns a cue for business objects that are in a
particular or similar vault:
vault PATTERN
PATTERN defines the vault(s) for which you are assigning a cue.
The Vault clause can use wildcard characters. For example, the following definition
displays a cue for all business objects that reside in the “Vehicle Project” vault:
add cue “Vault Search”
businessobject * * *
vault “Vehicle Project”
owner *;
Order Clause The Order clause of the Add Cue statement defines the order in which the objects/
relationships are displayed in relation to other cues: before, with, or after other cues. If
more than one cue can apply to an object, Matrix needs to know which cues to present.
The before, with, and after ordering scheme establishes these priorities.
order -1|0|1
-1 is the lowest priority. These cues are applied first with any subsequent cue changes
allowed.
0 ranks the cue in the order in which they are activated.
1 is the highest priority. Objects will change to these cues after any others are first
applied.
Version 10 809
Owner Clause The Owner clause of the Add Cue statement assigns a cue for business objects that were
created by a particular owner:
owner PATTERN
NAME_PATTERN defines the owner(s) for which you are creating a cue.
The Owner clause can use wildcard characters. You can also use multiple values to define
the pattern. You can specify both the first and last name of an owner. For example, the
following owner clause specifies all objects whose owner names begin with pat or thur:
add cue “Object Owner” owner pat*,thur*;
This statement might provide a cue for objects created by owners patricia, patty, and
thurston.
Where Clause The Where clause of the Add Cue statement is the most powerful and the most
complicated. It searches for selectable business object properties. This involves examining
each object for the presence of the property and checking to see if it meets the search
criteria. If it does, the object is displayed with the cues applied; otherwise, it is ignored.
While the Where clause can test for equality, it can test for many other characteristics as
well. The syntax for the Where clause details the different ways that you can apply the
cue, using familiar forms of expression:
where “QUERY_EXPR”
Or:
where ‘QUERY_EXPR’
Hidden Clause You can mark the new cue as “hidden” so that it does not appear in the chooser in Matrix.
Users who are aware of the hidden cue’s existence can enter the name manually where
appropriate. Hidden objects are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the cue. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add cue NAME property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
You can modify any cue that you own, and copy any cue to your own workspace that
exists in any user definition to which you belong. As an alternative to copying definitions,
you can use the set workspace statement to make your workspace look like that of
another user. Business Administrators can change their workspace to that of another user
to work with cues that they do not own. See Setting the Workspace in Chapter 45 for
details.
Copying (Cloning) After a cue is defined, you can clone the definition with the Copy Cue statement. Cloning
a Cue Definition a cue definition requires Business Administrator privileges, except that you can copy a cue
definition to your own context from a group, role or association in which you are defined.
This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy cue SRC_NAME DST_NAME [fromuser USER] [touser USER]
[overwrite] [MOD_ITEM {MOD_ITEM}];
The order of the fromuser, touser and overwrite clauses is irrelevant, but
MOD_ITEMS, if included, must come last.
MOD_ITEMs are modifications that you can make to the new definition. Refer to the table
below for a complete list of possible modifications.
Modifying a Cue The List Cue statement is used to display a list of all cues that are currently defined. It is
useful in confirming the existence or exact name of a cue that you want to modify, since
Matrix is case-sensitive.
list cue [user USER_NAME];
USER_NAME can be the name of any person, group, role, or association. If the user
modifier is used, the system displays the requested information relating to workspace
objects of the person, group, role, or association indicated.
Users can list their own workspace objects or those of any group, role, or association to
which they belong. Business Administrators can list the workspace objects of any users.
Use the list of all the existing cues along with the Print statement to determine the
search criteria you want to change. Use the Modify Cue statement to add or remove
defining clauses and change the value of clause arguments:
modify cue NAME [ITEM {ITEM}];
Version 10 811
ITEM is the type of modification you want to make. With the Modify Cue statement, you
can use these modification clauses to change a cue:
active The active option is changed to specify that the object is active.
notactive The active option is changed to specify that the object is not active.
appliesto The appliesto option is changed to reflect what the cue now affects.
businessobject|relationship| all
type TYPE_PATTERN The type is changed to the named pattern.
name PATTERN The name is changed to the named pattern.
revision REVISION_PATTERN The revision is changed to the named pattern.
color COLOR The color is changed to the new color.
font FONT The font is changed to the new font.
highlight COLOR The highlight is changed to the new color.
vault PATTERN The vault is changed to the pattern specified.
linestyle The linestyle is changed to the new linestyle specified.
solid|bold|dashed|dotted
order -1|0|1 The order is modified.
owner PATTERN The owner is changed to the pattern specified.
where QUERY_EXPR The query expression is modified.
hidden The hidden option is changed to specify that the object is hidden.
nothidden The hidden option is changed to specify that the object is not hidden.
property NAME [to ADMINTYPE The named property is modified.
NAME] [value STRING]
add property NAME [to ADMINTYPE The named property is added.
NAME] [value STRING]
remove property NAME [to The named property is removed.
ADMINTYPE NAME] [value STRING]
When making modifications, you simply substitute new values for the old. As you can see,
each modification clause is related to the clauses and arguments that define the server.
Although the Modify Cue statement allows you to use any combination of criteria, no
other modifications can be made. To change the cue name or remove the cue entirely, you
must use the Delete Cue statement (see Deleting a Cue) and/or create a new cue.
For example, assume you have a cue named “Product Comparisons” with the following
definition:
cue “Product Comparisons”
type FormulaA
name Lace
revision 3
color blue
highlight yellow
vault “Perfume Formulas”
owner channel, taylor;
Version 10 813
Deleting a Cue
If a cue is no longer needed, you can delete it using the Delete Cue statement:
delete cue NAME;
After this statement is processed, the cue is deleted and you receive the MQL prompt for
the next statement.
When a cue is deleted, there is no effect on the business objects or on queries performed
by Matrix. Cues are local only to the user’s context and are not visible to other Matrix
users.
Version 10 815
Object Tips Defined
Object Tips are small pop-up windows that appear from the Matrix Navigator application
when you hold the cursor briefly over any object in a browser. They are similar to the Tool
Tips that appear over toolbar buttons in many programs to tell you what the button is for.
However, unlike tool tips, you can define the contents of the Object Tip window to display
the information you need most often about the objects you use. You can also use tips
instead of Type Name and Revision to identify objects in Matrix Navigator.
For example, you could include any attribute or basic property for an object that you
frequently need to know, such as the current owner, or the last date the object was
changed. This gives you a quick way to check basic data about an object without having to
select Basics or Attributes from the menu or toolbar.
You can save Object Tip definitions by name (as personal settings) to turn on or off as you
need them. A single tip may become part of several Views, being activated in one, and
available in another. Refer to Using View Manager in the Matrix Navigator Guide for
more information on Views.
From Matrix Navigator browsers, tips that quickly display pertinent information about
objects can be very useful. Each user can create her/his own tips from Matrix Navigator
(or MQL). However, if your organization wants all users to use a basic set of similar tips
consistently, it may be easier to create them in MQL, then copy the code to each user’s
personal settings (by setting context).
Tips can be defined and managed from within MQL or from the Visuals Manager in
Matrix Navigator. Once the tips are defined, individual users can turn them on and off
from the Matrix browsers as they are needed.
In the Matrix Navigator browsers, they display on the Tips tab within the Visuals Manager
window and in the View menu.
It is important to note that tips are all Personal Settings that are available and activated
only when context is set to the person who defined them.
To define a new tip from within MQL, use the Add Tip statement:
add tip NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the tip you are defining. Tip names cannot include asterisks.
ADD_ITEM specifies the characteristics you are setting.
When assigning a name to the tip, you cannot have the same name for two tips. If you use
the name again, an error message will result. However, several different users could use
the same name for different tips. (Tips are local to the context of individual users.)
After assigning a tip name, the next step is to specify the conditions (ADD_ITEM) that
each object must meet in order to display when the tip is turned on (activated). The
following are Add Tip clauses:
[!|in|notin|not]active
appliesto businessobject|relationship
type TYPE_PATTERN
name PATTERN
revision REVISION_PATTERN
vault PATTERN
owner PATTERN
where QUERY_EXPR
expression EXPRESSION
[!|not]hidden
Each clause and the arguments they use are discussed in the sections that follow.
Active Clause The Active clause of the Add Tip statement is used to indicate that the tip is active or not
active (!active). The default is active.
Applies To Clause The Applies To clause of the Add Tip statement indicates that the tip applies to business
objects or relationships.
Type Clause The Type clause of the Add Tip statement assigns a tip for a particular type of business
object or relationship.
type TYPE_PATTERN
Version 10 817
TYPE_PATTERN defines the types for which you are assigning a tip.
The Type clause can include more than one type by using multiple values to define the
pattern. The Type clause can also use wildcard characters.
When listing multiple values as part of a pattern, separate each value with a comma and no
spaces, or enclose any multi-word type value within quotation marks. If you include
spaces, Matrix reads the value as the next part of the tip definition.
Name Clause The Name clause of the Add Tip statement assigns the names of objects to include in the
tip.
name PATTERN
When listing multiple values as part of a pattern, separate each value with a comma and no
spaces, or enclose any multi-word type value within quotation marks (for example,
"International Business Machines"). If you include spaces, Matrix reads the
value as the next part of the tip definition, as described in the Type clause.
Revision Clause The Revision clause of the Add Tip statement assigns a tip for a particular revision of
business objects.
revision REVISION_PATTERN
REVISION_PATTERN defines the revision for which you are assigning a tip.
The Revision clause can include more than one revision value and wildcards as in the
other clauses that use patterns. Creating a tip that shows the most current change to an
object can be very useful. This gives you a quick way to identify only the objects that have
recently changed.
When listing multiple values as part of a pattern, separate each value with a comma and no
spaces, or enclose any multi-word type value within quotation marks. If you include
spaces, Matrix reads the value as the next part of the tip definition.
Vault Clause The Vault clause of the Add Tip statement assigns a tip for business objects that are in a
particular or similar vault:
vault PATTERN
PATTERN defines the vault(s) for which you are assigning a tip.
Owner Clause The Owner clause of the Add Tip statement assigns a tip for business objects that were
created by a particular owner:
owner PATTERN
NAME_PATTERN defines the owner(s) for which you are creating a tip.
The Owner clause can use wildcard characters. You can also use multiple values to define
the pattern. You can specify both the first and last name of an owner. For example, the
following owner clause specifies all objects whose owner names begin with pat or thur:
add tip “Object Owner” owner pat*,thur*;
This statement might provide a tip for objects created by owners patricia, patty, and
thurston.
Where Clause The Where clause of the Add Tip statement is the most powerful and the most
complicated. It searches for selectable business object properties. This involves examining
each object for the presence of the property and checking to see if it meets the search
criteria. If it does, the object is displayed with the tips applied; otherwise, it is ignored.
While the Where clause can test for equality, it can test for many other characteristics as
well. The syntax for the Where clause details the different ways that you can apply the tip,
using familiar forms of expression:
where “QUERY_EXPR”
Or:
where ‘QUERY_EXPR’
Expression Clause The Expression clause of the Add Tip statement can be used to obtain or use information
related to a tip, including business object data and also administrative object information.
EXPRESSION can be any select expression available for business objects. The object tip
will display up to 100 characters. For detailed information, see the Select Expressions
appendix in the Matrix Navigator Guide.
Hidden Clause You can mark the new tip as “hidden” so that it does not appear in the chooser in Matrix.
Users who are aware of the hidden tip’s existence can enter the name manually where
appropriate. Hidden objects are accessible through MQL.
Version 10 819
Property Clause Integrators can assign ad hoc attributes, called Properties, to the tip. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add tip NAME property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
You can modify any tip that you own, and copy any tip to your own workspace that exists
in any user definition to which you belong. As an alternative to copying definitions, you
can use the set workspace statement to make your workspace look like that of
another user. Business Administrators can change their workspace to that of another user
to work with tips that they do not own. See Setting the Workspace in Chapter 45 for
details.
Copying (Cloning) After a tip is defined, you can clone the definition with the Copy Tip statement. Cloning a
a Role Definition tip definition requires Business Administrator privileges, except that you can copy a tip
definition to your own context from a group, role or association in which you are defined.
This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy tip SRC_NAME DST_NAME [fromuser USER] [touser
USER] [overwrite] [MOD_ITEM {MOD_ITEM}];
The order of the fromuser, touser and overwrite clauses is irrelevant, but
MOD_ITEMS, if included, must come last.
MOD_ITEMs are modifications that you can make to the new definition. Refer to the table
below for a complete list of possible modifications.
Modifying a Tip The List Tip statement is used to display a list of all tips that are currently defined. It is
useful in confirming the existence or exact name of a tip that you want to modify, since
Matrix is case-sensitive.
list tip [user USER_NAME];
Version 10 821
ITEM is the type of modification you want to make. With the Modify Tip statement, you
can use these modification clauses to change a tip:
active The active option is changed to specify that the object is active.
notactive The active option is changed to specify that the object is not
active.
appliesto The appliesto option is changed to reflect what the tip now
businessobject|relationship affects.
type TYPE_PATTERN The type is changed to the named pattern.
name PATTERN The name is changed to the named pattern.
revision REVISION_PATTERN The revision is changed to the named pattern.
vault PATTERN The vault is changed to the pattern specified.
owner PATTERN The owner is changed to the pattern specified.
where QUERY_EXPR The query expression is modified.
expression EXPRESSION The select expression is changed to the expression specified.
hidden The hidden option is changed to specify that the object is
hidden.
nothidden The hidden option is changed to specify that the object is not
hidden.
property NAME [to ADMINTYPE The named property is modified.
NAME] [value STRING]
add property NAME [to The named property is added.
ADMINTYPE NAME] [value
STRING]
remove property NAME [to The named property is removed.
ADMINTYPE NAME] [value
STRING]
These clauses are essentially the same ones that are used to define an initial tip except that
Add property and Remove property clauses are included. When making modifications,
you simply substitute new values for the old.
Although the Modify Tip statement allows you to use any combination of criteria, no other
modifications can be made except the ones listed. To change the tip name or remove the
tip entirely, you must use the Delete Tip statement (see Deleting a Tip) and/or create a
new tip.
If a tip is no longer needed, you can delete it using the Delete tip statement:
delete tip NAME;
After this statement is processed, the tip is deleted and you receive the MQL prompt for
the next statement.
When a tip is deleted, there is no effect on the business objects or on queries performed by
Matrix. Tips are local only to the user’s context and are not visible to other Matrix users.
Version 10 823
824 MQL Guide
43
Working With Toolsets
Toolsets Defined........................................................................................... 826
Creating Toolsets ......................................................................................... 827
Active Clause.................................................................................................. 827
Program Clause.............................................................................................. 827
Method Clause................................................................................................ 827
Hidden Clause ................................................................................................ 827
Property Clause .............................................................................................. 827
Copying and/or Modifying a Toolset........................................................... 829
Copying (Cloning) a Toolset Definition ........................................................... 829
Modifying a Toolset Definition......................................................................... 829
Deleting a Toolset......................................................................................... 831
Version 10 825
Toolsets Defined
It is important to note that toolsets are all Personal Settings that are available and
activated only when context is set to the person who defined them.
To define a new toolset from within MQL, use the Add Toolset statement:
add toolset NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the toolset you are defining. The toolset name cannot include
asterisks.
ADD_ITEM specifies the characteristics you are setting.
When assigning a name to the toolset, you cannot have the same name for two toolsets. If
you use the name again, an error message will result. However, several different users
could use the same name for different toolsets. (Remember that toolsets are local to the
context of individual users.)
After assigning a toolset name, the next step is to specify the conditions (ADD_ITEM) that
must be met in order to display the toolbar button when the toolset is turned on (activated).
The following are Add Toolset clauses:
[!|in|notin|not]active
method
[!not]hidden
Each clause and the arguments they use are discussed in the sections that follow.
Active Clause The Active clause of the Add Tip statement is used to indicate that the tip is active or not
active (!active). The default is active.
Program Clause The Program clause allows you to define which programs and/or wizards should be added
to the Toolset. You can include multiple programs/wizards.
Method Clause The Method clause allows you to define the method to be added to the Toolset. Only one
method can be included in a toolset.
Hidden Clause You can mark the new toolset as “hidden” so that it does not appear in the chooser in
Matrix. Users who are aware of the hidden toolset’s existence can enter the name
manually where appropriate. Hidden objects are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the toolset. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
Version 10 827
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add toolset NAME property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
You can modify any toolset that you own, and copy any toolset to your own workspace
that exists in any user definition to which you belong. As an alternative to copying
definitions, you can use the set workspace statement to make your workspace look
like that of another user. Business Administrators can change their workspace to that of
another user to work with toolsets that they do not own. See Setting the Workspace in
Chapter 45 for details.
Copying (Cloning) After a toolset is defined, you can clone the definition with the Copy Toolset statement.
a Toolset Cloning a toolset definition requires Business Administrator privileges, except that you
Definition can copy a toolset definition to your own context from a group, role or association in
which you are defined.
This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy toolset SRC_NAME DST_NAME [fromuser USER] [touser USER]
[overwrite] [MOD_ITEM {MOD_ITEM}];
The order of the fromuser, touser and overwrite clauses is irrelevant, but
MOD_ITEMS, if included, must come last.
MOD_ITEMs are modifications that you can make to the new definition. Refer to the table
below for a complete list of possible modifications.
Modifying a The List Toolset statement is used to display a list of all toolsets that are currently defined.
Toolset Definition It is useful in confirming the existence or exact name of a toolset that you want to modify,
since Matrix is case-sensitive.
list toolset [user USER_NAME];
USER_NAME can be the name of any person, group, role, or association. If the user
modifier is used, the system displays the requested information relating to workspace
objects of the person, group, role, or association indicated.
Users can list their own workspace objects or those of any group, role, or association to
which they belong. Business Administrators can list the workspace objects of any users.
Use the list of all the existing toolsets along with the Print statement to determine the
search criteria you want to change. Use the Modify Toolset statement to add or remove
defining clauses and change the value of clause arguments:
modify toolset NAME [MOD_ITEM {MOD_ITEM}];
Version 10 829
NAME is the name of the toolset you want to modify.
ITEM is the type of modification you want to make. With the Modify Toolset statement,
you can use these modification clauses to change a toolset:
active The active option is changed to specify that the object is active.
notactive The active option is changed to specify that the object is not active.
add program NAME {,NAME} The named program is added to the toolset.
add method NAME {,NAME} The named method is added to the toolset.
remove program NAME {,NAME} The named program is removed from the toolset.
remove method NAME {,NAME} The named method is removed from the toolset.
remove all All methods and programs are removed from the toolset.
hidden The hidden option is changed to specify that the object is hidden.
nothidden The hidden option is changed to specify that the object is not hidden.
property NAME [to ADMINTYPE The named property is modified.
NAME] [value STRING]
add property NAME [to ADMINTYPE The named property is added.
NAME] [value STRING]
remove property NAME [to The named property is removed.
ADMINTYPE NAME] [value STRING]
These clauses are essentially the same ones that are used to define an initial toolset except
that Add property and Remove property clauses are included. When making
modifications, you simply substitute new values for the old.
Although the Modify Toolset statement allows you to use any combination of criteria, no
other modifications can be made except the ones listed. To change the toolset name or
remove the toolset entirely, you must use the Delete toolset statement (see Deleting a
Toolset) and/or create a new toolset.
If a toolset is no longer needed, you can delete it using the Delete toolset statement:
delete toolset NAME;
Version 10 831
832 MQL Guide
44
Working With Tables
Tables Defined .............................................................................................. 834
Creating a Table............................................................................................ 835
Active Clause.................................................................................................. 835
Units Clause ................................................................................................... 835
Description Clause.......................................................................................... 836
Icon Clause..................................................................................................... 837
Column Clause ............................................................................................... 837
Hidden Clause ................................................................................................ 839
Property Clause .............................................................................................. 839
Copying and/or Modifying a Table .............................................................. 840
Copying (Cloning) a Table Definition .............................................................. 840
Modifying a Table ........................................................................................... 840
Evaluating a Table ........................................................................................ 843
Using Collections ............................................................................................ 843
Deleting a Table ........................................................................................... 845
Printing a Table ............................................................................................ 846
Version 10 833
Tables Defined
Matrix tables can be defined to display multiple business objects and related information.
Each row of the table represents one business object. Expressions are used to define the
columns of data that are presented about the business objects in each row. When you
define a table, you determine the number and contents of your table columns.
In Matrix, there are two kinds of tables:
• A User table is a user-defined template of columns that can be used when objects are
displayed in the Matrix Navigator (Details browser mode only), or in MQL with the
Print Table statement.
User tables are created in MQL, or in Matrix Navigator’s Visuals Manager and
displayed when Matrix Navigator is in details mode. In Matrix Navigator, tables that
users create are available from the Views/Tables menu. This enables viewing
different information about the same object with a single mouse-click.
Tables can be added as part of the definition for a customized View. Each time that
View is activated, the Table defined for it displays.
Users can save Table definitions by name (as personal settings) to turn on or off as
needed. A single table may become part of several Views, being activated in one, and
available in another. Refer to Using View Manager in the Matrix Navigator Guide for
more information on Views.
From Matrix Navigator browsers, tables that present information in a familiar format
can be very useful. Each user can create her/his own tables from Matrix Navigator (or
MQL). However, if your organization wants all users to use a basic set of similar
tables consistently, it may be easier to create them in MQL, then copy the code to
each user’s personal settings (by setting context).
• A System table is an Administrator-defined template of columns that can be used in
custom applications. These tables are available for system-wide use, and not
associated with the session context. Each column has several parameters where you
can define the contents of the column, link data (href and alt), user access, and other
settings. For example, a user could click on a link called Parts to display a system
table containing a list of parts. The other columns in the table could contain
descriptions, lifecycle states, and owners.
System tables are created by business administrators that have Table administrative
access, and are displayed when called within a custom application.
System table columns can be role-based, that is, only shown to particular users. For
example, the Parts table might have a Disposition Codes column that is shown only
when a person is logged in as a user defined as a Design Engineer. Or a user defined
as a Buyer might be shown a column in a table that is not seen by a Supplier user.
When no users are specified in the command and table definitions, they are globally
available to all users.
When business objects are loaded into a table, Matrix evaluates the table expressions for
each object, and fills in the table cells accordingly. Expressions may also apply to
relationships, but these columns are only filled in when the table is used in a Navigator
window. You can sort business objects by their column contents by clicking on the
column header.
To define a table from within MQL use the Add Table statement:
add table NAME user USER_NAME [ADD_ITEM {ADD_ITEM}];
Or
add table NAME system [ADD_ITEM {ADD_ITEM}];
NAME is the name of the table you are defining. Table names cannot include asterisks.
USER_NAME refers to a person, group, role, or association.
system refers to a table that is available for system-wide use, and not associated with the
session context.
ADD_ITEM is an Add Table clause which provides additional information about the table.
The Add Table clauses are:
[!|in|notin|not]active
description STRING_VALUE
icon IMAGE_PATH
[!|not]hidden
The column clause must be used for each required column of the table, to specify the
COLUMN_TYPE_DEF. All other clauses and subclauses are optional.
Each clause and the arguments they use are discussed in the sections that follow.
Active Clause The Active clause of the Add Table statement is used to indicate that the table is active or
not active (!active). The default is active.
Units Clause The Units clause of the Add Table statement specifies the units of page measurement.
There are three possible values: picas, points, or inches.
units picas
Or
units points
Or
units inches
Without a unit of measurement, Matrix cannot interpret the values of any given header,
footer, margin, or field size. Because picas are the default unit of measurement, Matrix
will automatically assume a picas value if you do not use a Units clause.
Version 10 835
Picas are the most common units of page measurement in the computer industry. Picas use
a fixed size for all characters. Determining the size of a field value is easy when using
picas as the measurement unit. Simply determine the maximum number of characters that
will be used to contain the largest field value. Use that value as your field size. For
example, if the largest field value will be a six digit number, you need a field size of six
picas. This is not true when using points.
Points are standard units used in the graphics and printing industry. A point is equal to 1/
72 of an inch or 72 points to the inch. Points are commonly associated with fonts whose
print size and spacing varies from character to character. Unless you are accustomed to
working with points, measuring with points can be confusing and complicated. For
example, the character “I” may not occupy the same amount of space as the characters “E”
or “O.” To determine the maximum field size, you need to know the maximum number of
characters that will be used and the maximum amount of space required to express the
largest character. Multiply these two numbers to determine your field size value.
Inches are common English units of measurement. While you can use inches as your unit
of measurement, be aware that field placement can be difficult to determine and specify.
Each field is composed of character string values. How many inches does each character
need or use? If the value is a four-digit number, how many inches wide must the field be to
contain the value? How many of these fields can you fit across a table page? Considering
the problems involved in answering these questions, you can see why picas are a favorite
measuring unit.
Description The Description clause of the Add Table statement provides general information about the
Clause function of the table. Since there may be subtle differences between tables, you can use
the description clause to point out the differences.
You can distinguish your table in your selection of a table name. This consists of a
character string value to identify the table being created and to reference it later. It should
have meaning to the purpose of the table. If possible, avoid cryptic names. For example,
“Cost Table” is a valid name, but it does not inform you of what costs you are presenting
in the table.
Since the table name is too short to be very descriptive, you can include a Description
clause as part of the table definition. This enables you to associate a prompt, comment, or
qualifying phrase with the table being defined.
For example, if you were defining a table named “Cost Table,” you might write an Add
Table statement with a Description clause similar to one of the following. The information
in each table might differ considerably.
add table “Cost Table”
description “Provides daily operating costs of the department”;
add table “Cost Table”
description “Provides manufacturing costs for Widget A”;
add table “Cost Table”
description “Provides monthly costs for supporting Widget B”;
When specifying a value for the description, enter a string of any length. However, the
longer the string, the more difficult it may to use.
.gif filenames should not include the @ sign, as that is used internally by Matrix.
Column Clause Column clauses of the Add Table statement define each column in the table. It is made up
of several subclauses. Each Column clause must have a businessobject, relationship, or set
subclause, but all other subclauses are optional:
column [label STRING_VALUE] COLUMN_TYPE_DEF [COLUMN_DEF_ITEM]
If the label keyword is not used, the column heading is the expression.
STRING_VALUE is the text that is to appear in the heading of the column.
COLUMN_TYPE_DEF can be any of the following:
businessobject QUERY_WHERE_EXPRESSION
relationship QUERY_WHERE_EXPRESSION
set QUERY_WHERE_EXPRESSION
Version 10 837
the columns, the order in which the columns should be placed on the page, and the links
used within the columns.
Hidden Clause You can mark the new table as “hidden” so that it does not appear in the chooser in
Matrix, which simplifies the end-user interface. Users who are aware of the hidden table’s
existence can enter the name manually where appropriate.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the table. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add table NAME [system] property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
Version 10 839
Copying and/or Modifying a Table
You can modify any table that you own, and copy any table to your own workspace that
exists in any user definition to which you belong. As an alternative to copying definitions,
you can use the set workspace statement to make your workspace look like that of
another user. Business Administrators can change their workspace to that of another user
to work with tables that they do not own. See Setting the Workspace in Chapter 45 for
details.
Copying (Cloning) After a table is defined, you can clone the definition with the Copy Table statement.
a Table Definition Cloning a table definition requires Business Administrator privileges, except that you can
copy a table definition to your own context from a group, role or association in which you
are defined.
This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy table SRC_NAME DST_NAME [fromuser USER] [touser USER]
[overwrite] [MOD_ITEM {MOD_ITEM}];
The order of the fromuser, touser and overwrite clauses is irrelevant, but
MOD_ITEMS, if included, must come last.
MOD_ITEMs are modifications that you can make to the new definition. Refer to the table
below for a complete list of possible modifications.
Modifying a Table The List Table statement is used to display a list of all tables that are currently defined. It
is useful in confirming the existence or exact name of a table that you want to modify,
since Matrix is case-sensitive.
list table [user USER_NAME | system] [select [FIELD_NAME {FIELD_NAME}]];
Or
modify table NAME system [MOD_ITEM {MOD_ITEM}];
column modify COLUMN_NUMBER The column identified by the given column number is modified. To
[label STRING_VALUE] obtain the column number for a specific column, use the Print table
COLUMN_TYPE_DEF statement. When the table definition is listed, note the number assigned
[COLUMN_DEF_ITEM] to the column to delete.
column modify name COLUMN_NAME The column identified by the given column name is modified.
[label STRING_VALUE]
COLUMN_TYPE_DEF
[COLUMN_DEF_ITEM]
column COLUMN_DEF A new column can be defined according to the column definition clauses
and placed at the end of the table.
hidden The hidden option is changed to specify that the object is hidden.
nothidden The hidden option is changed to specify that the object is not hidden.
property NAME [to ADMINTYPE The named property is modified.
NAME] [value STRING]
add property NAME [to ADMINTYPE The named property is added.
NAME] [value STRING]
remove property NAME [to The named property is removed.
ADMINTYPE NAME] [value STRING]
Version 10 841
Each modification clause is related to the arguments that define the table. To change the
value of one of the defining clauses or add a new one, use the Modify clause that
corresponds to the desired change.
When modifying a table, you can make the changes from a script or while working
interactively with MQL.
• If you are working interactively, perform one or two changes at a time to avoid the
possibility of one invalid clause invalidating the entire statement.
• If you are working from a script, group the changes together in a single Modify Table
statement.
Integrators can use the evaluate table statement to include information from Matrix
tables in other applications. Information is returned for a single business object or
relationship at a time. The business object ID or relationship ID is required and can be
obtained using the print statement.
evaluate table NAME [user USER_NAME | system] businessobject ID;
Or
evaluate table NAME [user USER_NAME | system] relationship ID;
Using Collections The evaluate table command also allows a BUS_OBJ_COLLECTION_SPEC (as
defined in Business Object Collection Clause in Chapter 1) to be given as an alternative to
using the businessobject or relationship keywords:
evaluate table NAME [user USER_NAME | system] BUS_OBJ_COLLECTION_SPEC;
Version 10 843
If you want to perform an evaluate table with single business object expressions against
each member of a collection, you need to create your own loop.
# Create a list of busId's for the set
set lObject [mql print set escalate select id dump |]
set lBusId [split $lObject \n]
# loop through the list of busId's and run evaluate table for each
# NOTE: use the keyword 'bus' to indicate a bus obj, not a rel ID.
foreach sBusId $lBusId {
set sRow [mql evaluate table 'MyBOTable' bus $sBusId]
puts $sRow
}
If a table is no longer required, you can delete it using the Delete Table statements
delete table NAME [user USER_NAME | system];
After this statement is processed, the table is deleted and you receive an MQL prompt for
another statement.
Version 10 845
Printing a Table
Use the Print Table statement to print information about the attributes of a specific table,
including the number and characteristics of each table column.
print table NAME [user USER_NAME | system][SELECT];
table DescNoteRes
inactive
#100000 column
label Description
businessobject description
size 11 2
minsize 0 0
autoheight true
autowidth true
editable true
hidden false
sorttype none
user all
#100001 column
label Notes
businessobject attribute[Notes]
size 10 2
minsize 0 0
autoheight true
autowidth true
editable true
hidden false
sorttype none
user all
nothidden
created Wed Oct 31, 2001 2:57:09 PM EST
Since tables have additional uses in support of dynamic UI modeling, the MQL print
command suppresses the output of data that is not used. For example, if you print a table
that is defined as a system object used for Web applications, the following selects will not
be printed:
size, minsize, scale, font, minwidth, minheight, absolutex, absolutey, xlocation,
ylocation, width, and height.
Conversely, when printing non-Web tables, parameters used only for Web-based tables
are suppressed from the output:
href, alt, range, update, and settings
Version 10 847
848 MQL Guide
45
Working With Views
Views Defined ............................................................................................... 850
Creating a View ............................................................................................. 851
Active Clause.................................................................................................. 851
Hidden Clause ................................................................................................ 851
Property Clause .............................................................................................. 851
Copying a View ............................................................................................. 853
Setting the Workspace.................................................................................... 854
Modifying a View........................................................................................... 855
Deleting a View ............................................................................................. 857
Version 10 849
Views Defined
When we look at some objects, we always need to know certain information and prefer
that we see it in a similar format. From the Matrix Navigator, customized Views offer a
flexible and convenient way to package frequently used sets of Visuals (filters, cues, tips,
toolsets and tables). For example, for each new revision of a product component, you
might want to:
• Identify the latest change made with a red arrow cue
• List who performs work on it and who owns it with a quick object tip
• Filter out all the old revisions
• Always use the BOM Details table in the Details browser
• Run a program to create a new revision on command (with a tool button)
In Matrix Navigator you can use View Manager to make your filter, cue, tip, toolset and
table selections only once, name the View and save it. The next time you needed to create
a new product revision, you select the object, select the named View and do your work.
In Matrix Navigator, these Views are listed in the View menu by the names you give
them, for you to use over and over again on any object/s you select. In MQL, you can use
the List View statement to see all the available views.
Views can be defined and managed from within MQL or from the Visuals Manager in
Matrix Navigator. You cannot create a named View until you have several filters, cues,
tips, toolsets or tables available from which to choose. Once the views are defined,
individual users can turn them on and off from Matrix Navigator browsers as needed. In
addition, views can be turned on programmatically with appl navigator/indented/
indentedtable commands that can launch a dialog with a specified view turned on.
From Matrix Navigator, views that customize or standardize a display can be very useful.
Each user can create her/his own views from Matrix Navigator (or MQL). However, if
your organization wants all users to use a basic set of similar views consistently, it may be
easier to create an MQL program, and have each user run the program.
In the Matrix Navigator, the list of named views displays in the View Manager and in the
in the View menu.
It is important to note that views are all Personal Settings that are available and activated
only when context is set to the person who defined them.
To define a new view from within MQL, use the Add View statement:
add view NAME [ADD_ITEM {ADD_ITEM}];
NAME is the name of the view you are defining. View names cannot include asterisks.
ADD_ITEM specifies the characteristics you are setting.
When assigning a name to the view, you cannot have the same name for two views. If you
use the name again, an error message will result. However, several different users could
use the same name for different views. (Remember that views are local to the context of
individual users.)
After assigning a view name, the next step is to specify which visuals or other conditions
should be include in the view (ADD_ITEM) when the view is turned on (activated). The
following are Add View clauses:
filter NAME
cue NAME
tip NAME
toolset NAME
table NAME
[!|not]hidden
The filter, cue, tip, toolset and table clauses require only the accurate name(s) of each one
to be entered.
Active Clause The Active clause of the Add View statement is used to indicate which members of the
view are active or not active (!active). The default is active. For example, if you want a
filter named NoClosed to be inactive, you could use the following active clause:
notactive filter NoClosed
Hidden Clause You can mark the new view as “hidden” so that it does not appear in the chooser in
Matrix. Users who are aware of the hidden view’s existence can enter the name manually
where appropriate. Hidden objects are accessible through MQL.
Property Clause Integrators can assign ad hoc attributes, called Properties, to the view. Properties allow
associations to exist between administrative definitions that aren’t already associated. The
property information can include a name, an arbitrary string value, and a reference to
another administration object. The property name is always required. The value string and
Version 10 851
object reference are both optional. The property name can be reused for different object
references, that is, the name joined with the object reference must be unique for any object
that has properties.
add view NAME property NAME [to ADMINTYPE NAME] [value STRING];
In order to use the property clause you must have admin property access. For additional
information on properties, see Overview of Administration Properties in Chapter 23.
After a view is defined, you can clone the definition with the Copy View statement.
Cloning a view definition requires Business Administrator privileges, except that you can
copy a view definition to your own context from a group, role or association in which you
are defined.
Copying a View from one user to another is more complicated than for other Visuals
because Views have members that need to be copied as well.
This statement lets you duplicate defining clauses with the option to change the value of
clause arguments:
copy view SRC_NAME DST_NAME [fromuser USER] [touser USER]
[overwrite] [changename VISUAL OLD_NAME NEW_NAME] [MOD_ITEM
{MOD_ITEM}];
MOD_ITEMs are modifications that you can make to the new definition. Refer to the table
in Modifying a View for a complete list of possible modifications.
When a View is copied, all its members are copied also. If a member of the same name
exists in the target user, the command aborts, unless overwrite or changename is
specified. If the command aborts, the database is left unchanged.
To avoid naming conflicts, you can specify a change of name when a member is copied.
This is done with the changename keyword. For example:
copy view View1 ViewTable fromuser purcell touser Engineer
changename filter Bugs PurcellBugs changename tip RelationName
PurcellRelationName;
where View1 is a View belonging to person purcell containing a filter named Bugs and a
tip named RelationName. This command will create a View named ViewTable in
role Engineer. The filter Bugs will be copied to a filter named PurcellBugs. The tip
RelationName will be copied to a tip named PurcellRelationName.
All other members of the View, if any, will be copied to the Role with their names
unchanged. If a View with that name already exists or if a Filter of that name exists, etc.,
the command will abort and the database will be left unchanged.
Version 10 853
Setting the The set workspace command allows you to change the Workspace currently active
Workspace in MQL so that the Workspace of some other User (person, group, role or association) is
visible.
Users can change to the Workspace of groups, roles, and associations to which they
belong. Business Administrators can change to the Workspace of any group, role,
association, or person.
The syntax for this command is:
set workspace user USERNAME
This command affects the behavior of all commands to which Workspace objects are
applicable, including:
• all commands specific to Workspace objects (for example, add/modify/delete filter)
• expand bus (affects which filters are used to control output)
USERNAME is the name of a person, group, role or association.
When users (other than Business Administrators) set Workspace to that of a group, role, or
association, they cannot use commands that modify the Workspace, that is, the add,
modify, and delete commands for Workspace objects. This restriction enforces the
rule that only Business Administrators are permitted to change the Workspace of a group,
role or association.
Note that set context user USERNAME will change the context to that of
USERNAME regardless of an earlier invocation of set workspace.
You can modify any view that you own, and copy any view to your own workspace that
exists in any user definition to which you belong. As an alternative to copying definitions,
you can use the set workspace statement to make your workspace look like that of
another user. Business Administrators can change their workspace to that of another user
to work with views that they do not own. See Setting the Workspace for details.
The List View statement is used to display a list of all views that are currently defined. It is
useful in confirming the existence or exact name of a view that you want to modify, since
Matrix is case-sensitive.
list view [user USER_NAME];
USER_NAME can be the name of any person, group, role, or association. If the user
modifier is used, the system displays the requested information relating to workspace
objects of the person, group, role, or association indicated.
Users can list their own workspace objects or those of any group, role, or association to
which they belong. Business Administrators can list the workspace objects of any users.
Use the list of all the existing views along with the Print statement to determine the
search criteria you want to change. Use the Modify View statement to add or remove
defining clauses and change the value of clause arguments:
modify view NAME [MOD_ITEM {MOD_ITEM}];
Version 10 855
Modify View Clause Specifies that…
property NAME [to ADMINTYPE The named property is modified.
NAME] [value STRING]
add property NAME [to ADMINTYPE The named property is added.
NAME] [value STRING]
remove property NAME [to The named property is removed.
ADMINTYPE NAME] [value STRING]
As you can see, each modification clause is related to the clauses and arguments that
define the view.
Although the Modify View statement allows you to use any combination of criteria, no
other modifications can be made except the ones listed. To change the view name or
remove the view entirely, you must use the Delete View statement (see Deleting a View)
and/or create a new view.
If a view is no longer needed, you can delete it using the Delete View statement:
delete view NAME;
Version 10 857
858 MQL Guide
Index
A B C D E F G H I J K L M N accessing MQL 44
O P Q R S T U V W X Y Z activity
assigning to multiple users 651
reassigning 506
Symbols adaplet
!match 89 mapping
!matchcase 89 case sensitive 87
${NAME} 589 adaplets
${REVISION} 589 case sensitive 87
${TYPE} 589 add alias 558
:using as escape character 777 add association
definition clause 317
A description clause 316
abort on error 46 hidden clause 318
abort transaction 76 icon clause 317
aborting scripts 46 introduced 316
abstract type 341 property clause 318
access add attribute
controlled by rules 391 default clause 326
defining in policy 413 description clause 327
delegating 676 icon clause 327
denying 415 introduced 325
granting 415, 676 multiline clause 333
owner 401 property clause 333
public 401 rule clause 328
revoking 677 trigger clause 332
summary of all 271 type clause 325
to business objects 268 add businessobject
to session information 100 specifying attributes 665
user 401 description clause 660
where used 271 image clause 661
which ones take precedence 268 introduced 660
with filter expression 265 owner clause 663, 673
access log 100, 101, 103 policy clause 663
enabling 101 revision clause 663
state clause 664, 673
Version 10 859
vault clause 662 hidden clause 543
add channel 613 icon clause 537
alt clause 614 introduced 535
command clause 614 margins clause 538
description clause 613 property clause 543
height clause 614 rule clause 537
href clause 614 size clause 539
icon clause 613 type clause 539
label clause 614 units clause 535
property clause 615 add format
setting clause 615 creator clause 382
add command description clause 381
alt clause 582 edit clause 382
code clause 583 icon clause 383
command clause 583 introduced 381
description clause 581 print clause 382
file clause 583 property clause 385
href clause 582 suffix clause 383
icon clause 582 type clause 382
introduced 581 version clause 384
label clause 582 view clause 382
property clause 584 add group
setting clause 583 assign clause 310
add cue assign role clause 310
active clause 808 child clause 309
appliesto clause 808 description clause 309
color clause 809 hidden clause 311
font clause 809 icon clause 309
hidden clause 810 introduced 308
highlight clause 809 parent clause 309
introduced 807 property clause 312
linestyle clause 809 site clause 311
order clause 809 add history 717
owner clause 810 add index
property clause 810 attribute clause 205
vault clause 809 field FIELD_VALUE 206
where clause 810 add inquiry
add filter argument clause 605
active clause 797 code clause 604
appliesto clause 797 description clause 603
hidden clause 800 file clause 605
owner clause 799 format clause 604
property clause 800 icon clause 603
where clause 799 introduced 603
add form pattern clause 603
color clause 537 property clause 605
description clause 536 add location
field clause 539 description clause 164
definition subclauses 540 FCS clause 168
type subclauses 540 hidden clause 169
footer clause 538 host clause 164
header clause 537 icon clause 165
Version 10 861
attribute subclause 493 propagate modify subclause 367
description subclause 493 revision subclause 364
duration subclause 494 type subclause 361
introduced 492 icon clause 360
priority subclause 494 introduced 357
rate subclause 495 property clause 369
trigger subclause 496 to
user subclause 493 cardinality subclause 362
wizard subclause 494 clone subclause 367
worklist subclause 495 introduced 360
xcoord subclause 495 meaning subclause 362
ycoord subclause 495 propagate connection subclause 368
introduced 491 propagate modify subclause 367
or clause 500 revision subclause 364
property clause 501 type subclause 361
start clause 500 add report
stop clause 501 description clause 515
subprocess clause 499 displayrule clause 519
trigger clause 502 field clause 519
add program definition subclauses 519
code clause 472 type subclauses 519
description clause 479 footer clause 517
downloadable clause 483 header clause 516
execute clause 480 hidden clause 528
external 479 icon clause 516
file clause 480 introduced 514
hidden clause 484 margins clause 518
icon clause 328, 480, 484, 537 property clause 528
introduced 472 size clause 516
java 479 units clause 514
mql 479 add resource
needsbusinessobject 482 description clause 573
property clause 484 file clause 573
rule clause 484 hidden clause 574
usesexternalinterface clause 483 icon clause 574
add property 551 introduced 573
add query mime clause 574
businessobject clause 756 property clause 574
expandtype clause 757 add role
introduced 755 assign clause 310
owner clause 757 child clause 309
vault clause 757 description clause 309
where clause 757 hidden clause 311
add relationship icon clause 309
attribute clause 357 parent clause 309
description clause 359 property clause 312
from site clause 311
cardinality subclause 362 add rule
clone subclause 367 description clause 391
introduced 360 icon clause 391
meaning subclause 362 introduced 391
propagate connection subclause 368 owner clause 393
Version 10 863
icon subclause 444 creating 307, 319
observer subclause 447 defining 315, 316
prologue subclause 442 definition 317
size subclause 441 deleting 320
status subclause 443 description 316
units subclause 440 hidden 318
widget subclause 444 icon 317
frame clause 439 modifying 319
hidden clause 439 name 316
icon clause 437 property 318
introduced 436 using AND 318
mql clause 437 using for notifications 315
needsbusinessobject clause 437 using for signatures 315
property clause 439 using multiple operators 318
add workflow using not equal 318
attribute clause 645 using OR 318
description clause 643 asynchronous replication 162
image clause 643 attribute
introduced 643 access 328
owner clause 645 assigning to object types 324
vault clause 645 assigning to relationships 324
ADK checking 334
session monitoring 115 comparing value of 787
setting history logging off 93 copying 335
ADK interfaces for tracing 108 default 326
administration access mask 289 defined 324
administration properties 550 defining 325
administration vault 125 deleting 337
administrative objects 59 description 327
adding 58 icon 327
comparing 245 in business object definition 665
copying 58 modifying 335
deleting 63 multiline 333
exporting 216 multiple ranges 330
importing 229 name 325
modifying 59 pattern comparison 329
printing 62 program range 331
administrative properties 89 property 333
administrative requirements 187 ranges 89
alias relational operator 328
adding 558 rule 328
introduced 556 sorting 672
modifying 558 trigger 332
server connect string 186 types 325
alternate text authenticating users 281
table column 838 autoheight
append clause form 540
file checkin 704 table column 838
application user 298 widget 448
approve businessobject 710 autowidth
association form 540
copying 319 table column 838
Version 10 865
policy 89 background 537
case sensitive match 89 foreground 537
casesensitive 85 form fields 540
certificate clause 293 frame 441
changename access 273 visual cue 809
changeowner access 273 widget 447
changepolicy access 273 columns
changetype access definitions in table 837
described 273 command
for relationship rule 393 adding 581
changevault alt 582
setting for the system 90 code 583
changevault access 273 command 583
channel copying 585
adding 613 defining 581
alt 614 deleting 587
command 614 description 581
copying 616 file 583
defining 613 href 582
deleting 618 icon 582
description 613 label 582
height 614 list 585
icon 613 modifying 585
label 614 name 581
modifying 616 property 584
name 613 setting 583
property 615 command line
ref 614 editing 37
setting 615 interface
check attribute 334 options 45
checkin wizard 461
with sync bus 177 using control characters 38
checkin access 271 comments
checkin businessobject 702 entering 50
checking in files 420, 702 syntax 50
append 704 using 55
override store 704 commit transaction 76
checking out files 702, 705 compare command
checkout examples 252
access 271 introduced 246
checkout businessobject 705 verbose mode 250
clauses comparing schema
defined 50 creating baseline 245
syntax 50 examples 252
clear all 55 getting more details 250
clear vault 55, 131 introduced 245
clearing databases 55 objects not included 246
clone reading the report 248
file handling 673 with baseline 246
clone rule 367 concatenating strings 760
cloning. See copying. connect businessobject 686
color connect statement
Version 10 867
date delete mail 640
current date/time 760 delete menu 599
modified 61 delete page 568
debugging 111 delete person 304
decimal settings for the system 92 delete policy 429
default icon 141 delete portal 626
defining delete process 509, 510
association 315, 316 delete program 488
attribute 325 delete property 552
channel 613 delete query 794
command 581 delete relationship 374
form 535 delete report 532
format 381 delete resource 577
group 308 delete rule 398
inquiry 603 delete server 193
location 163 delete set 749
menu 593 delete site 176
policy 404 delete store 159
portal 621 delete table 845
process 491 delete tip 823
program 472 delete toolset 831
query 755 delete type 211, 351
relationship 357 delete vault 134
report 514 delete view 857
role 308 delete widget 467
server 187 delete wizard 467
set 731 delete workflow 653
site 173 deleting
store 140 association 320
table 835 attributes 337
type 204, 342 business objects 683
vault 126 channel 618
workflow 643 command 587
definitions cues 814
creating 56 files 683
order for creating 56 filters 803
defragmenting database file 155 form 546
delegating access 676 format 388
delete 63 group 312
delete access 271 history 722
delete association 320 IconMail message 640
delete attribute 337 inquiry 609
delete businessobject 683 items 63
delete channel 618 location 172
delete command 587 menu 599
delete cue 814 pages 568
delete filter 803 person 304
delete form 546 policy 429
delete format 388 portal 626
delete history 722 process 509
delete inquiry 609 program 488
delete location 172 query 794
Version 10 869
lifecycle events supported 418, 502 type characteristics 341
override export
in policies 419 !icon clause 217
in processes 496, 499, 502 !mail clause 217
event viewer 103 !sets clause 217
exception file admin clause 216, 247
compare command 248 creating baseline 245
export command 219 exclude clause 218
exclude file into form clause 218
compare command 248 introduced 216
export command 218 onto form clause 218
execute access export businessobject
described 272 !file 221
for program rules 392 !history 221
execute workflow 498 !relationship 221
expand businessobject 690 !state 221
dump clause 699 introduced 220
from 691 export files, extracting information from 242
introduced 690 export workflow 223
limit clause 700 exporting
output clause 699 administrative objects 216
recordseparator clause 700 business objects 220
recurse to clause 695 excluding information 221
relationship clause 692 workflow 223
select clause 697 expression
select relationship 375 filters 265
set clause 696 expression access filter
tcl clause 700 on policy state 414
terse clause 700 on rules 393
to 691 expressions
type clause 692 arithmetic 759
expand set Boolean 764
activefilter clause 739 comparative 758
dump clause 740 complex Boolean 766
filter clause 739 evaluating 65
from 736 if-then-else 766
into|onto set clause 740 matchlist 763
introduced 736 on sets 746
limit clause 741 query 758
output clause 740 set relationships 736
recurse clause 739 smatchlist 763
relationship clause 736, 738 string concatenation 760
tcl clause 740 substring 767
terse clause 740 unexpected results 787
to 737 using const for exact equal 787
type clause 738 using dates 760
expanding extending transaction boundaries 76
business objects 690 external authentication 281
objects in sets 736 external programs 479
expandtype clause 757 extract 242
explicit extracting from export files 242
transactions 76
Version 10 871
for resource objects 578 fromdisconnect access
hidden 384 described 273
icon 383 for relationship rule 393
MIME type 384 fromset selectable for business objects 771
modifying 386 FTP
name 381 and locations 166
PDF 473 and stores 147
print 382 in add location statement 145, 165
property 385 full user, defining 298
suffix 383
type 382
version 384
G
view 382 grant access 273
frame granting access 676
color subclause 441 group
definition 432 assigning roles 310
epilogue subclause 443 assigning to a person 291
icon subclause 444 defining 308
modifying 465 deleting definition 312
observer subclause 447 hidden 333
prologue subclause 442 hierarchy 307, 309
sequence 453 lifecycle example 305
size subclause 441 modifying definition 312
skipping 442 multiple parents 308
status subclause 443 name 308
units subclause 440 reassigning workflow activity 506
widget guest user 286
autoheight subclause 448
autowidth subclause 448 H
color subclause 447
hashed filenames 142
drawborder subclause 448
hashing filenames
edit subclause 449
captured stores can use 137
font subclause 448
header
load subclause 446
form 537
multiline subclause 449
report 516
name subclause 445
help
password subclause 449
accessing 52
scroll subclause 449
with item commands 63
size subclause 448
help command 52, 63
start subclause 448
hidden
upload subclause 449
table column 838
validate subclause 446
hierarchy
value subclause 445
group 307, 309
widget subclause 444
role 307
freeze access
history
described 272
adding custom 717
for relationship rule 392
deleting 722
freeze connection 376
excluding 718
freezing relationship connections 376
printing 718
fromconnect access
select 718
described 273
setting for the system 93
for relationship rule 392
Version 10 873
modifying 606 record_sep clause 62
name 603 select clause 61
pattern 603 tcl clause 62
property 605 listing
instances of relationships 375 administrative objects 59
interactive mode 36 administrative types 60
internal object 768 business object fields 668
inventory store 155 command 585
cues 811
inquiry 606
J items 59
Java menu 596
tracing 105 property 552
java programs 479 store contents 155
system settings 94
K table 840
tips 821
-k command option 46
load program widget 446
keyword
local vault 127
defined 51
location
in expressions 787
access privileges 166
in queries 787
defined 162
in statements 51
defining 163
syntax 51
delete 172
deleting 172
L description 164
language FCS 168
page objects 569 hidden 169
resource objects 578 host 164
language alias icon 165
adding 558 password 166
defined 556 path 166
modifying 558 permission 166
properties 556 port 165
LCD property 169
doesn’t support external authentication using protocol 165
LDAP 280, 281 purge 172
in vault clause 64 url 167
LDAP authentication 281 user 167
cipher setting 284 lock access 272
encryption for passwords 285 lock businessobject 708
lifecycle 400 lockout, password 283
link data log file
for table 838 compare command 247
link transition conditions 507 export command 218
list 59 report for compare command 248
list admintype 60 long match 764
after date clause 62
dump clause 61 M
name pattern 60
macro
output clause 62
for object name 589
Version 10 875
modify person 301 widget subclauses 466
modify policy 423 modify workflow 650
introduced 423 modifyform access
signature subclauses 427 described 274
state subclauses 425 for form rules 393
modify portal 625 modifying
modify process 503 association definition 319
modify program 464, 486 attribute definition 335
modify property 552 business object definition 674
modify query 791 business object state 710
modify relationship 370 channel definition 616
from subclauses 371 command definition 585
introduced 370 connection attributes 376
to subclauses 371 databases 57
modify report 530 filter 801
modify resource 576 form definition 544
modify rule 395 format definition 386
modify server group definition 312
copy clause 195 inquiry definition 606
introduced 192 items 59
link clause 194 location definition 170, 175
master clause 194 menu definition 596
modify set 734 page object definition 567
modify statement 59 person definition 301
modify store policy definition 423
description 152 policy states 425
filename hashed 152 portal definition 625
host 152 process definition 503
icon 152 program definition 464, 486
introduced 152 query definition 791
lock 152 relationship connection ends 371
name 152 relationship definition 370
path 152 relationship instances 375
permission 152 report definition 530
unlock 152 resource object definition 576
modify table 841 role definition 312
modify tip 821 rule definition 395
clauses 822 server definition 192
introduced 821 set definition 734
modify toolset 829, 830 signature requirements 427, 710
modify type 209, 348 store 152
modify vault table definition 840
description 130 tip 821
hidden 130 toolset 829
icon 130 type definition 348
introduced 130 vault definitions 130
name 130 view 855
property 130 visual cue definition 811
modify view 855 widgets 466
modify wizard wizard frames 465
frame subclauses 465 workflow definition 650
introduced 464 monitor context command 117
Version 10 877
P comment 292
page copying 301
adding 563 deleting 304
defined 562 describing 292
deleting 568 disabling e-mail 294
description 564 disabling password 296
file 563, 564 enabling e-mail 293
hidden 565 enabling IconMail 294
icon 564 fax number 294
mime 565 full name 294
modifying 567 full user 298
name 563 hidden 295
property 565 icon 295
supporting different and formats 569 inactive 298
parentheses in where clause 758 modifying 301
password 90, 633 name 286
allow reuse 284 no password 296
allow username 284 passwordexpired 296
changing 632 phone number 297
cipher 284 property 297
context 631 site 297
disabling 296 system administrator 298
encrypting 285 trusted 298
expired 296 types 298
expires 283 vault 295
FTP 147 picas 440, 514, 535, 835
indicating none 296 plus operator 759, 760
lockout 283 points 440, 514, 535, 835
maximum size 283 policy
minimum size 283 access items 415
mixed alphanumeric 284 access precedence 268
system-wide settings 282 adding 404
widget 449 assigning access 413
password 54 case sensitive 89
pattern operator in attribute ranges 329 change object ownership 413
PDF files changing states 402
launching 473 changing store 157
performance checkins in state 420
improving 202 checkout history for state 421
index select 210 copying 423
setting history log off 93 default format 407
permission defined 400
owner, group, world 146, 166 defining 404
read, write, execute 146, 166 defining states 401
person deleting 429
adding 286 description 404
address 289 event triggers 418
application user 298 format 406
assigning groups and roles 289 general behavior 400
business administrator 298 hidden 422
certificate 293 icon 405
icon for state 420
Version 10 879
description 493 type 479
duration 494 uploading and downloading files 458
introduced 492 usesexternalinterface 483
priority 494 program environment
rate 495 variables 451
trigger 496 prologue for frame 442
user 493 promote access 272
wizard 494 promote businessobject 714
worklist 495 promotion
xcoord 495 notification 412
ycoord 495 of state 411
modifying 503 signature 417
or 500 tested in state 420
property 501 properties
start 500 administration 89
stop 501 importing 234
subprocess 499 inherited 341
trigger 502 property
trouble creating 510 adding 551
validating 510 listing 552
processing scripts 56 modifying 552
program selecting 553
action example 473 protocol
adding 472 ftp 145, 165
check example 475 nfs 145, 165
code 472 protocol clause
copying 486 location 165
defined 470 protocol command
defining 472 store 145
deleting 488 public access
description 479 assigning in policy 413
downloadable 483 defined 264
execute 480 policy 401
external 479 purge location 172
file containing code 480 purge store 159
for execution as needed 477
format definition example 473
hidden 484
Q
icon 328, 480, 484, 537 -q command option 45
invoking a wizard from 462 query
java 479 adding 755
macros 435 arithmetic expressions 759
methods 435 average 775
modifying 464, 486 Boolean expressions 764
MQL 479 Boolean operators 765
need for business object 482 business objects 756
observer in wizards 447 comparative expressions 758
piped option 483 complex Boolean expressions 766
property 484 correlation 776
range values 331 count 774
rule 484 date/time 786
table column 838 defined 752
Version 10 881
printing connections 376 revise
thawing connections 376 file handling 681
remote vault 127 revise access 272
renumbering IconMail messages 640 revise businessobject 680
replicate revision/clone rule 366 revision designator for business object 658
replicating captured stores 162 revision macro 589
report revision rule
adding 514 assigning to relationship 364
compare command 248 float 364
copying 530 none 364
defined 512 replicate 364
defining 514 revision sequence 407
defining appearance 522 revisionable, state 402
deleting 532 revisions
description 515 allowed in state 419
design 513 business object 680
dividing rule 519 migrating 244
evaluating 529 revoke access 273
field definition 519 revoking access 677
field label 525 RMI
field types 519 memory statistics 119
fields 519 role
footer 517 assigning to a person 290
header 516 defining 308
hidden 528 deleting definition 312
icon 516 hierarchy 307
layout 513 modifying definition 312
margins 518 multiple parents 308
modifying 530 name 308
name 514 property 312
property 528 RPE
size 516 introduction 434
units 514 rule
reserved words in queries 787 access precedence 268, 391
resource adding 391
adding 573 cloning 395
copying 575 copying 395
defined 572 deleting 398
deleting 577 description 391
description 573 hidden 392
file 573 icon 391
hidden 574 introduced 265
icon 574 modifying 395
MIME type 574 name 391
modifying 576 owner access 393
name 573 property 392
property 574 public access 393
supporting different and formats 578 user access 393
resuming workflow 647 run statement 54
retrieving running scripts 54
business object image 662
workflow image 644
Version 10 883
minimum 747 unsign 712
modifying 734 signatures 89
name 731 single quotes
pagination 743 using with double quotes 777
printing 742 Single Signon 281
property 732 site
relationship expressions 736 defined 162
saving expansion information 739 defining 173
saving query results as 792 deleting 176
selecting fields to print 742 description 173
sorting 745 hidden 174
standard deviation 747 icon 173
START_RANGE 743 member 174
sum 746 property 174
terse clause 740 Siteminder 281
viewing definition 742 size
vs. connection 730 form 539
set checkshowaccess 276 frame 441
set context 631 report 516
set password table column 838
allowreuse clause 284 widget 448
allowusername clause 284 smatchlist comparison 763
cipher clause 284 sort
expires clause 283 table column 838
lockout clause 283 sort set command 745
maxsize clause 283 sorted sets 745
minsize clause 283 spaces in strings 454
mixedalphanumeric clause 284 special characters in Tk 41
set system 85 splash screen, suppressing on startup 46
casesensitive 85 SQL tracing 105
set transaction 76 standard deviation
set workspace 854 on a query 775
setting on a set 747
table column 838 start subclause for widget 448
setting the workspace 322 start transaction 76
shell command startup options 45
described 54 state
show access changing 402
described 274 checkout history 421
more about 275 defining 401
setting the global flag 276 file checkin allowed 420
signature icon 420
approve 417, 710 modifying 425
defining with associations 315 modifying signature requirements 427
finding date of 720 name 410
ignore 417, 711 number required 401
introduced 417 policy 401
modifying 427 promotion 411
modifying requirements 710 reassigning ownership 413
override requirement 713 revisionable 402
promotion 417 revisions allowed 419
reject 417, 711 scheduled date in business object
Version 10 885
column edit 838 tidy store 155
column height 838 tidy vault 132
column hidden 838 time 760
column href 838 tip
column minsize 838 active 817
column order 838 applies to 817
column program 838 copying 821
column range 838 deleting 823
column scale 838 expression clause 819
column setting 838 hidden 819
column size 838 list 821
column sorttype 838 modifying definition 821
column update 838 name 817
column user access 838 order 819
column width 838 owner 819
columns 837 property 820
copying 840 query expressions 819
defining 835 where clause 819
deleting 845 Tk 41
description 836 toconnect access
hidden 839 described 273
icon 837 for relationship rule 392
list 840 todisconnect access
modifying 840 described 274
name 835 for relationship rule 393
printing 846 Tool command language 39
property 839 toolset
units 835 active 827
tablespace copying 829
data 128, 148 deleting 831
index 128 hidden 827
naming 128, 148 modifying definition 829
Tcl name 827
and escape characters 779 property 827
clause 69 toset selectable for business objects 771
clause used in expand command 700 tracing 105
clause used in expand set command 740 ADK call parameters 116
clause used in list admintype command 62 ADK interfaces 108
clause used in print command 60, 671 all-session vs. single session 105
clause used in print set command 744 and debugging 111
command syntax 41 Context.printTrace() 114
format for select output 69 Context.setTrace() 114
mode 39 MQL 107
special characters 41 with MatrixLogWriter 113
tracing 105, 113 with Tcl 113
temporary query 753 tracked
thaw access file 138
described 272 store 137
for relationship rule 393 transaction
thaw connection 376 control 76
tidy explicit 76
system setting 94 implicit 76
Version 10 887
local 127 query expressions 810
map 129 vault 809
map file name 128 where clause 810
modifying 130 visuals
name 126 copying 321
print 133 deleting 322
property 129
remote 127
server 128
W
tidy 132 Web
types 125, 127 consideration for designing forms 539, 541
validating 96 web form 535
working with 124 where clause
verbose on business objects 697
compare command 250 on cues 810
mode 46 on queries 757
verbose on tips 819
introduced 54 recommendations 758
version 54 using parentheses 758
versionable, state 402 widget
view autoheight 448
active 855 autowidth 448
copying definition 853 color 447
deleting 857 complex 454
hidden 851 definition 433
modifying definition 855 drawborder 448
name 851 edit 449
property 851 font 448
viewform access load 446
described 274 modifying 466
for form rules 392 multiline 449
viewing name 445
business object definition 667 password 449
current users 100 position 448
set definition 742 scroll 449
visual cue size 448
active 808 upload 449
adding 807 validate 446
applies to 808 value 445
color 809 wildcard
copying 811 in queries 783
deleting 814 wizard
font 809 adding 436
hidden 810 and appl dialogs 462
highlight color 809 code 436
line style 809 colors in frame 441
listing 811 command line interface 461
modifying 811 copying 464
name 807 creating 436
order 809 definition 432
owner 810 deleting 467
property 810 description 437
Version 10 889
890 MQL Guide