@Override public int hashCode() { return Objects.hash(getStep()); } }
@Override public int hashCode() { return Objects.hash(getStep()); } }
private FactMapping(FactMapping original) { original.expressionElements.forEach(expressionElement -> this.addExpressionElement(expressionElement.getStep(), original.className)); this.expressionIdentifier = original.expressionIdentifier; this.factIdentifier = original.factIdentifier; this.className = original.className; this.factAlias = original.factAlias; this.expressionAlias = original.expressionAlias; }
private FactMapping(FactMapping original) { original.expressionElements.forEach(expressionElement -> this.addExpressionElement(expressionElement.getStep(), original.className)); this.expressionIdentifier = original.expressionIdentifier; this.factIdentifier = original.factIdentifier; this.className = original.className; this.factAlias = original.factAlias; this.expressionAlias = original.expressionAlias; }
@SuppressWarnings("unchecked") protected ResultWrapper getSingleFactValueResult(FactMapping factMapping, FactMappingValue expectedResult, DMNDecisionResult decisionResult, ExpressionEvaluator expressionEvaluator) { Object resultRaw = decisionResult.getResult(); if (!SUCCEEDED.equals(decisionResult.getEvaluationStatus())) { return createErrorResult(); } for (ExpressionElement expressionElement : factMapping.getExpressionElementsWithoutClass()) { if (!(resultRaw instanceof Map)) { throw new ScenarioException("Wrong resultRaw structure because it is not a complex type as expected"); } Map<String, Object> result = (Map<String, Object>) resultRaw; resultRaw = result.get(expressionElement.getStep()); } Class<?> resultClass = resultRaw != null ? resultRaw.getClass() : null; try { return expressionEvaluator.evaluate(expectedResult.getRawValue(), resultRaw, resultClass) ? createResult(resultRaw) : createErrorResult(); } catch (Exception e) { expectedResult.setError(true); throw new ScenarioException(e.getMessage(), e); } }