v0.4.0
New Features
WldtEventObserver
A new class called WldtEventObserver has been introduced to allow a simplified observation of target specific events generated by the Digital Twin and its components such as adapters and the model. Main mapped events and filters are:
- State Events: State Update and State Event Notifications
- Physical Asset Events: Physical Property Variation, Physical Event Notification, Physical Relationship Instance Creation and Deletion
- Physical Asset Action Events: Physical Action Trigger
- Digital Action Events: Digital Action Event
- Physical Asset Description Events: Physical Asset Description Available and Updated
- Life Cycle Events: Digital Twin Life Cycle Events
- Query Request Events: Storage Query Request Events (See next sections for additional information)
For each event type dedicated observation and un-observation methods (e.g., observePhysicalAssetEvents() and unObservePhysicalAssetEvents()) are available in order to create an instance of the observer and decide which events to receive.
To build a WldtEventObserver a dedicated listener IWldtEventObserverListener should be implemented by the developer to receive the callbacks related to the incoming events. All the events are of the generic type WldtEvent and it is up to the developer the validate and check the received object and if it match with the expected one.
The WldtEventObserver has been currently used internally within the library to simplify the implementation and usage of the Storage Layer and the associated Storage Query System as described in the dedicated sections.
Storage Layer
A new storage layer has been integrated into the core WLDT library, enabling Digital Twins (DTs) to store data related to the evolution of their state, generated events, and any variations involving properties, events, actions, relationships, and life cycle. The Storage Layer consists of two main components:
- Storage Manager: This is the central component of the storage system, facilitating the structured and modular storage and retrieval of information. It allows developers to create and utilize various storage systems (e.g., in-memory, file-based, or DBMS) simultaneously. The Storage Layer is accessible in both read and write modes internally by the DT's Model, and in read-only mode via the Query System by Digital Adapters.
- Query System: To delegate and encapsulate the responsibility of data storage within the DT's model, a query system has been integrated. This system enables Digital Adapters to retrieve stored data and expose it according to their specific logic and implementation.
The storage layer is designed for easy extension, allowing developers to create and share new storage layers (e.g., using Redis, MySQL, or MongoDB). The provided in-memory implementation serves only for basic development and testing purposes. Similarly, the Query Manager can be extended and customized by developers to implement additional query management features or to enhance the default functionalities provided by the library.
Migration Info: 0.3.0 - 0.4.0
- Now
PhysicalAssetRelationshipconstructor has also thetypein order to match theDigitalTwinStateRelationshipand simplify its management - The method
notifyDigitalTwinStateEventthrows only the ExceptionWldtDigitalTwinStateEventNotificationExceptionwhileEventBusExceptionhas been removed
Additional Improvements & Fixed Bugs
- Synchronized the update of the current DT Life Cycle State in order to avoid wrong data
- The
WldtEventBusnow supports the use of topics Wildcard (at the moment only multi-level with the character*). For example with this approach is possible to subscribe to all the events associated to property variations (topic:dt.physical.event.property.*). New methods added toWldtEventBusare:matchWildCardType(String eventType, String filterType): Check if the provided event type match the WildCard TypeisWildCardType(String filterEventType): Check if the provided event type is a WildCard Type
- The class
WldtEventTypeshas been introduced to contain all the event types in the WLDT Framework and support internal message exchange. Includes types for events associated and adopted by: i) Physical Adapters; ii) Model and Shadowing Function; and iii) Digital Adapters. - The
EventManagerclass has been added to centralize and simplify the event management in the WLDT Framework providing a set of static methods to publish events associated to a target digital twin and publisher (e.g., the physical adapter of the twin). - Now
PhysicalAssetRelationshipclass has also thetypein order to match theDigitalTwinStateRelationshipand simplify its management - The internal class
ModelEnginehas been renamed intoDigitalTwinModelas an initial update for further development of the next version 0.5.0 where the structure of the DT's Model and the associated classes will be improved