/ Development  

Uncover the hidden spot where your entity definitions live

Hi there “Process Automation” fans,

Welcome to a new installment of “Process Automation” tips.

An interesting question passed my OPA explorations which is: Where does the platform save the definition (or the blue-print) of an entity!? Well, a great question that requires some research, although I can already guess where the save happens! Where? Well, probably the in the XML DataStore (XDS)


Let’s get right into it…

My first question would be: How can we quickly find answers for these kinds of questions? That would be via database logging and watching the INSERT/UPDATE statements for the saving of a new entity creation!

For this we first make sure to create an entity project in our project. Add some interesting properties and prefix them with prj_. It’s not needed, but it’s a good habit, and you can find things back at database level much easier.

entity_blueprint_001

Before you save the entity!…Enable PostgreSQL logging using these ‘Bash’-commands:

1
2
3
4
5
6
sudo vi /var/lib/pgsql/data/postgresql.conf
#Search with '/' and go to (n)ext or (p)revious to jump the results
#Update this line:
log_statement = 'all'
systemctl restart postgresql
sudo tail -f /var/lib/pgsql/data/log/postgresql-{day}.log

Now do a save action on the entity and watch these interesting statements passing by in the logging (it’s like magic filling the XDS database with entries):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
INSERT INTO xds_document(...) VALUES (...);
INSERT INTO XDS_COLLECTION(...) VALUES (...);
--With this one for the project entity itself:
INSERT INTO xds_document
(revision,
stack_level,
document_id,
NAME,
description,
created_by,
lastmodified_by,
lastmodified_date,
created_date,
type_id,
type_revision,
parent_id,
content,
optimistic_lock,
accesscontrolpolicy_id,
inherit_parent_acp,
internal_name)
VALUES ('08002786-6f6a-a1ef-b958-274f6ce53522',
'1',
'08002786-6f6a-a1f0-8522-5995e95b1179',
'project2#ef#',
'project2#ef#',
'OPA Developer',
'OPA Developer',
'2025-04-08T15:07:54.181',
'2025-04-08T15:07:54.194',
'{5FE04E30-C6E5-440A-8951-DE12DBE7AEB5}',
'_08002786-6f6a-a1ef-b927-23f5294b9c89',
'08002786-6f6a-a1ef-b958-274f6c24b522',
'<StudioFolder xmlns="http://schemas.cordys.com/cws/runtime/types/folder/StudioFolder/1.0" typeVersion="" runtimeDocumentID="08002786-6f6a-a1f0-8522-5995e9629179"><DesigntimeQNRs/><RuntimeQNRs/><SourceRoots/></StudioFolder>',
'1',
'OPEN_TO_ALL_ACL',
'1',
'project2#ef#'
);

Notes:

  • Always make sure to also re-comment the log_statement = 'all' once you’re done (or set it back to the default level)!
  • You now see that the XDS location is just a separate set of tables in the same database as the runtime instances of your entities and all other types of documents of the platform!

Great! With this information we can now also query our entries…right? Yes, please give me the properties of my project entity including the datatypes (in PostgreSQL format!):

1
2
3
4
5
6
7
8
9
SELECT NAME, (xpath('//*[local-name() = "DataType"]/text()', content::xml))[1]::text AS data_type
FROM xds_document
WHERE NAME LIKE 'prj_%'
AND parent_id IN (SELECT document_id
FROM xds_document
WHERE NAME = 'Properties'
AND parent_id IN (SELECT document_id
FROM xds_document
WHERE NAME = 'project'));

entity_blueprint_002

NICEEEE!! We can go on and on like this, but if you don’t need all the queries and only want to view or browse your details on the entity definitions there is a smarter way…


The “Management Console” view

In 2019, we wrote about the ‘Management Console’. It’s an older UI which you can start via this command in the Bash terminal of your VM: sh /opt/opentext/ProcessAutomationCE/defaultInst/bin/cmc.sh

Notes:

  • CMC is the abbreviation of Cordys Management Console; You can read about the “Cordys” history here and here (incl. the comments for that last one!)
  • From a Unix perspective you need X11 to run this UI; Read about it here

Once you have the CMC tool up and running, you can browse into a similar data structure as seen in the previous section:

entity_blueprint_003

Only, what fun is browsing if you can query it! 🤗


I give it a well “DONE” on the R&D for finding out the insight for an entity definition. Not only by SQL statements, but also from a UI perspective over an old (but solid tool!) called CMC. Let me know in the comments; what’s your question to find an answer for? Have a great weekend, and we see one another next week at “Process Automation Tips”!

Don’t forget to subscribe to get updates on the activities happening on this site. Have you noticed the quiz where you find out if you are also “The Process Automation guy”?