Obsolete timeline changes
How to handle obsolete timeline Changes - either ignoring them or upgrading them to a newer version
Last updated
Was this helpful?
How to handle obsolete timeline Changes - either ignoring them or upgrading them to a newer version
We have two kinds of obsolete Changes:
The Change can be ignored (we either don't use it at all or we push new changes that replace the old one)
The Change should be upgraded to a newer version
Delete the obsolete C# Change class and the related C# code
Create the list of obsolete changes
Register this list in the Projector's class constructor:

Add a new Handle method for SerializedChange to the Projector class:

Add a new When method to the State class, it will intercept all obsolete changes:

Lets assume we have the change AttemptStarted1 and it needs to be marked as obsolete because we introduced a new change AttemptStarted2
Make AttemptStarted1 as a private nested class of AttemptStarted2 and implement a new Upgrade method that will convert AttemptStarted1 to AttemptStarted2:

Delete all functionality related to AttemptStarted1
In the AttemptChangeProjector register AttemptStarted1 as an obsolete change:

Add a new Handle method in the Projector class that will upgrade AttemptStarted1 to AttemptStarted2 and call Handle for AttemptStarted2:

Add a new When method to AttemptState that will upgrade AttemptStarted1 to AttemptStarted2 and call When for AttemptStarted2:

Last updated
Was this helpful?
Was this helpful?