Bizagi provides 4 types of Relationships that can help you connect your entities and create the data model:
1. Related Attribute Relationship
This is one of the most used relationship between the instances of 2 entities. The particular thing about this one is the order in which is created. In Model Data you will see a new attribute in the first entity shown under Relations. This attribute points to the second entity, but NOT the way around.
E.g. You have 2 entities: M_Order and P_OrderStatus. You can see the new relationship called Order Status under Relations in M_Order entity.
In database Bizagi automatically creates a new column in table Order pointing to table OrderStatus.
2. One to One Relationship
One to One represents a single relation between the instances of 2 entities. Each instance from an entity is related with just one instance from the other entity and the same way around.
E.g. You have 2 entities: M_Employee and M_Passaport. An employee can only have one passaport and one passaport can belong to only one employee. In Model Data you will see under Relations on each entity a new attribut. In M_Employee we have a new attribute idM_Passaport and in M_Passaport we have a new attribute idM_Employee.
In database it happens the same thing. Bizagi creates one new column in each table.
3. One to Many or Collection Relationship
One to Many Relationship is also known as Collection. This is a relationship between one instance of an entity and zero, one or multiple instances of another entity. But don’t forget the following: one instance of the last entity is associated ONLY with one instance of the first entity.
E.g. You have 2 entities: M_Invoice and M_InvoiceDetails containing the list of Items and Quantity. An Invoice can have many Items and the list of those Items are pointing to a single Invoice. In Model Data you will see a new attribute in M_InvoiceDetails entity under Relations called ‘M_Invoice’.
In database Bizagi automatically creates a new column in table M_InvoiceDetails to point to table M_Invoice.
4. Many to Many Relationship
Many to Many is a relation between one instance of entity A and zero, one or many instances of entity B AND between one instance of entity B and zero, one or many instances of entity A.
E.g. Let’s imagine that we have 2 entities: M_Employee and M_Skill. One Employee can have multiple Skills adn more Employees can have the same Skill. In Model Data the Many to Many relationship looks like in the image bellow.
In database Bizagi automatically creates an intermediate table (M_Employee_M_Skill) to store the relation between these 2 tables.
From the last join we can see that employee Ana has more skills like Verbal communication, Self motivation and Flexibility. Also employees Ana and John share the same skills like Verbal communication and Flexibility.