Skip to content

Commit

Permalink
Fixing workflow and certificaiton tests
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Apr 12, 2019
1 parent 2ba68dd commit a742a11
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Expand Up @@ -93,7 +93,8 @@ List<ObjectReferenceType> getReviewersForCase(AccessCertificationCaseType _case,
}
for (ExpressionType reviewerExpression : reviewerSpec.getReviewerExpression()) {
ExpressionVariables variables = new ExpressionVariables();
variables.put(ExpressionConstants.VAR_CERTIFICATION_CASE, _case, _case.asPrismContainerValue().getDefinition());
// The _case does NOT have definition here. Can we have it?
variables.put(ExpressionConstants.VAR_CERTIFICATION_CASE, _case, AccessCertificationCaseType.class);
variables.putObject(ExpressionConstants.VAR_CAMPAIGN, campaign, AccessCertificationCampaignType.class);
variables.put(ExpressionConstants.VAR_REVIEWER_SPECIFICATION, reviewerSpec, AccessCertificationReviewerSpecificationType.class);
List<ObjectReferenceType> refList = expressionHelper
Expand Down
Expand Up @@ -73,6 +73,7 @@
import com.evolveum.midpoint.prism.query.TypeFilter;
import com.evolveum.midpoint.prism.query.UndefinedFilter;
import com.evolveum.midpoint.prism.query.ValueFilter;
import com.evolveum.midpoint.prism.util.DefinitionResolver;
import com.evolveum.midpoint.prism.util.ItemDeltaItem;
import com.evolveum.midpoint.prism.util.JavaTypeConverter;
import com.evolveum.midpoint.prism.util.ObjectDeltaObject;
Expand Down Expand Up @@ -349,7 +350,19 @@ private static <T> TypedValue<T> determineTypedValue(PrismContext prismContext,

private static <T,O extends ObjectType> TypedValue<T> determineTypedValueOdo(PrismContext prismContext, String name, TypedValue<O> root, ItemPath relativePath) throws SchemaException {
ObjectDeltaObject<O> rootOdo = (ObjectDeltaObject<O>) root.getValue();
ItemDeltaItem<PrismValue, ItemDefinition> subValue = rootOdo.findIdi(relativePath);
DefinitionResolver<PrismObjectDefinition<O>, ItemDefinition> resolver = (rootDef,path) -> {
// We are called just before failure. Therefore all normal ways of resolving of definition did not work.
ItemDefinition parentDef = rootDef.findItemDefinition(path.allExceptLast());
if (parentDef != null && parentDef.isDynamic()) {
// This is the case of dynamic schema extensions, such as assignment extension.
// Those may not have a definition. In that case just assume strings.
// In fact, this is a HACK. All such schemas should have a definition.
// Otherwise there may be problems with parameter types for caching compiles scripts and so on.
return prismContext.definitionFactory().createPropertyDefinition(path.firstName(), PrimitiveType.STRING.getQname());
}
return null;
};
ItemDeltaItem<PrismValue, ItemDefinition> subValue = rootOdo.findIdi(relativePath, resolver);
PrismObjectDefinition<O> rootDefinition = root.getDefinition();
if (rootDefinition == null) {
rootDefinition = rootOdo.getDefinition();
Expand Down

0 comments on commit a742a11

Please sign in to comment.