- From the Command Line
- From the phpMyAdmin GUI
- Finding ProcessMaker objects
- Examples
- Using ProcesMaker classes to lookup translations
All the information which ProcessMaker stores in held in three MySQL databases for each workspace, which are generally named wf_<workspace>, rb_<workspace> and rp_<workspace>. This information can be easily looked up and even modified with MySQL or a graphical interface such as PhpMyAdmin to access MySQL databases. It can also be consulted from within ProcessMaker using the executeQuery() function in triggers.
- Note: By default, MySQL tables are not case sensitive in Windows, but they are case sensitive in Linux/UNIX. See the MySQL documentation. The ProcessMaker table and field names are in lowercase in Windows installations, but they are in UPPERCASE in Linux/UNIX systems. When creating SQL queries to access the ProcessMaker databases, it is recommended to spell the table and field names in UPPERCASE, since those SQL queries can be used in both Windows and Linux systems. For example, refer to USERS.USR_USERNAME, rather than users.usr_username or Users.Usr_Username.
From the Command Line
The ProcessMaker databases can be accessed from the command line of your operating system with mysql (or from your web browser with mysqladmin). Enter MySQL as the root user (or whichever user was configured to the MySQL databases for ProcessMaker). If you have forgotten this password as well, see these instructions to reset the root password.
Login into MySQL
In Windows open the Command Prompt (found at Start > All Programs > Accessories > Command Prompt) and enter:
Examining the databases
Once inside MySQL, examine the available databases:
Switch to a particular database:
See all the tables in a database:
Examine the structure of a table:
Exiting MySQL:
From the phpMyAdmin GUI
The ProcessMaker databases can be accessed with a graphical interface by using phpMyAdmin. The Windows installer for ProcessMaker automatically installs phpMyAdmin by default, but for Linux/UNIX, it will have to be manually installed.
To use phpMyAdmin, enter the address http://IP-ADDRESS/phpmyadmin
in your web browser. For example, if ProcessMaker was installed on the local machine, use the address http://localhost/phpmyadmin
. The Windows installer for ProcessMaker automatically created the user "administrator", so login to phpMyAdmin as "administrator" with the password which you entered during the installation.
Finding ProcessMaker objects
Objects in ProcessMaker such as users, groups, processes, tasks, cases, DynaForms, database connections, etc. are identified by their UID or unique identification, which is a string of 32 hexadecimal numbers generated by ProcessMaker. In most cases, the individual tables which hold information about ProcessMaker objects do not include their names (i.e, titles or labels), so it is very hard to know which object is being referenced in the table.
Instead the name of most objects (except users) is stored in the wf_<workspace>.CONTENT table. To find out information about a particular object, look up their names and their matching UID in the CONTENT table, then look up the information about the object in their particular table.
To find types of elements in the CONTENT table, look for the following values in the CON_CATEGORY field:
CON_CATEGORY | Description |
---|---|
APP_DESCRIPTION | Case description. |
APP_DOC_COMMENT | Comment on a document in a case. |
APP_DOC_FILENAME | Filename of a document in a case. |
APP_DOC_TITLE | Title of a document in a case. |
APP_TITLE | Case title. |
DBS_DESCRIPTION | Database connection description. |
DEPO_TITLE | Department Title. |
DYN_DESCRIPTION | DynaForm description. |
DYN_TITLE | DynaForm title. |
GRP_TITLE | Group title. |
INP_DOC_DESCRIPTION | Input Document description |
INP_DOC_TITLE | Input Document title |
OUT_DOC_DESCRIPTION | Output Document description. |
OUT_DOC_FILENAME | Output Document filename |
OUT_DOC_TEMPLATE | Output Document template |
OUT_DOC_TITLE | Output Document title |
PRO_DESCRIPTION | Process description. |
PRO_TITLE | Process title |
REP_TAB_TITLE | Report Table title |
SWI_TEXT | Text in process maps |
TAS_DEF_DESCRIPTION | |
TAS_DEF_MESSAGE | |
TAS_DEF_PROC_CODE | |
TAS_DEF_TITLE | |
TAS_DESCRIPTION | Task description |
TAS_TITLE | Task title |
TRI_DESCRIPTION | Trigger description |
TRI_TITLE | Trigger title |
Examples
To see a list of all the cases and their UIDs:
Running the query from the command line:
Running the query from the phpMyAdmin GUI
To look up the UID for a particular case whose title is "#46":
Users
Listing all available users
Running the query from the command line:
Running the query from the phpMyAdmin GUI
Finding information about a particular user
Listing what groups a user belongs to
C.CON_ID=GU.GRP_UID AND U.USR_UID=GU.USR_UID AND
U.USR_USERNAME='admin';
Running the query from the command line:
Running the query from the phpMyAdmin GUI
Listing what tasks a user is assigned to
C.CON_ID = TU.TAS_UID AND U.USR_UID = TU.USR_UID
AND U.USR_USERNAME = 'admin' AND C.CON_CATEGORY = 'TAS_TITLE';
Running the query from the command line:
Running the query from the phpMyAdmin GUI
Listing the pending cases for a user
FROM CONTENT C, APPLICATION A, APP_DELEGATION AD, USERS U
WHERE C.CON_ID = AD.APP_UID AND AD.APP_UID=A.APP_UID AND U.USR_UID = AD.USR_UID AND
U.USR_USERNAME = 'admin' AND C.CON_CATEGORY = 'APP_TITLE' AND (A.APP_STATUS = 'OPEN'
OR A.APP_STATUS='TO_DO') AND AD.DEL_THREAD_STATUS='OPEN';
Change U.USR_USERNAME = 'admin' to the username to query. The @@USR_USERNAME system variable can be used if needing to query for the currently logged-in user in a trigger or a DynaForm field.
To see the pending cases for a particular user from the command line:
Accessing in Dynaform Fields
If needing to use a database query in a dropdown box, listbox, radiogroup or checkgroup inside a DynaForm, make sure that the query returns two fields where the first field is the value which is stored when an option is selected and the second field is the label which is displayed to the user. Enter the query in the SQL query field without a semicolon (;) at the end.
For example listing what groups a user belongs to:
The XML definition:
SELECT C.CON_ID, C.CON_VALUE FROM CONTENT C, GROUP_USER GU, USERS U WHERE C.CON_ID = GU.GRP_UID AND U.USR_UID = GU.USR_UID AND U.USR_USERNAME = 'liriarte'
]]><en>Groups that a user belongs to</en>
</GroupsUser>
The preview will be:
If needing to use a case or system variable in the query, then create a hidden field in the DynaForm which has the same name as the variable so that its value will be passed to the DynaForm when it is loaded. Then, that variable can be used in the SQL query, either as @@variable
(variable inserted inside double quotation marks) or @#variable
(variable inserted without enclosing quotation marks).
For example, if needing to display a list of the list of groups for the currently logged-in user, then use the @@USR_USERNAME system variable by adding a hidden field named "USR_USERNAME" and placing U.USR_USERNAME = @@USR_USERNAME
in the SQL query:
<GroupsUser type="dropdown" required="0" readonly="0" mode="edit" btn_cancel="Cancel"><![CDATA[
SELECT C.CON_ID, C.CON_VALUE FROM CONTENT C, GROUP_USER GU, USERS U WHERE C.CON_ID = GU.GRP_UID AND U.USR_UID = GU.USR_UID AND U.USR_USERNAME = @@USR_USERNAME
]]><en>Groups that the user belongs to</en>
</GroupsUser>
Groups
Listing the available groups
Running the query from the command line:
Running the query from the phpMyAdmin GUI
Finding the status of a group
ON GROUPWF.GRP_UID=CONTENT.CON_ID WHERE CONTENT.CON_VALUE='Employees';
Running the query from the command line:
Running the query from the phpMyAdmin GUI
Listing members of a particular group
ON U.USR_UID=GU.USR_UID) LEFT JOIN CONTENT C
ON GU.GRP_UID=C.CON_ID WHERE C.CON_VALUE='Employees';
Running the query from the command line:
Running the query from the phpMyAdmin GUI
Accessing in DynaForm Fields
If queries are required to make them work in a dropdown inside a Dynaform refer them without the semicolon(;) at the end of the sentence.
For example listing members of a particular group:
The XML definition:
<![CDATA[SELECT U.USR_UID, U.USR_USERNAME from (USERS U left join GROUP_USER GU on U.USR_UID=GU.USR_UID) left join CONTENT C on
GU.GRP_UID=C.CON_ID where C.CON_VALUE='Employees']]>
<en>Members of a particular Group</en>
</membersGroup>
The preview will be:
Using ProcesMaker classes to lookup translations
It is also possible to lookup the text associated with a specified ProcessMaker object in the CONTENT by using the Content::load() method. This method allows the language to be specified, so this method can be used to obtain translations.
Example:
Obtain the title an task with the UID "13027240856a7f04516b3e1011191907" in English and French from France:
$titleFr = Content::load('TAS_TITLE', '', '12a16611256a0006a028ab7006995270', 'fr-FR');