You can get data of another entity by connecting a consumer to a provider.
==== Naming ====
The names should provide information about *what the provider provides*.
For example:
Communication_entity has 3 providers:
- *AllCommunications*
- *EmailCommunications*
- *PhoneCommunications*
If you connect to *AllCommunications* you get *all* communication types of a contact.
If you connect to *EmailCommunications* you get *only the Email* communication type of a contact.
If you connect to *PhoneCommunications* you get *only the Phone* communication type of a contact.
*Important:*
*Do not always create a new provider when connecting a new entity. Maybe u can use an already existing provider.*
*Try to reuse providers if you need similar data for two dependencies*
=== Consumer ===
Is the old dfo.
=== Purpose ===
The Consumer *consumes* the data a provider provides.
It can be connected to a provider and fill the parameters of the provider.
=== Naming ===
Most of the time you get a list of "something" so you should call it the plural of what you get.
Example:
Persons
Organisations
If you have two Consumer to the same Entity, you should use speaking names.
Example:
Documents (e.g. for all documents of a person)
MainDocuments (e.g. for only the main documents of a person)
If you know you get only one row, you can use the singular.
Example:
Person
=== Parameter ===
Parameters provide a way to tell a provider *what exactly you need*.
==== Properties ====
The most important properties are
code, exposed, triggerRecalculation and mandatory
Parameters work with a fallback mechanism.
This means that if you set the code on the parameter directly then this is executed *only if you did not* provide the code on the parameter at the *provider* and/or *consumer*.
Likewise if you set the code on a parameter at the provider it will only be executed if a *consumer* which connects to this provider *has no code set* at the parameter.
| default | default | code set | Code from consumer executed | This is the mostly used scenario.
| default | code set | default | Code from provider executed | This is used if you need a default value for a parameter which is different on each provider. e.g. used by the Document_entity to determine if it should show main documents or not.
| code set | default | default | Code from parameter executed |
The checkbox-parameters can have *three* states: default, checked, unchecked. Default means the property is *gray* and the value from the previous instance is used. Checked and unchecked overwrite always the previous instance.
The exposed property is a way to decide if a parameter should be visible by the next instance