MQL For Matrix Users
Prerequisites
The trainee should:
Have knowledge about Matrix basics
Have knowledge about the usage of MQL
Have knowledge about business admin
objects of Matrix
Recap
Recap of Day 1
Learnt about Matrix fundamentals
What are business objects?
What are admin objects?
What are the responsibilities of Business Administrator?
What are the responsibilities of System Administrator?
Various properties of a business object
About vaults & stores
Intro to MQL
How to do MQL window settings and preferences
Three types are MQL command execution
Working with Context
General syntax of MQL commands
Recap
Recap of Day 2
Learnt about Matrix Admin Objects
About system-wide password settings
About how to create business definitions like
attributes, types, relationships, policies, formats,
rules using MQL commands
Created the scripts for creating the admin objects
Learnt about Business Modeling
About business modeling
Case study - Project Management System
Done business modeling during the case study and
created MQL scripts
MQL For Matrix Users
Matrix Users
MQL can be used by normal users for doing
database operations
He/She can use MQL in Matrix to
create/update/delete the data
The user should have the following privileges:
He/She should be atleast an Application User to use
MQL
He/She should be a Active user
He/She should be have appropriate access privileges
defined in Person/Policy definition to do the desired
operation
Each and every action of the user is recorded in the
business object history
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 objects Type, Name &
Revision (User should have show access)
Reading is opening the business object for
reading its various properties (User should have
Read access)
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, ChangeName,
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)
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)
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
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 Vault
If the vault name is not given, the system shows
all the objects from the users current vault
MQL For Matrix Users
Searching/ Viewing...
Using Queries (Stored)
Syntax:
MQL <#> add query NAME bus TYPE NAME
REVISION vault VAULT_NAME owner
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
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 which are owned by the
person creator
MQL For Matrix Users
Searching/ Viewing...
Using Queries (Temporary)
Syntax:
MQL <#> temp query bus TYPE NAME REVISION
vault VAULT_NAME owner OWNER_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
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, 2004" 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
MQL For Matrix Users
Working with Business Objects
Creating a new business object
MQL <#> add bus TYPE NAME REVISION vault
VAULT_NAME policy POLICY_NAME
attribute[1,2,...] attribute[1,2,..]value;
Example:
MQL <12> add bus Person Neo
vault HCC Vault
policy Person
description This is for the person Neo
Handphone Number 01020110
Location Singapore;
MQL For Matrix Users
Working with Business Objects
Creating a revision of business object
MQL <#> revise bus TYPE NAME REVISION to
REVISION description [DESCRIPTION]
attribute[1,2,3...] attribute[1,2,3...]value;
Example:
MQL <2> revise bus Part PI-00120 A to B
description New Revision UOM MM;
The above command will revise the Part from A
to B and sets the new description and the
attribute UOM value is set to MM.
MQL For Matrix Users
Working with Business Objects
Creating a clone of business object
MQL <#> copy bus TYPE NAME REVISION to
NEWNAME NEWREVISION description
[DESCRIPTION] attribute[1,2,3..]
attribute[1,2,3..]value;
Example:
MQL <23> copy bus Person Neo A to Neo1 A
description New Clone City Singapore;
The above command creates a new clone and
sets up description as New Clone and City
as Singapore.
MQL For Matrix Users
Working with Business Objects
Updating business object basics/attributes
MQL <#> modify bus TYPE NAME REVISION
description NEW_DESCRIPTION vault
NEW_VAULT policy NEW_POLICY
attribute[1,2,3..] attribute[1,2,3..]value;
Example:
MQL <2> mod bus Person Neo A description This
is for person Neo City Singapore;
The above statement will modify the business
object Neo with the new description and city.
The user should have modify access.
MQL For Matrix Users
Working with Business Objects
Promoting/ Demoting Business Objects
Promoting without signatures
MQL <#> promote bus TYPE NAME REVISION;
Promoting with signatures
MQL <#> approve bus TYPE NAME REVISION
signature SIGNATURENAME comment COMMENT;
MQL <#> promote bus TYPE NAME REVISION;
Demoting a business object
MQL <#> demote bus TYPE NAME REVISION;
Rejecting a business object signature
MQL <#> reject bus TYPE NAME REVISION comment
COMMENT;
MQL For Matrix Users
Working with Business Objects
Promoting/ Demoting Business Objects
Unsigning a business object signature
MQL <#> unsign bus TYPE NAME REVISION signature
SIGNATURE_NAME comment COMMENT;
Ignoring a business object signature
MQL <#> ignore bus TYPE NAME REVISION signature
SIGNATURE_NAME comment COMMENT;
MQL For Matrix Users
Working with Business Objects
Connecting / Disconnecting Business
Objects
Connecting business objects
MQL <#> connect bus TYPE1 NAME1 REVISION1
[to/from] TYPE2 NAME2 REVISION2 relationship
[REL_NAME] attribute[1,2,3...] attribute[1,2,3..]value;
The user should have toconnect or fromconnect access
based on the direction of the relationship
Disconnecting business objects
MQL <#> disconnect bus TYPE1 NAME1 REVISION1
[to/from] TYPE2 NAME2 REVISION2 relationship
[REL_NAME];
The user should have todisconnect or fromdisconnect
access based on the direction of the relationship
MQL For Matrix Users
Working with Business Objects
Checking in/ Checking out files
Checking in a file
MQL <#> checkin bus TYPE NAME REVISION [unlock]
format FORMATNAME [append] FILENAME;
Checking out a file
MQL <#> checkout bus TYPE NAME REVISION [lock]
format FORMATNAME file FILENAME
DIRECTORYNAME;
Example:
MQL <3> checkin bus Person Neo format generic
append c:\Resume.doc;
MQL <4> checkout bus Person Neo format generic
file Resume.doc e:\resumes;
MQL For Matrix Users
Working with Business Objects
Locking/ Unlocking business objects
MQL <#> lock bus TYPE NAME REVISION;
Locking can be done if the user has lock access. This is
to avoid other users to update the object when one
user works on it.
Locking is useful when it is done during file checkout
MQL <#> unlock bus TYPE NAME REVISION;
A locked business object can only be unlocked by the
locker
MQL For Matrix Users
Working with Business Objects
Granting/ Revoking business objects
MQL <#> modify bus TYPE NAME REVISION
grant USERNAME/GROUPNAME/ROLENAME
access ACCESS_MASK key KEYNAME;
A business object can be granted to a individual user
or for a role/group
A key name can be given to each grant to identify it
during revoke
MQL <#> modify bus TYPE NAME REVISION
revoke USERNAME/GROUPNAME/ROLENAME
access ACCESS_MASK;
MQL <#> modify bus TYPE NAME REVISION
revoke key KEYNAME;
MQL For Matrix Users
Working with Business Objects
Granting/ Revoking business objects
Example:
MQL <12> mod bus Project Jaguar 1 grant
guest" access read, modify, show key Test;
The above command gives read, show and modify
access to the user creator for the business object
Neo and keys the grant under the name Test
MQL <23> mod bus Person Neo A revoke key
Test;
Above command revokes the grant name Test
from the user guest
MQL For Matrix Users
Working with Business Objects
Executing a business object method
MQL <#> execute bus TYPE NAME REVISION method
METHODNAME;
The above command used to execute a object method
Methods are defined in the business type
The user should have execute privilege to perform
this operation
MQL <2> execute bus Person Neo method
CalculateSalary Jun 2004;
The method CalculateSalary can be a TCL or Java method
defined in the business modeler
The method can have arguments
The values are passed one by one to the method from
the command line
MQL For Matrix Users
Working with Business Objects
Deleting a business object
MQL <#> delete bus TYPE NAME REVISION;
The user should have delete access to do this
operation
When an object is deleted all its connections will be
automatically broken
Example:
MQL <23> delete bus Person Neo -;
The above command completely deletes the business
object Neo from the database
MQL For Matrix Users
Working with Business Objects
Printing a business object
MQL <#> print bus TYPE NAME REVISION select vault
policy owner originated created format relationship
attribute[1,2,3..] output OUTPUTFILENAME;
The user should have read access to the business object
Example:
MQL <2> print bus Person Neo select policy vault
originated modified format[generic].file
relationship[Employee] attribute[City] dump |;
MQL <3> print bus Person Neo select current dump |
output c:/Neo.txt:
MQL For Matrix Users
Working with Business Objects
Expanding a business object
MQL <#> expand bus TYPE NAME REVISION
relationship RELATIONSHIPNAME select
SELETABLES;
Example:
MQL <12> expand bus Person Neo relationship
Employee select relationship id bus id;
MQL <12> expand bus Person Neo relationship
Employee select relationship attribute[Role] bus
attribute[Department];
MQL For Matrix Users
Working with Transactions
Matrix has two kinds of transactions:
Implicit transactions
This is the default transaction mode
maintained by Matrix
Transaction is committed with each and every
statement
Explicit transactions
This is set by the user explicitly
The user can commit this transaction after
making desired updations to the database
MQL For Matrix Users
Working with Transactions
Setting explicit transactions:
To start a new transaction:
MQL <#> start transaction;
To end a transaction:
MQL <#> commit transaction;
To abort a transaction:
MQL <#> abort transaction;
To print the current status of a transaction:
MQL <#> print transaction;
MQL For Matrix Users
Working with IconMail
Matrix has a in-built emailing system called
iconmail
Every matrix user has a iconmail inbox if they
have icon mail option enabled in their user
definition
A business object can be attached and sent to the
user using iconmail
Following is the syntax to send a email:
MQL <#> send mail bus TYPE NAME REVISION to
USER cc USER subject SUBJECT text CONTENT;
Where, TYPE NAME REVISION are the business object
that need to be sent in the email
Thank you.