@Override protected void onInit() { super.onInit(); if (this.evaluationContext == null) { this.evaluationContext = createEvaluationContext(); } }
/** * If we don't need variables (i.e., resource is null) * we can use a singleton context; otherwise we need a new one each time. * @param resource The resource * @return The context. */ private EvaluationContext prepareEvaluationContextToUse(Object resource) { if (resource != null) { EvaluationContext evaluationContextWithVariables = createEvaluationContext(); if (resource instanceof IntegrationResourceHolder) { IntegrationResourceHolder holder = (IntegrationResourceHolder) resource; for (Entry<String, Object> entry : holder.getAttributes().entrySet()) { String key = entry.getKey(); evaluationContextWithVariables.setVariable(key, entry.getValue()); } } return evaluationContextWithVariables; } else { return this.evaluationContext; } }
@Override protected void onInit() { super.onInit(); if (this.evaluationContext == null) { this.evaluationContext = createEvaluationContext(); } }
/** * If we don't need variables (i.e., resource is null) * we can use a singleton context; otherwise we need a new one each time. * @param resource The resource * @return The context. */ private EvaluationContext prepareEvaluationContextToUse(Object resource) { if (resource != null) { EvaluationContext evaluationContextWithVariables = createEvaluationContext(); if (resource instanceof IntegrationResourceHolder) { IntegrationResourceHolder holder = (IntegrationResourceHolder) resource; for (Entry<String, Object> entry : holder.getAttributes().entrySet()) { String key = entry.getKey(); evaluationContextWithVariables.setVariable(key, entry.getValue()); } } return evaluationContextWithVariables; } else { return this.evaluationContext; } }