@Override
    public void executeWithValues(Collection<IAnnotatedValue> values, IAsyncMessageClient clientCallback) throws ModelException
    {
        // a new conversation ID is generated
        String conversationId = this.idGenerator.getSId();

        if (null != this.getServiceImplementation())
        {
            IFunctionalityImplementation functionalityImplementation
                    = this.getServiceImplementation().getFunctionalityImplementation(this.name());
            if (null != functionalityImplementation)
            {
                // if there is an implementation for this functionality, its execution is invoked
                //and the results are sent back using the clientCallback
                this.registerInternalChannelsFor(this.name(), clientCallback, conversationId);
                Collection<IResult> results = 
                        functionalityImplementation.executeWithValues(
                                values,
                                new FunctionalityExecutionVO(clientCallback.getName(), conversationId));
                BSDFLogger.getLogger().info("Sends functionality implementation result to callback");
                clientCallback.receiveMessage(
                        new FunctionalityResultMessage(results,
                                this.name(),
                                clientCallback.getName(),
                                conversationId));
                return;
            }
        }

        // a clientChannel is obtained to receive result messages
        this.getClientChannelFor(this.name(), clientCallback, conversationId);
        // when there is not an implementation, the control channel is used to send and execution message...
        this.serviceGrounding.getControlChannelProducer().send(
                new FunctionalityExecMessage(values, this.name(), clientCallback.getName(), conversationId));
        BSDFLogger.getLogger().info("Sends FunctionalityExecMessage to grounding: " + this.serviceGrounding.toString());

    }
@ Override public void executeWithValues ( Collection < IAnnotatedValue > values , IAsyncMessageClient clientCallback ) throws ModelException { String conversationId = this . idGenerator . getSId ( ) ; if ( null != this . getServiceImplementation ( ) ) { IFunctionalityImplementation functionalityImplementation = this . getServiceImplementation ( ) . getFunctionalityImplementation ( this . name ( ) ) ; if ( null != functionalityImplementation ) { this . registerInternalChannelsFor ( this . name ( ) , clientCallback , conversationId ) ; Collection < IResult > results = functionalityImplementation . executeWithValues ( values , new FunctionalityExecutionVO ( clientCallback . getName ( ) , conversationId ) ) ; BSDFLogger . getLogger ( ) . info ( "Sends functionality implementation result to callback" ) ; clientCallback . receiveMessage ( new FunctionalityResultMessage ( results , this . name ( ) , clientCallback . getName ( ) , conversationId ) ) ; return ; } } this . getClientChannelFor ( this . name ( ) , clientCallback , conversationId ) ; this . serviceGrounding . getControlChannelProducer ( ) . send ( new FunctionalityExecMessage ( values , this . name ( ) , clientCallback . getName ( ) , conversationId ) ) ; BSDFLogger . getLogger ( ) . info ( "Sends FunctionalityExecMessage to grounding: " + this . serviceGrounding . toString ( ) ) ; }
/*
It executes the functionality, using the given inputs and communicating the result
via the given IAsyncMessageClient callback.
The execution can be resolved in two ways: using a functionality implementation
(if there is any) or communicating throught the grounding.