Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Jun 5, 2020
2 parents 46c486e + c5b32ed commit 381c22f
Show file tree
Hide file tree
Showing 35 changed files with 2,193 additions and 1,494 deletions.
Expand Up @@ -1597,10 +1597,77 @@
<xsd:complexContent>
<xsd:extension base="tns:TraceType">
<xsd:sequence>
<xsd:element name="input" type="tns:NamedValueType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="destination" type="t:PlusMinusZeroType" minOccurs="0" />
<xsd:element name="output" type="tns:AnyValueType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" />
<xsd:element name="input" type="tns:NamedValueType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Selected values from individual sources. Variable values are not stored here.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="hasPlus" type="xsd:boolean" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Does this tuple contain a value that is present in plus set of its source?
(This is an internal implementation information. So this item can change in later versions.)
</xsd:documentation>
<xsd:appinfo>
<a:since>4.2</a:since>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="hasMinus" type="xsd:boolean" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Does this tuple contain a value that is present in minus set of its source?
(This is an internal implementation information. So this item can change in later versions.)
</xsd:documentation>
<xsd:appinfo>
<a:since>4.2</a:since>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="hasZero" type="xsd:boolean" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Does this tuple contain a value that is present in zero set of its source?
(This is an internal implementation information. So this item can change in later versions.)
</xsd:documentation>
<xsd:appinfo>
<a:since>4.2</a:since>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="destination" type="t:PlusMinusZeroType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
To what set should the output go? (Named "outputSet" in the algorithm since 4.2.)
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="conditionResult" type="xsd:boolean" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Result of the condition evaluation.
</xsd:documentation>
<xsd:appinfo>
<a:since>4.2</a:since>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="output" type="tns:AnyValueType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Result of the transformation. (Named "transformationResult" in the algorithm since 4.2.)
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="comment" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Free-form comment from the algorithm.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
Expand Down
Expand Up @@ -98,7 +98,7 @@ public PrismValueDeltaSetTriple<V> evaluate(ExpressionEvaluationContext context,
if (valuePolicyType == null) {
ValuePolicyResolver valuePolicyResolver = context.getValuePolicyResolver();
if (valuePolicyResolver != null) {
valuePolicyType = valuePolicyResolver.resolve();
valuePolicyType = valuePolicyResolver.resolve(result);
}
}

Expand Down
Expand Up @@ -152,14 +152,11 @@ void evaluate() {
try {
if (!combinatorialEvaluation.evaluator.isIncludeNullInputs() && MiscUtil.isAllNull(valuesTuple)) {
// The case that all the sources are null. There is no point executing the expression.
setTraceComment("All sources are null and includeNullInputs is true");
setTraceComment("All sources are null and includeNullInputs is true.");
return;
}
ExpressionVariables staticVariables = createStaticVariablesFromSources();

LOGGER.trace("Processing value combination {} in {}\n hasPlus={}, hasZero={}, hasMinus={}, skipEvaluationPlus={}, skipEvaluationMinus={}",
dumpValueTupleLazily(), context.getContextDescription(), hasPlus, hasZero, hasMinus,
context.isSkipEvaluationPlus(), context.isSkipEvaluationMinus());
recordBeforeTransformation();

if (isApplicableRegardingPlusMinusSetPresence()) {

Expand Down Expand Up @@ -289,7 +286,7 @@ private void evaluateConditionAndTransformation(ExpressionVariables staticVariab
if (conditionResult) {
transformationResult = evaluateTransformation(staticVariables);
} else {
LOGGER.trace("Skipping value transformation because condition evaluated to false in {}", context.getContextDescription());
setTraceComment("Skipping value transformation because condition evaluated to false.");
transformationResult = emptySet();
}
} catch (ExpressionEvaluationException e) {
Expand Down Expand Up @@ -330,7 +327,7 @@ private List<V> evaluateTransformation(ExpressionVariables staticVariables) thro
}

private void setTraceComment(String comment) {
LOGGER.trace(comment);
LOGGER.trace("{} In {}.", comment, context.getContextDescription());
if (trace != null) {
trace.setComment(comment);
}
Expand Down Expand Up @@ -363,13 +360,25 @@ private void dumpValueCombinationToTrace() {
}
}

private void recordBeforeTransformation() {
LOGGER.trace("Processing value combination {} in {}\n hasPlus={}, hasZero={}, hasMinus={}, skipEvaluationPlus={}, skipEvaluationMinus={}",
dumpValueTupleLazily(), context.getContextDescription(), hasPlus, hasZero, hasMinus,
context.isSkipEvaluationPlus(), context.isSkipEvaluationMinus());
if (trace != null) {
trace.setHasPlus(hasPlus);
trace.setHasMinus(hasMinus);
trace.setHasZero(hasZero);
}
}

private void recordTransformationResult() {
LOGGER.trace("Processed value tuple {} in {}\n valueDestination: {}\n scriptResults:{}{}",
dumpValueTupleLazily(), context.getContextDescription(), outputSet, transformationResult,
conditionResult ? "" : " (condition evaluated to false)");

if (trace != null) {
trace.setDestination(PlusMinusZeroType.fromValue(outputSet));
trace.setConditionResult(conditionResult);
trace.getOutput().addAll(TraceUtil.toAnyValueTypeList(transformationResult, combinatorialEvaluation.prismContext));
}
}
Expand Down

0 comments on commit 381c22f

Please sign in to comment.