Configurable Date Sync

No UI

Intitial Task: Make sure you have set the configuration correctly before starting the task. Otherwise, unwanted data loss may occur.

With the Configurable Date Sync plugin, different date sources on assets can be written to different date targets.

The following sources and destinations are possible:

Sources:

  • Availability (from & to)
  • Date Infofield
  • Date Infofields
  • Version date

Targets:

  • Availability (active / inactive / from & to)
  • Date Infofield

The sources and targets can be combined in any way and multiple combinations can be set at the same time.

The task "Configurable Date Sync: Initial Sync" is available for the migration.

Properties

To be configured in {home}/appserver/conf/custom.properties

configurableDateSync.license

type: String, required: yes, default: -

configurableDateSync.filter

type: String, required: no, default: all assets

Filter expression (see Search Util 2) to define which assets are processed in the initial task. If no filter is defined, all assets will be processed.

Bean Configuration

In addition to the properties, further configurations must be done using Spring Beans. The Configurable Date Sync expects an XML to be located in {home}/appserver/spring/configurableDateSyncConfig.xml.

In the following example, the values of two information fields are written to the Asset Availability validity fields. The property "propagateDeletions" is used to determine whether deleted values in the information fields are considered. The property "deletedAvailabilityRevertsTo" defines which availability should apply if both values are deleted (availability = active / inactive).

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util-4.0.xsd">

    <util:list id="configurableDateSyncConfigMapping" value-type="ch.brix.configurableDateSync.ConfigurableDateSyncConfigMapping">

        <!-- infofield to ActiveFrom -->

        <bean class="ch.brix.configurableDateSync.ConfigurableDateSyncConfigMapping">

            <property name="dateSource">
                <bean class="ch.brix.configurableDateSync.source.DateSourceInfofield">
                    <property name="infofieldId" value="101" />
                </bean>
            </property>
            <property name="dateTarget">
                <bean class="ch.brix.configurableDateSync.target.DateTargetAvailability">
                    <property name="target" value="activeFrom" />
                    <property name="propagateDeletions" value="true" />
                    <property name="deletedAvailabilityRevertsTo" value="inactive" />
                </bean>
            </property>
        </bean>

        <!-- infofield to ActiveTo -->

        <bean class="ch.brix.configurableDateSync.ConfigurableDateSyncConfigMapping">

            <property name="dateSource">
                <bean class="ch.brix.configurableDateSync.source.DateSourceInfofield">
                    <property name="infofieldId" value="102" />
                </bean>
            </property>
            <property name="dateTarget">
                <bean class="ch.brix.configurableDateSync.target.DateTargetAvailability">
                    <property name="target" value="activeTo" />
                    <property name="propagateDeletions" value="false" />
                </bean>
            </property>
        </bean>

    </util:list>

</beans>

In the class ConfigurableDateSyncConfigMapping a dateSource and a dateTarget must be configured.

Source

Required fields

In each Mapping-Bean, one Source-Bean must be configured. The source could be an infofieldId, infofiledIds or a source.

infofieldId: The source reads the date of an informationfield. The informationfield must be of type Datefield and configured in the information-fields.xml.

type: Long, required: yes, default: -

    <property name="dateSource">
        <bean class="ch.brix.configurableDateSync.source.DateSourceInfofield">
             <property name="infofieldId" value="101" />  
        </bean>
    </property>

infofieldIds: The source reads the earliest or the latest date of a list of informationfields. The informationfields must be of type Datefield and configured in the information-fields.xml.

type: list of long (comma separated), required: yes, default: -

  • findDate: Defines if the minimum or maximum date is applied.

    type: String (MINIMUM or MAXIMUM), required: yes, default: MINIMUM

    <property name="dateSource">
        <bean class="ch.brix.configurableDateSync.source.DateSourceInfofields">
            <property name="findDate" value="MAXIMUM"/>
            <property name="infofieldIds">
                <list>
                    <value>112</value>
                    <value>113</value>
                </list>
            </property>
        </bean>
    </property>

source:

