All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.evaluatorFooter.mustache Maven / Gradle / Ivy

The newest version!

        // Evaluate properties that needs EL, validate evaluatedConf and returns it
        Completable toEvalCompletable = Flowable.fromIterable(toEval).concatMapMaybe(m -> m).ignoreElements();
        Completable toEvalListCompletable = Flowable.fromIterable(toEvalList).concatMapMaybe(m -> m).ignoreElements();
        Completable toEvalHeaderListCompletable = Flowable.fromIterable(toEvalHeaderList).concatMapMaybe(m -> m).ignoreElements();

        return Completable.concatArray(toEvalCompletable, toEvalListCompletable, toEvalHeaderListCompletable)
            .andThen(Completable.fromRunnable(() -> validateConfiguration(evaluatedConfiguration)))
            .andThen(Completable.fromRunnable(() -> {
                if(baseExecutionContext != null) {
                    baseExecutionContext.setInternalAttribute("{{evaluatedConfigurationName}}-"+this.internalId, evaluatedConfiguration);
                }
            }))
            .onErrorResumeNext(t -> {
                if(baseExecutionContext != null) {
                    return ((HttpPlainExecutionContext)baseExecutionContext).interruptWith(new ExecutionFailure(500).message("Invalid configuration").key(FAILURE_CONFIGURATION_INVALID));
                }
                return Completable.error(t);
            })
            .toSingle(() -> evaluatedConfiguration);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy