User Level
Business Administrator
User LevelBusiness Administrator SyntaxThe command uses this syntax.
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 to distinguish them. Custom history entries do not respond to the Enable and Disable HistoryHistory 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 command.
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. When history is set to off, modification dates continue to be updated if the
business object is modified, including when using the To enable history recording for the session again, a System Administrator should use:
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:
When the recording of history is turned off in a program object, it is important that it gets turned back on. While this can 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 Studio Customization Toolkit MQLCommand class, an MQL session lasts for only the duration of one command and not throughout the
Studio Customization Toolkit program’s session. This means that the
If you would like to turn history off throughout the Studio Customization Toolkit program’s session, you can add a flag to the Context.start() method to turn history off for the duration of a transaction rather than only for the duration of one command. When you add this flag, all events that occur within the duration of a transaction will not record history. After the transaction commits, history is turned back on for the next transaction and you will need to explicitly turn history off again with or without the flag. Since logging history affects performance as well as the size of the database, in some implementations it might be desirable to turn history off permanently. 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. Select History EntriesHistory records of either business objects or connections can be selected with the Select clause of the following commands. Syntax
In addition, when using the above commands to print all information about a business object, set or connection, history records can be excluded. You can also use history as select criteria when executing a temporary query. For example, this query selects all the history records for the specified business object: temp query bus <TYPE> <NAME> <REV> select history ; You can use the * wildcard with the name and revision. The results show all history records for all matching business objects. You can also select a specific element number in the history, for example: select history[n];where n is the number of the history element. !History Clause When all information
about a business object or connection is printed with the The
Prints out all information about the business object except its history. Select HistoryHistory 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, see Appendix: Selectables. SyntaxTo select history from a business object use the following syntax:
To select history from a connection, use one of the following:
The second command listed returns the history of all connections on the specified OBJECT. History.Between ClauseThe
For example, this temp query using the generic date format: temp query bus <TYPE> <NAME> <REV> select history.between[2017/02/23@22:38:00:GMT|2017/02/23@22:40:00:GMT]; For all matching objects, the history events that occurred within the specified times is displayed. If a matching object does not have any history events within that time period, the results show the business object name, but without any history events. The date format uses the system date format. For more information and help determining the format used on your system, see Installation and Setup: Administrate: 3DEXPERIENCE Platform: 3DSpace Administration: Live Collaboration Server: Configuring Live Collaboration: Configuring Date and Time Formats in the online user assistance. History.Event Clause The
For a connection, EVENT can be:
Example 1 For example, if a user enters:
the following is output: modify - user: patrick time: Mon Aug 6, 1998 5:50:11 PM state: Assigned description: test modify - user: sam time: Mon Aug 6, 1998 6:50:11 PM state: Assigned description: test1 modify - user: diane time: Mon Aug 6, 1998 7:50:11 PM state: Assigned description: test2 modify - user: ted time: Mon Aug 6, 1998 8:50:11 PM state: Assigned description: test3 Example 2 If you want to find the date when a signature has been satisfied. Use a command similar to the following:
This command returns: business object ECR 000122 history.approve = approve - user: Cole time: Sun Sep 5, 1999 1:24:50 PM CDT state: Approvals signature: Scrap Approver 1 comment: If you have multiple signatures on specific states, you will have to parse the data for a particular date and signature. Example 3 To return a list of customized history
entries created with the
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. Freezethaw is one event that can be selected and will return both freeze and thaw entries. History.Time Clause The
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
Might output: user: sue user: tim user: jerry History.State Clause The
Gives a list of all states the business object was in after every change to the business object: state: Proposed state: Assigned state: Described Delete HistorySystem administrators only can purge the history records of a business object or connection via MQL. What You Can DeleteHistory records can be deleted based on:
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 commands 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 ClauseThis 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:
The keywords “keep” and “last” are mutually exclusive. Also, only one form of the DATE item is allowed in a single command. For example:
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.!!! Event Clause All history entries
that log a specific event can be deleted from a business object or connection
using the
EVENT for connections can be from the following list:
The A list of events can be specified, separated by a space and a comma. For example:
Deletes all entries of these types. And:
Removes all freeze and thaw history entries on the connection. Freezethaw is one selectable EVENT. To purge customized history entries created with the
By User Clause All history entries that
log events performed by a particular user can be deleted from a business object
or connection using the A list of persons can be specified, separated with a space and a comma. Also,
the
This example deletes all
Date Clause History entries can be
deleted from a business object or connection based on when the event occurred
using one of the following
For example:
This example deletes the record of all events that occurred on November 4, 1998. On the other hand:
This example 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. For more information about date and time formats, see the Collaboration and Approvals Administration Guide: Properties for Configuring Calendars and Dates. Date items can be used with or without the other ITEMS listed, but only one date item is allowed in a single command. For example:
Only one date ITEM is allowed in a single command. Keep Item The keep item clause
is used with the other ITEMS and provides a way of reversing what is specified.
The ITEMS that follow In addition to what is specified with the
This example deletes all records except the creation (originated) entry.
This example deletes all records except those for checkin events performed by bill on the date specified. When used, Last Item The
This example deletes only one entry - for the last checkin event performed by bill. When used, output FILENAME item The
purged history entries can be written to a text file using the For example:
deletes all “checkin” records and stores them in the file “history.txt.” The file will be saved in ENOVIA_INSTALL unless a path is specified. For example, on a PC, the following could be used:
On UNIX it might be:
Usage NotesKeep these items in mind when using the
|