[midPoint-git] [Evolveum/midpoint] a41b90: Consider mapping's eval phase in correlation simul...
Andrej
noreply at github.com
Mon Feb 2 17:17:40 CET 2026
Branch: refs/heads/bugfix/t-4327
Home: https://github.com/Evolveum/midpoint
Commit: a41b902b486017693bb70ca92a03a49ec3a57f53
https://github.com/Evolveum/midpoint/commit/a41b902b486017693bb70ca92a03a49ec3a57f53
Author: Andrej Zan <andrej.zan at evolveum.com>
Date: 2026-02-02 (Mon, 02 Feb 2026)
Changed paths:
A infra/schema/src/main/java/com/evolveum/midpoint/schema/processor/ResourceSchemaExtender.java
M infra/schema/src/main/java/com/evolveum/midpoint/schema/processor/ResourceSchemaFactory.java
M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/correlation/CorrelationServiceImpl.java
M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/correlation/CorrelatorContextCreator.java
M model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/correlator/tasks/CorrelationServiceTest.java
M model/model-impl/src/test/resources/correlator/correlation/task/dummy-resource.xml
M repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/DummyTestResource.java
Log Message:
-----------
Consider mapping's eval phase in correlation simulation
**What**
Fix the problem where simulation of correlation was not evaluated
correctly in case, when the mapping used by the correlation did not have
specified the "before correlation" evaluation phase (either directly, or
indirectly by default evaluation phases).
**Why**
When the pre focus is calculated for our correlation, there is a logic,
which "removes" all unnecessary inbound mappings. By unnecessary I mean
mappings, which are not required by any of the correlators (plus few
more nuances). However, this is done purely based on the information in
resource schema, from which the correlators are taken. But in our case,
the suggested correlations are not in the resource schema (yet), since
they are "just" suggested. So the simple solution is to add them to the
resource schema even though only in "runtime" as we already do for
suggested mappings.
**Notes**
*New class*
This change adds new class `ResourceSchemaExtender`, which was added
because similar logic will be needed also in simulation of mappings.
Its main purpose is to allow simple "extension" of the schema stored in
the resource with additional runtime definitions. It is useful in case
of correlations and mappings suggestions, which are not in state to be
stored in the resource yet, but we want to work with them (e.g. in
simulation) as if they already were part of it. So far this class only
allows to add new attribute definition and correlation definition, but
can be easily extended when needed.
*Additional check*
This change also adds additional check to the
`CorrelatorContextCreator`, which checks if the correlators are empty.
This check is there, because the UI tends to leave an empty
`correlators` element, when all correlators are deleted.
```xml
<correlation>
<correlators/>
</correlation>
```
That caused exceptions when simulation was run with newly suggested
correlator, if previously existing correlators were deleted.
Even though in case of simulation this problem was mitigated by
"extending" the runtime resource schema, I believe there could be also
other places where it could potentially cause a problem.
Note: That additional check is by no means bulletproof. You can simply
bypass it, if you will add for example a `name` element to otherwise
empty `correlators` element. But I think, that even with that
"imperfection" it can be useful in described case of correlators
deletion by the UI.
**Task**: 11031
To unsubscribe from these emails, change your notification settings at https://github.com/Evolveum/midpoint/settings/notifications
More information about the midPoint-svn
mailing list