-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix associationTargetSearch with multiple target types
This is a cherry-pick of ec5e25c, adapted to the "new" associations. As part of it, the ShadowAssociationDefinition#createTargetObjectsFilter() method was improved - as much as currently possible. Work in progress: there are some limitations remaining. Related to MID-9561 and MID-9565.
- Loading branch information
Showing
14 changed files
with
286 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
.../evolveum/midpoint/model/common/expression/evaluator/AssociationRelatedEvaluatorUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (C) 2010-2024 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.model.common.expression.evaluator; | ||
|
||
import com.evolveum.midpoint.repo.common.expression.ExpressionEvaluationContext; | ||
import com.evolveum.midpoint.schema.constants.ExpressionConstants; | ||
import com.evolveum.midpoint.schema.processor.ShadowAssociationDefinition; | ||
import com.evolveum.midpoint.util.exception.ExpressionEvaluationException; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
class AssociationRelatedEvaluatorUtil { | ||
|
||
static @NotNull ShadowAssociationDefinition getAssociationDefinition(ExpressionEvaluationContext context) | ||
throws ExpressionEvaluationException { | ||
var associationDefinitionTypedValue = context.getVariables().get(ExpressionConstants.VAR_ASSOCIATION_DEFINITION); | ||
var associationDefinition = associationDefinitionTypedValue != null ? | ||
(ShadowAssociationDefinition) associationDefinitionTypedValue.getValue() : null; | ||
if (associationDefinition == null) { | ||
throw new ExpressionEvaluationException( | ||
("No association definition variable in %s; the expression may be used in a wrong place. " | ||
+ "It is only supposed to create an association.").formatted( | ||
context.getContextDescription())); | ||
} | ||
return associationDefinition; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.