When the Source Object Changes
Your application changes over time: a field is added, another is dropped, a value gets a new allowed range. This page explains what the Rule Repository does when your application brings in a changed source object, what happens to the rules and tests already written, and how to move a rule onto the new version. Knowing this lets you keep your rules up to date without ever breaking one that is in use.
These parts of the repository are involved:
- The Source Versions tab, where a new version appears.
- User Activity, where each change your application brings in is recorded and can be compared with the version before.
- The Rule Version dialog's Clone... button and the New Rule Version dialog, which write a new version of a rule against the new source version.
- The Rule Editor, which marks in red anything the new source version does not have.
What the repository does with a changed definition
Your application sends the repository its current definition of each source object at times it chooses. The repository compares it with the version it has and does one of three things:
- Nothing, when nothing changed.
- Updates the version it has, when only things that cannot change what a rule decides are different, such as a display name, a description, a format, or how fields are grouped in the menus. One User Activity entry lists every change.
- Adds a new source version, when a rule could decide differently. The old version stays as it was.
These changes make a new version:
- A field, method or action added, removed or renamed. A renamed one counts as one removed and one added: the repository cannot tell they are the same.
- A field's type changed, or whether it may be empty.
- A number's lowest or highest allowed value, a text's maximum length, or how texts are compared.
- The list a field takes its values from.
- A time changed from a time of day to a duration, or back.
- A member of a fixed list removed while a rule uses it. Adding a member, or renaming one, only updates the version.
A new version is not live unless your application makes it so. Often it waits for a person to make it live; see Source Versions. To see exactly what changed, compare the new version with the one before; see Comparing Source Versions.
What happens to your tests
Depending on how your application is set up, the tests of the earlier version are copied or moved to the new one, or left where they are. Tests that arrive on a new version are marked Not Run, and the blue ≠ counts show them, so you can run them against the new definition. See Running Tests in Batches.
What happens to rules on the earlier version
Nothing. A rule version is written against one source version and stays tied to it for good. Its dialog says so in its information line, "written against source version" followed by the version, and it opens and reads as it was written.
A live rule stays live when a newer source version goes live. Whether it still makes sense with the new data is for you to judge: if it uses a field the new version no longer has, write a new version of it.
Move a rule onto the new version
You do this by writing a new version of the rule against the new source version. The quickest way is to start from the version you have:
- Open the rule version's dialog and click Clone.... The New Rule Version (Step 1 of 3) dialog opens, with the version the rule was written against in Source Version.
- Select the new version in Source Version.
- Click Next. The Rule Editor opens with the rule as it was. Anything the new source version does not have is marked in red. Hover over a marked element: it says that it is not in this source version and is shown as the rule version was written.
- Fix the rule. A marked element offers no menu, because the repository cannot tell what should replace it. Delete it and build that part again from the menus, or leave that condition out.
- Click Next. If anything is still marked, the repository does not go on, and the editor says that the rule is invalid and that you can hover over the highlighted elements for details. Nothing is saved.
- When nothing is marked, step 3 asks for the version's name. Click Create Version and answer the question that follows, as for a new rule; see Creating Rules.
If you change your mind, click Back and select another source version. The marks go as soon as the rule is read against a version that has what it uses.
New Rule Version... in a rule's dialog takes the same steps, starting from an empty editor. See Rule Versions.
When a source object seems to start over
The repository knows a source object by the name your application gives its type. If that name changes, for example when your application's programmers rename it, the repository sees a new source object with a first version and no rules. The rules, tests and history of the old one stay with the old one. If you see this, talk to the people who build your application.