Skip to content

Dynamic Dependencies

IFS Cloud is built using static and dynamic components. The concept of dynamic dependencies is not a new one but in keeping with the rest of IFS Application development the IFS Aurena framework also makes use of it. This means that an IFS Aurena Client page will at some point need to refer to a element that is located in a dynamic component. Such elements would need to be marked as a dependent element of a dynamic component.

In addition to fragments, dynamic elements can exist in both the projection and client model:

Dynamic Elements in Client Dynamic Elements in Projection
1. Navigator entries 1. Entity Sets
2. Sub-Menus 2. Entities
3. Pages 3. Queries
4. Groups 4. Summaries
5. Lists 5. References
6. Tabs 6. Functions
7. Pages 7. Actions
8. Commands
9. Fields
10. List of Values
11. Selectors
12. List of Value Lists

Defining a Dynamic Dependency

A dynamic dependency has to be defined in two locations of a projection or client file. Namely:

  1. At the point of the element declaration or definition
  2. At the point where the element is referred.

The examples below show how these dependencies are created for each IFS Aurena model.

Example 1 - Dynamic component dependency in the projection model

At the point of declaration:


@Override  
@DynamicComponentDependency PROJ  
entity Activity {  
    crud = Read;  
}  

At the point of Reference:


@Override  
entity Movie {  
    attribute Year Integer {  
        fetch = "Extract(year from RELEASE_DATE)";  
    }  
    array Cast(MovieId) to MovieActor(MovieId);  
    @DynamicComponentDependency PROJ  
    reference Movie(MovieId) to Activity(ActivityId);  
}  

Example 2 - Dynamic component dependency in the client model

At the point of Definition:


@DynamicComponentDependency PROJ  
group MovieGroupWithProjectInfo for MovieWithProjQry {  
    label = "Movie";  
    field MovieId;  
    field Title;  
    field Genre;  
    field ReleaseDate;  
    field Rating {  
        rating {  
            maxrating = 10;  
            showlabel = true;  
        }  
    }  
    field Country;  
}  

At the point of Reference:


page MovieDetail using Movies {  
    label = "${TitleYear}";  
    stateindicator MovieStateIndicator;  
    selector MovieSelector;  
    @DynamicComponentDependency PROJ  
    group MovieGroupWithProjectInfo;  
    list MovieCast(Cast) bind MovieSelector;  
}  

Example 3 - Using a Dynamic Fragment

If you are using a dynamic fragment, annotate it with @DynamicComponentDependency when you include it in the projection or client file.


@DynamicComponentDependency ORDER  
include fragment SomeFragmentFromOrder;  

NOTE: When you are referring items in the dynamic fragment always remember to annotate them as well.