private Either<FEELEvent, Object> actualInputsMatchInputValues(EvaluationContext ctx, Object[] params) {
        // check that all the parameters match the input list values if they are defined
        for( int i = 0; i < params.length; i++ ) {
            final DTInputClause input = inputs.get( i );
            // if a list of values is defined, check the the parameter matches the value
            if ( input.getInputValues() != null && ! input.getInputValues().isEmpty() ) {
                final Object parameter = params[i];
                boolean satisfies = input.getInputValues().stream().map( ut -> ut.apply( ctx, parameter ) ).filter( Boolean::booleanValue ).findAny().orElse( false );

                if ( !satisfies ) {
                    String values = input.getInputValuesText();
                    return Either.ofLeft(new InvalidInputEvent( FEELEvent.Severity.ERROR,
                                                  input.getInputExpression()+"='" + parameter + "' does not match any of the valid values " + values + " for decision table '" + getName() + "'.",
                                                  getName(),
                                                  null,
                                                  values )
                            );
                }
            }
        }
        return Either.ofRight(true);
    }
private Either < FEELEvent , Object > actualInputsMatchInputValues ( EvaluationContext ctx , Object [ ] params ) { for ( int i = 0 ; i < params . length ; i ++ ) { final DTInputClause input = inputs . get ( i ) ; if ( input . getInputValues ( ) != null && ! input . getInputValues ( ) . isEmpty ( ) ) { final Object parameter = params [ i ] ; boolean satisfies = input . getInputValues ( ) . stream ( ) . map ( ut -> ut . apply ( ctx , parameter ) ) . filter ( Boolean :: booleanValue ) . findAny ( ) . orElse ( false ) ; if ( ! satisfies ) { String values = input . getInputValuesText ( ) ; return Either . ofLeft ( new InvalidInputEvent ( FEELEvent . Severity . ERROR , input . getInputExpression ( ) + "='" + parameter + "' does not match any of the valid values " + values + " for decision table '" + getName ( ) + "'." , getName ( ) , null , values ) ) ; } } } return Either . ofRight ( true ) ; }
If valid input values are defined, check that all parameters match the respective valid inputs
@param ctx
@param params
@return