The Entity is used to model a business object in IFS Cloud. One business object is represented by one or more entities. Entities are used to encapsulate different properties and code that belongs to just one entity. Entities are represented by tables, views and packages in the code.
Note: In previous versions of IFS Applications a Logical Unit (LU) was used instead of an entity. The LU is still described in some IFS documentation. Please remember that a LU is exactly the same as an entity.
Entities can be layered, meaning that they can be extended.
When you create an entity you will need to consider what attributes should be included, what associations the entity has to other entities, and if the entity should be a state machine or not; one should also consider if the entity is a generalization or not and what code generation properties needs to be set in order to change the generated code. Please read more about these concepts in the following sections:
Simple entities are easy to model in Developer Studio, but to model more complex entities, with a lot of attributes and code generation properties is a bit harder. You need to think more about how to do the model and what it should represent. When you model an entity you also have a lot of choices to do; should it have associations; should it have a state machine; should it be a generalization entity; what code generation properties is needed to use in order to change the behavior etc.
You can choose between modeling the entity in text or in a diagram. You can also use overview diagrams to better visualize relations between entities.
Follow these steps to model an entity:
- Create the entity model.
- Add the attributes to the model.
- If the entity has associations to other entities, add them to the model.
- If the entity should have a state machine, add states and transitions to the model.
- If you need to change the behavior of the code generation, add code generation properties.
The codegen properties can be added on the top level, on the attributes, on the search domains, on the associations and on the states of the model.
- If the entity is a generalization, add that in the model.
- Generate the code.
In most cases you need to run through the steps above several times before you feel that the entity represents what you aimed for.
After code generation, you will get the following:
- One table to store the data.
- One database view called the base view, used to present data to the client.
- One database package, used to create entity specific business rules.
- The storage file is used for overtaking objects, adding sequences, creation of extra indexes and creation of additional tables.
- The views file is used for overtaking, overriding views and for creation of additional views.
- The plsql file is used for overtaking, overriding methods and creation of own written methods.
This is an example of an entity with a reference and code generation properties on different attributes.