type: String, required: yes, default: -

  • versionDate: The source reads the date of the last version added or activated.
    <property name="dateSource">
        <bean class="ch.brix.configurableDateSync.source.DateSourceVersionDate">
            <property name="source" value="versionDate" />
        </bean>
    </property>
  • activeFrom: The source reads the date from field "Valid from" from Asset Availability "Date controlled".
    <property name="dateSource">
        <bean class="ch.brix.configurableDateSync.source.DataSourceDateControlled">
            <property name="source" value="activeFrom" />
        </bean>
    </property>
  • activeTo: The source reads the date from field "Valid to" from Asset Availability "Date controlled".
    <property name="dateSource">
        <bean class="ch.brix.configurableDateSync.source.DataSourceDateControlled">
            <property name="source" value="activeTo" />
        </bean>
    </property>

Target

Required fields

In each Mapping-Bean, one Target-Bean must be configured. The target could be an infofieldId or a target.

infofieldId: The target writes the date to an informationfield. The informationfield must be of type Datefield and configured in the information-fields.xml. --> delete case

type: Long, required: yes, default: -

    <property name="dateTarget">
        <bean class="ch.brix.configurableDateSync.target.DateTargetInfofield">
            <property name="infofieldId" value="101" />
            <property name="propagateDeletions" value="true" />
        </bean>
    </property>

target:

type: String, required: yes, default: -

  • activeFrom: The target writes the date to field "Valid from" from Asset Availability "Date controlled". --> delete case

    <property name="dateTarget">
        <bean class="ch.brix.configurableDateSync.target.DateTargetAvailability">
            <property name="target" value="activeFrom" />
            <property name="propagateDeletions" value="true" />
            <property name="deletedAvailabilityRevertsTo" value="inactive" />
        </bean>
    </property>
  • activeTo: The target writes the date to field "Valid to" from Asset Availability "Date controlled". --> delete case
    <property name="dateTarget">
        <bean class="ch.brix.configurableDateSync.target.DateTargetAvailability">
            <property name="target" value="activeTo" /> 
            <property name="propagateDeletions" value="false" /> 
            <property name="deletedAvailabilityRevertsTo" value="inactive" />       
        </bean>
    </property>
  • active: The target sets the Asset Availabiliy to active, if source date is > date of yesterday. --> no delete case
    <property name="dateTarget">
        <bean class="ch.brix.configurableDateSync.target.DateTargetAvailability">
            <property name="target" value="active" />   
        </bean>
    </property>
  • inactive: The target sets the Asset Availabiliy to inactive, if source date is <= date of yesterday. --> no delete case
    <property name="dateTarget">
        <bean class="ch.brix.configurableDateSync.target.DateTargetAvailability">
            <property name="target" value="inactive" /> 
        </bean>
    </property>

Optional fields

  • propagateDeletions: The setting determines whether deleted source values should also be deleted in the target.

    type: boolean, required: no, default: false

  • deletedAvailabilityRevertsTo The setting determines which Asset Availability should be applied, if propagateDeletions is true and activeFrom and activeTo have been deleted.

    type: String, required: yes, if propagateDeletions is true , default: -

    • active: Sets Asset Availability to "Available".
    • inactive: Sets Asset Availability to "Not available".

Configuration Validation

When the application starts, it checks if the configuration is correct. If informationfields are configured that are not of type "Date" or if no "deletedAvailabilityRevertsTo" is determined when propagateDeletions is true, the configuration is not considered. A corresponding entry can be found in the log.

Compatibility Matrix

Configurable Date Sync CELUM (min. version)
1.0.0 6.4.0 (tested with 6.8)
1.0.1 6.4.0 (tested with 6.8)
1.1.0 6.4.0 (tested with 6.11)
1.2.0 6.4.0 (tested with 6.16)

Release Notes

1.0.0

Release: 2021-02-17

Initial Version

1.0.1

Release: 2021-02-26

Added SearchUtil2

1.1.0

Release: 2022-07-20

Added Infofields

1.2.0

Release: 2023-10-11

find min or max date