dataChangeBehavior
attribute allows to specify how to detect that complex datas have changed sqince the last notification.inherit
: the service will inherit the value specified in the framework propertieschanged
: the full graph of complex datas will be taken into account to detect if datas have changed after a service invocationunchanged
: complex datas will generally be considered as changed be taken into account to detect if datas have changed after a service invocation<types> <simpleType name="string" baseType="string" /> <simpleType name="float" baseType="float" /> <structType name="waypoint"> <field name="name" type="string" /> <field name="latitude" type="float" /> <field name="longitude" type="float" /> </structType> <arrayType name="waypoints" type="waypoint" /> </types>And the service specification:
<services> <publish name="flighplan" > <data name="waypoints" type="waypoints" /> </publish> </services>Each time the
flighplan
service is notified, it will be considered as changed if the waypoints
arrays size has changed, or if one waypoint
field has changed:public void receive(ServiceInstance service) { // hasChanged is true if the arrays size has changed, or if one field has changed: boolean hasChanged = service.hasChanged(); }
<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> <property key="defaultChangeBehavior" value="unchanged" /> </files>Each time the
flighplan
service is notified, it will be considered as changed only if the waypoints
arrays size has changed:public void receive(ServiceInstance service) { // hasChanged is true only if the arrays size has changed: boolean hasChanged = service.hasChanged(); }
<files> <file url="applications.xml" /> <file url="services.xml" /> <file url="types.xml" /> </files>Now the
dataChangeBehavior
property has its default value, which means that by default the full graph of complex datas will be taken into account to detect if datas have changed after a service invocation as in the first example.<services> <publish name="flighplan" dataChangeBehavior="unchanged"> <data name="waypoints" type="waypoints" /> </publish> </services>Each time the
flighplan
service is notified, it will be considered as changed only if the waypoints
arrays size has changed:public void receive(ServiceInstance service) { // hasChanged is true only if the arrays size has changed: boolean hasChanged = service.hasChanged(); }
Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence