Now that you've created your objects with the import, let's take a closer look at the building blocks of objects:
Attributes Relationships Transformations 1 Attributes
If you modeled your objects from scratch, you would enter all data manually - always use the import if you can! That said, let's look at the manual options briefly.
Here are a few cues on how to work with the popup when you create a custom object type:
Name your custom object type. We suggest using the singular form. Optional color and description. Optional process and metadata tags to easily filter your object later on. Setting of the primary as a single field or a composite key made of multiple fields. Adding of new attributes to your custom object. Celonis allows the following data types: Boolean for TRUE or FALSE values DateTime to store Datetime information such as dates or timestamps String to store alphanumeric information Long Integer to store integer values Floating Point to store floating-point values with up to 15 decimal places
You can always come back to edit any part of your object after creation.
2 Relationships
The most important aspect of relationships is how they affect your transformations.
Handling N:1 relationships
When dealing with N:1 relationships, a column that stores the relevant foreign key will be part of your object attributes and entered in your attributes transformations. This column is on the N side of the relationship. For example, for the object Report, imagine there are two N:1 relationships to the user object.
These relationships would be mapped in our attributes script. From a table perspective, you can think of them as foreign keys. The name you define for the relationship (see above) is the name of the attribute.
In short, for N:1 relationships, a foreign key is added as an attribute to the object on the N side.
With or Without Primary Keys
If your target object has a primary key defined, then your defined relationship does not need to be mapped in the transformation. The 'N side' object automatically takes the foreign key (or attribute) and maps it to your target object's (1 side) primary key in the background. Since you defined primary keys at import, this is what your transformation will look like:
Celonis draws on the attributes you have on the object and automatically populates the foreign keys. Here the naming convention is 'relationship name' + 'ID'.
In other words, for all your objects, we strongly recommend you always define primary keys. This heavily reduces your manual scripting work in transformations.
Handling N:M relationships
No matter which object is owning an N:M relationship, an extra join table needs to be created to map the relationship. The system will prompt you to create this table in transformations by showing you an extra Relationships folder with the name of your relevant relationship. As an experiment, you can add an N:M relationship from Report to Expense, with Report as the owner / implementer of the relationship:
In this case, it creates a dedicated folder based on the name of the "m:n" relationship:
Here is a visual of scenarios when you don't need relationships scripts:
If your relationship is N:M then you need a relationship script that creates a join or mapping table at the database level:
In our use case, there are no relationships scripts needed since all relationships are m:1 and could be covered by the import.
3 Transformations
As events typically pull data from objects, it's essential you start with populating your objects first. For the most part, this is done at import with a few exceptions. There are three types of object transformation scripts:
Object attributes: These are covered mostly by your import from tables. You can always adjust the IDs and map custom attributes you may have added. Object changes: These are fully optional and not encouraged. These scripts can serve as a staging table for change events. More on this on the next pages. There is a better option for change events. Object relationships: As you saw above, this is necessary if you have N:M relationships. You need to add both the N:M relationships and their scripts after import.
You'll find transformations here:
The transformation editor separates the scripts using folders and gives you a variety of options:
The folder area to separate attribute, change and relationship scripts. The data source area to change your data source, preview your tables, and insert tables and fields. This is the default data source (data connection) for your transformation. Parameters to help you quickly change recurring values in your script. These can be local parameters, global parameters, or data connection parameters if multiple data sources are needed. Under transformation actions you can save a transformation as a template for easy re-use. Save with validation means you save and check that your SQL syntax conforms to CeloSQL standards. Once validated, a transformation is enabled and ready for use in your OCPM Data Pool after publishing. You can save transformations as draft as well. The SQL script. Each script will come with a commented out suggestion if not auto-generated via the import. Edit your attributes quickly and preview your script's results.
Here are three other aspects to keep in mind when working with transformations:
Unique IDs Quotation Marks ANSI SQL
For the ID or primary key of each object, a convention you can follow is to concatenate the object's name with the fields for the ID. If more than one field is used, we speak of 'composite keys':
{field name} || '::' || {field name} as ID
Use double colons (::) to separate different parts of your ID. || is the syntax for concatenation (combining).
If you define primary keys directly at creation, then there is no need for you to script for the ID in transformations. More information on primary keys and composite keys in our documentation.
This approach ensures you have unique IDs across objects and events. For example, if a user object and an expense object both have the same ID and are both used to create event instances, then metrics that rely on these IDs (such as an event count) could potentially be inaccurate.
In a nutshell, unique primary keys / IDs are essential for you to have accurate data later on in the Studio.
Thankfully, our sample data already has the object names in the ID:
Next, let's look at the purpose of object change scripts.