bug #7995
closedRegistration.registrationDate not set when status is set PUBLISHED
100%
Description
The Registration.registrationDate
should be set to now when the status
is set to PUBLISHED
.
When status
changes from PUBLISHED
to something else the registrationDate
should be resetted to null
.
Per definition the registrationDate
this the timestamp for when the registration has been published, so it makes most sense to implement this rule into the setter Registration.status
. There might be rare use cases in which the registrationDate
needs to be different. In these cases setting the data explicitly is needed anyway.
Related issues
Updated by Andreas Kohlbecker about 4 years ago
- Related to feature request #6655: Implement a RegistrationManager with state machine added
Updated by Andreas Kohlbecker about 4 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 50
Applied in changeset cdmlib|f33a82a7e547ddcd3b084d7a6c53b3920f6db5fc.
Updated by Andreas Müller about 4 years ago
- Status changed from Resolved to Feedback
- Assignee changed from Andreas Müller to Andreas Kohlbecker
This is dangerous behaviour. For phycobank it might be correct as we edit the data within the database. However, for handling external registrations it is not correct. For the later usecase the user/developer must know that setting the date should be done after setting the state which is hidden knowledge only available in Javadoc or so which is dangerous. Also when accidentally changing the state and change it back to PUBLISHED the date is changed without realizing by the user maybe.
So I strongly recommend to implement this on application side if it is a wanted feature for phycobank but remove it from cdmlib-model. We could add a method in service layer if you want to encapsulate it within one operation. This method should have an according name, e.g. setStatusAndDate
Updated by Andreas Kohlbecker about 4 years ago
So I strongly recommend to implement this on application side
So this means implementing it in cdm-vaadin
and in the registration controller methods (cdmlib-remote
) which allow state changes. Especially in the remote layer it is crucial for the digital workflow that the registrationDate
is always set to now when status is set PUBLISHED.
Updated by Andreas Müller about 4 years ago
Andreas Kohlbecker wrote:
So I strongly recommend to implement this on application side
So this means implementing it in
cdm-vaadin
and in the registration controller methods (cdmlib-remote
) which allow state changes. Especially in the remote layer it is crucial for the digital workflow that theregistrationDate
is always set to now when status is set PUBLISHED.
sounds reasonable
Updated by Andreas Kohlbecker about 4 years ago
- Status changed from Feedback to Resolved
There is now a updateStatusAndDate(RegistrationStatus status)
method in Registration which can be used if needed. The algorithm is centralized that way.
Updated by Andreas Kohlbecker about 4 years ago
- Status changed from Resolved to Closed
- % Done changed from 50 to 100
works now also in the RegistrationPopupEditor
Updated by Andreas Müller almost 4 years ago
- Category changed from cdmlib to cdm-vaadin