Documente Academic
Documente Profesional
Documente Cultură
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL – Matrix Query Language
Sudheer PS
Aug 28, 2012
2
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Agenda
1 Introduction to MQL
3
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction: Prerequisites
4
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
What is MQL?
• MQL is Matrix Query Language
• MQL consists of set of statements that help the administrator to set up and test a Matrix
database
• Can be used to add/extract information from a Matrix database
• MQL supports scripting
• You can write MQL Scripts and run them in batch mode
5
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
MQL Modes
There are three modes in which an MQL statement can be executed:
• Interactive Mode
• Script Mode
• Tool Command Language Mode (TCL)
6
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
Interactive Mode
• One statement at a time is entered in the MQL command line interface
• Useful only when you have few MQL commands to be executed
– Can be used to inspect the database
– Can be used for any small database operations like creating a single user, changing a single
object data
7
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
Script Mode
• A series of MQL statements are executed
• The statements are contained in a external file called ‘script’ file.
• This script file is accessed from the MQL command line
• The interface reads the file, line by line, and processes the statements
8
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
Tcl/Tk Mode
• TCL is a universal scripting language
• A TCL interpreter is in-built in MQL Application
• TCL has common programming features like:
– Variable declarations
– Flow control
– Condition testing
– Procedures
• Tk is toolkit used for building the UI for TCL/Tk
• TCL is a interpreter available in various platforms (Unix, Windows & Mac)
• Having MQL Commands embedded with TCL Scripts, it helps the developers for:
– Rapid development
– Platform independence
– Integration support
– User convenience
9
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
Accessing MQL
• The following are the different ways to launch MQL in your system:
– Launch by using the start menu MQL Icon
– Launch by clicking the MQL application from Matrix installed directory
– Launch from run window (Windows key + R)
• If you are working on Unix platform:
– Got to the Matrix installed directory and type:
– ./mql.sh
10
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
Accessing MQL
MQL Prompt:
Menu
Executed
Statements
Command
Line
11
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
Using MQL
Using MQL window:
• Do not use ‘clear all’. This will empty your database..!!!!
• Changing the background color, font color can be done using the preferences menu
• Use and to get the previously used MQL commands
MQL Command Line options
The following are the options you can use in the MQL Command Line:
• -b <FILENAME>
– FILENAME is the bootstrap file name using which this MQL session need to be s
tarted
• -c “command1;command2”
– command1, command2 are the MQL statements
• -d
– Suppresses the MQL window
12
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
13
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
14
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
15
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
16
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
17
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
18
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
19
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
20
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
21
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
22
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
General Syntax
Setting up the context
• The first step to be done in the MQL prompt is setting up your context
• The following is the command used to set the context:
– MQL <#> set context user <USERNAME> password <PWD> vault <VAULTNAM
E>;
– USERNAME is the user’s identification in the Matrix database
– PASSWORD is the user’s secret word used for authentication
– VAULTNAME is the name of the vault to which the user is currently logging i
n
23
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
General Syntax
Pushing/popping the context:
• The context once set can be pushed to another context (context inside a context)
• The following is the statement used:
– MQL <#> push context user <USERNAME> password <PWD> vault <VAULTNA
ME>;
– This technique is widely used in trigger programs to do some operations as a sup
er user mode
• The following is the statement used to pop the context:
– MQL <#> pop context;
24
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
General Syntax
More on Pushing/popping the context
Context 1
Context 2
Context 3
25
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
General Syntax
Add statement
• To add any business definition to the Matrix database, use the following statement:
– MQL <#> add ITEM ITEM_NAME <keyword value>;
– Where ITEM is:
26
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
General Syntax
Modify statement
• To modify any business definition to the Matrix database, use the following statement:
– MQL <#> modify ITEM ITEM_NAME <keyword value>;
– Where ITEM is:
27
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
General Syntax
List statement
• To get a list of any business definition from the Matrix database, use the following stat
ement:
– MQL <#> list ITEM ITEM_NAME;
– Where ITEM is:
28
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
General Syntax
More on List statement
– MQL <#> list ITEM ITEM_NAME [modified after DATE | NAME_PATTERN] select
[SELECTABLE] dump [RECORDSEP] tcl output [FILENAME];
– Eg.:
MQL <2> list attribute U* select name description type dump |;
The above command will return all the attributes which has name starts with ‘U’ a
nd selects their name, description, type and prints the result on the screen as a p
ipe delimited string.
MQL <3> list attribute modified after “May 10, 2004” U* select name;
29
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
General Syntax
Print statement
• To get information about one specific item, the print statement is used
• The following is the syntax:
– MQL <#> print ITEM ITEM_NAME;
– Where ITEM is:
30
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
General Syntax
Delete statement
• To delete a business definition from the Matrix database this statement is used
• When delete an item its association to other items are automatically broken
• The following is the syntax:
– MQL <#> delete ITEM ITEM_NAME;
– Where ITEM is:
31
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
General Syntax
Usage of ‘tcl’ clause
• The ‘tcl’ clause can be used in the following MQL statements:
– print
– list
– expand
– temp query
• The advantage of using the ‘tcl’ clause is the result will be returned in the tcl list format
• The result would be flexible to do string parsing
• This can be used when you write MQL statements embedded inside a TCL program
32
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
General Syntax
Usage of ‘tcl’ clause...
• The following example illustrates the usage of tcl clause:
– MQL <2> print type Part select name description dump;
– The result without ‘tcl’ clause for this query would be:
– Part,an inventoried item that may be made up of other items
– The result with ‘tcl’ clause for this query would be:
– {{{Part}} {{an inventoried item that may be made up of other items}}}
33
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
Case Sensitivity
•MQL is NOT case sensitive relative to commands and keywords.
• The following statements are equivalent:
– VERBOSE ON;
– verbose on;
•MQL IS case sensitive relative to business object names.
• The following statements are NOT equivalent
– add vault Engineering;
– add vault engineering;
34
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Introduction to MQL
Exercise...
• Launching MQL
• Changing the font color, background color
• Changing the font settings
• Use all command line options
• Use Help command
• Use quit command
• Use list statement
• Use print statement
• Find out which is the default context and try to setup new context as ‘creator’
35
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
36
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
Business Administration
• MQL is used to do business administration of a Matrix database
• Business administration involves the following activities:
– Creating new business definitions
– Modifying the existing business definitions if there is a change in business requirement
– Deleting the existing business definitions when they become obsolete
• Business administration can be done using the Matrix Business Modeler also
• MQL supports all the features of Business Modeler in a query language format
37
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
Business Administration
• The user ‘creator’ is the super user in the system
• He is both system and business admin
• The system admin access overrides all the other access control setup
• The user ‘guest’ is a normal user
• To do business administration the user must be defined as a ‘Business Admin’ in busines
s modeler
• The user ‘creator’ can create new users and make new business/system administrators
38
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
Business Administration
39
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
Access Control
• The following are the admin objects in Matrix that control access:
– Person
– User Categories (Groups & Roles)
– Policies
– Rules
• Apart from these four admin objects, the user can get access to a business object as a ‘
Grantee’
40
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
41
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
42
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
43
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
• Roles: A collection of people who have a common job type: Engineer, Supervisor, Purch
asing Agent, Forms Adjuster, and so on.
44
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
45
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
46
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
47
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
48
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
49
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
50
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
51
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
52
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
53
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
54
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
55
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
56
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
57
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
58
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
59
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
60
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
61
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
62
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
63
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
64
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
65
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
66
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
67
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
68
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
69
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
70
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
71
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
72
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
73
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
74
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
75
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
Case Study
• Build a Project Management System
– Able to manage Projects with the following information:
• Name, Start Date, End Date, Project Manager, Project Members, Description,
Revision
• Life cycle:
– Create, Design, Build, Implement, Review, Archive
• Task Management
– Start Date, End Date, Percentage Completion
– Create, Assigned, WIP, Completed
• Project Document
– Reviewer Name, Comments
– Create, Review, Release
• Roles: Project Manager, Project Member, Project Reviewer
76
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
Case Study
Task
Project
Has Tasks -Start Date : Date
-Start Date : Date -End Date : Date
-End Date : Date -Percentage Completion : Integer
1 *
1
Has Member 1
Has Documents
*
*
Project Document
Person -Reviewer Name : String
-Handphone Number : Integer -Comments : String
-Location : String
77
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Business Admin
Case Study
• Policy creation
– Project
• Create, Design, Build, Implement, Review, Archive
– Task
• Create, Assigned, WIP, Completed
– Project Document
• Create, Review, Release
– Person
• Active, InActive
78
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL for Matrix Users
79
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
Matrix Users
• MQL can be used by normal users for doing database operations
• We can use MQL in Matrix to create/update/delete the data
• The user should have the following privileges:
– User should be atleast an ‘Application User’ to use MQL
– User should be a ‘Active’ user
– User should be have appropriate access privileges defined in Person/Policy definition to do t
he desired operation
• Each and every action of the user is recorded in the business object history
80
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
Matrix Users
• The operations of a Matrix users can be broadly classified as follows:
– Searching/Viewing/Reading business objects
– Creating/Updating/Deleting business objects
• About Searching/Viewing/Reading:
– Searching is done using a Query (User should have access to Matrix database using MQL)
– Viewing is finding out the object’s Type, Name & Revision (User should have ‘show’ access)
– Reading is opening the business object for reading its various properties (User should have ‘
Read’ access)
81
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
Matrix Users
About Creating/Updating/Deleting business objects
– Creating can be one of the following:
– Creating a new business object (Create access)
– Creating a revision of a business object (Revise access)
– Creating a clone of a business object (Clone access)
– Updating can be one of the following:
– Changing the object basics (ChangePolicy, ChangeVault, ChangeType, Change
Name, ChangeOwner)
– Changing the object attributes (ModifyAttribute, ModifyDescription)
– Changing the object state (Promote, Demote, Approve, Reject)
– Checking in/ deleting files (Checkin, Checkout)
– Connecting/Disconnecting objects with each other (Connect, Disconnect)
82
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
Matrix Users
About Creating/Updating/Deleting business objects
– Updating can be one of the following:
– Locking/ Unlocking the business object (Lock, Unlock access)
– Granting/ Revoking a business object to other users (Grant, Revoke access)
– Executing a method of the business object (Execute access)
– Deleting can be one of the following:
– Deleting a business object completely from the database (Delete access)
83
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
Searching/ Viewing
Searching a business object
• Using list statement
• Using Queries
– Stored Queries
– Temporary Queries
• A business object can be found out by a person only if he has ‘show’ access
• Matrix keeps the history of the previously searched patterns
• Result of a query is returned as a String
• This result can be parsed using TCL
84
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
Searching/ Viewing...
Using List statement
• Syntax:
– MQL <#> list bus [vault VAULT_NAME];
• Example:
– MQL <1> list bus vault “HCC Vault”;
– The above command will give a list of all the objects from the vault “HCC V
ault”
– If the vault name is not given, the system shows all the objects from the us
ers current vault
85
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
Searching/ Viewing...
Using Queries (Stored)
• Syntax:
– MQL <#> add query NAME bus TYPE NAME REVISION vault VAULT_NAME o
wner OWNER_NAME where ‘[WHERE EXPRESSION]’;
– TYPE – Object type name (Wildcard supported)
– NAME – Object name (Wildcard supported)
– REVISION – Object revision (Wildcard supported)
– VAULT_NAME – Name of the vault to search the object
– OWNER_NAME – Name of the object owner
– The stored queries are user specific
– Use ‘list’ statement to find out the stored queries in your context
86
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
Searching/ Viewing...
Using Queries (Stored)
• Example:
– MQL <1> add query PersonQuery bus Person * * owner “crea*" vault “HCC Vault
";
– The above query can be executed anytime using the statement:
– MQL <2> evaluate query PersonQuery;
– The above query will return all the Person objects from the ‘HCC Vault’ whi
ch are owned by the person ‘creator’
87
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
Searching/ Viewing...
Using Queries (Temporary)
• Syntax:
– MQL <#> temp query bus TYPE NAME REVISION vault VAULT_NAME owner O
WNER_NAME where ‘[WHERE EXPRESSION]’ select [SELECTABLES];
– TYPE – Object type name (Wildcard supported)
– NAME – Object name (Wildcard supported)
– REVISION – Object revision (Wildcard supported)
– VAULT_NAME – Name of the vault to search the object
– OWNER_NAME – Name of the object owner
– The temporary queries temporary to the current MQL session of the user
– The query will not be available if the user re login
– The temp query has a ‘where’ clause and a ‘select’ clause
88
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
Searching/ Viewing...
Using Queries (Temporary) – Example
• MQL <1> temp query bus Person * * owner “crea*" vault “HCC Vault" where 'originated<"Jan 01, 200
4"‘ select id dump |;
– The above query will return all the Person business objects from the ‘HCC Vault’ which
are created after ‘Jan 01, 2004’ and owned by the user ‘creator’
– Also the statement selects the id of the business object
– The ‘dump’ keyword is used to dump the result in one line
• #search for computers having the Color attribute value as ‘Black’
• temp query bus Computer * * vault ComputerVault limit 10 where 'attribute[Color] == “Black“ ‘ sele
ct dump |;
• # search for computers having more than one harddisk
• temp query bus Computer * * where 'from[ComputerTOHarddisk].attribute[Quantity] > 1‘ select du
mp |;
• # search for computers having monitors of Type ‘flatron’
• temp query bus Computer * * where 'from[ComputerTOMonitor].to.attribute[Type] == "flatron"‘ sele
ct dump;
89
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
90
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
91
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
92
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
93
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
94
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
95
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
97
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
98
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
99
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
100
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
101
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
102
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
103
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
104
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
105
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
106
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
107
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For Matrix Users
108
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
109
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
System Administration
• System administrators can use MQL for maintaining the Matrix database
• Following are the various maintenance operations:
– Maintaining Vaults
– Maintaining Stores
– Maintaining Locations
– Maintaining Sites
110
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
System Administration
• Working with Vaults
– Creating a Vault:
• MQL <#> add vault VAULTNAME description “VAULT DESCRIPTION” indexsp
ace “TABLESPACE1” tablespace “TABLESPACE2”;
– Clearing a Vault:
• MQL <#> clear vault VAULTNAME;
– This statement will clear the vault. Do not use this statement when the use
rs are online.
111
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
System Administration
• Working with Vaults
– Maintaining a Vault:
• MQL <#> tidy vault VALUENAME commit N;
– As objects are deleted from a vault, storage gaps will occur in the vault dat
abase file
– These gaps represent wasted disk space and can cause an increase in ac
cess time
– MQL provides the tidy vault statement to fix fragmentations in the databas
e file of the vault
– 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.
112
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
System Administration
• Working with Stores
– Creating a Store:
• MQL <#> add store STORENAME description “STORE DESCRIPTION” fcs FC
S_URL type [ingested|captured|tracked] filename [!hashed] path “PATHNAME”
host “HOSTIPADDRESS” protocol “[ftp|file]” port “FTP_PORT” user “FTPUSER
NAME” password “FTPPASSWORD”;
– Adding Locations to a Store:
• MQL <#> modify store STORENAME add location LOCATION_NAME;
– This statement adds the given location to the Store
– Adding locations to the store is needed to setup the File Collaboration Serv
er
113
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
System Administration
• Working with Stores
– Maintaining a Store:
• MQL <#> tidy store STORE_NAME;
– This statement is used for maintaining a ‘ingested’ store
• MQL <#> inventory store STORE_NAME;
– This statement is used for maintaining a ‘tracked’ store
• MQL <#> rehash store STORE_NAME;
– This statement is used to rehash a store when it is changed as ‘hashed’
114
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
System Administration
• Working with Locations
– Locations are used for Store replication to improve the performance of file service t
o the user from Matrix
– Creating a Location:
• MQL <#> add location LOCATIONNAME description “LOCATION DESCRIPTI
ON” fcs FCS_URL path “PATHNAME” host “HOSTIPADDRESS” protocol “[ftp|fi
le]” port “FTP_PORT” user “FTPUSERNAME” password “FTPPASSWORD”;
– Locations are associated to the Store and a Site during the FCS setup
115
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
System Administration
• Working with Sites
– Sites are representing a set of locations
– Sites can be associated to the users to represent their work place
– Following is the syntax to create a Site:
• MQL <#> add site SITE_NAME description “SITE DESCRIPTION” member loc
ation LOCATION_NAME;
116
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
System Administration
• Working with Import/Exports
– Both admin and business objects can be exported
– Exporting the database from one place and importing fully to another is possible
– Importing hierarchy is very important as there is lot of interdependencies between t
he objects
– Attached files also can be exported along with the business objects and written into
the same export files
– Or the stores can be separately migrated to a new location
117
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
System Administration
• Working with Import/Exports
– MQL <#> export ADMIN_TYPE * [xml] into|onto
file “EXPORT_FILENAME”
exclude “EXCLUDE_FILENAME”
log “LOG_FILENAME”
exception “EXCEPTION_FILE”;
Where,
ADMIN_TYPE is:
admin, attribute, type, format, group, location, person, policy, program, relatio
nship, role, site, store, vault.
Wildcard patterns can be used.
118
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
System Administration
• Working with Import/Exports
– MQL <#> export bus * * * [xml]
from vault VAULT_NAME into|onto
file “EXPORT_FILENAME”
exclude “EXCLUDE_FILENAME”
log “LOG_FILENAME”
exception “EXCEPTION_FILE”
!file !relationship !history !state !icon;
119
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
System Administration
• Working with Import/Exports
– MQL <#> import ADMIN_TYPE * from
file “EXPORT_FILENAME”
use exclude “EXCLUDE_FILENAME”
use log “LOG_FILENAME”
use exception “EXCEPTION_FILE”
[overwrite] [continue];
Where,
ADMIN_TYPE is:
admin, attribute, type, format, group, location, person, policy, program, relatio
nship, role, site, store, vault.
Wildcard patterns can be used.
120
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
MQL For System Admin
System Administration
• Working with Import/Exports
– MQL <#> import bus * * * to vault VAULT_NAME from file “EXPO
RT_FILENAME”
use exclude “EXCLUDE_FILENAME”
use log “LOG_FILENAME”
use exception “EXCEPTION_FILE”
!file !relationship !history !state !icon;
- Before importing, it is advisable to switch off the triggers if there are any ‘create’ trigg
ers for the importing business object.
MQL <#> trigger off|on;
121
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.
Q&A
Q&A
122
© Xchanging 2008, no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging.