Parameters
Parameters of Entities are comparable to the constructor of a method. They enable the Entity to react specificly after it has been called, depending on the Parameter's value. The central property of a Parameter is its valueProcess, which allows defining the Parameter's value dynamically via JDito code.
Usage with Provider/Consumer
In most cases, Parameters are used in combination with a Provider/Consumer relationship. After a Parameter has been created, an editable instance of it additionaly appears assigned to every Provider of the same Entity. If the Parameter's property flag "exposed" is set to true, an editable instance of the Parameter also appears assigned to every Consumer related to the Providers. Then, the value of a Parameter can be set by other Entities.
Common use cases
Common use cases are:
conditionProcessof a dbRecordContainer /contentProcessof a jDitoRecordContainer: Filtering/Restricting the datasets via extension of the "where" condition. In these cases, a Parameter contains the criteria the Provider needs to select the required data. The Parameter is created on the Provider’s side and set "exposed" so it also appears as assignment to the related Consumer; there, its value is set.afterUiInitprocess of an Entity: e.g., presetting attributes or other ConsumersinitFilterProcessof an Entity: Filtering/Restricting the datasets that are initially shownvalueProcessof an EntityField: presetting the field's value- usage with the
entitiesfunctions / usage with Entity webservices: Here, Parameters can be used the same way as with Consumers to get the required data.
In all of the above use cases, the Parameter's property flag "exposed" needs to be set to true in order to enable the value to be set by other Entities at the Consumer side.
Furthermore, Parameters can be used for different Providers. The value of a Parameter can not only be set directly at the Parameter or via the Consumers, but also via the Providers. This enables to use a Parameter in order to force a specific behavior via a Provider, e.g., OnlyActiveOrganisations with OnlyActive_param set.
If a preset should not only be valid for one specific Provider, but for all Providers of the Entity, then the preset can be done directly at the Parameter.
Usage without Provider/Consumer
Parameters can also be used independently from a Provider/Consumer relationship. In these cases, the preset is also done directly at the Parameter. This is commonly used, e.g., for the creation of complex objects/data structures that buffer information, as required for cases like reports.