Search in sources :

Example 1 with JCoFunction

use of com.sap.conn.jco.JCoFunction in project iaf by ibissource.

the class SapSender method sendMessage.

public String sendMessage(String correlationID, String message, ParameterResolutionContext prc) throws SenderException, TimeOutException {
    String tid = null;
    try {
        ParameterValueList pvl = null;
        if (prc != null) {
            pvl = prc.getValues(paramList);
        }
        SapSystem sapSystem = getSystem(pvl);
        JCoFunction function = getFunction(sapSystem, pvl);
        if (StringUtils.isEmpty(getSapSystemName())) {
            pvl.removeParameterValue(getSapSystemNameParam());
        }
        if (StringUtils.isEmpty(getFunctionName())) {
            pvl.removeParameterValue(getFunctionNameParam());
        }
        message2FunctionCall(function, message, correlationID, pvl);
        if (log.isDebugEnabled())
            log.debug(getLogPrefix() + " function call [" + functionCall2message(function) + "]");
        JCoDestination destination = getDestination(prc.getSession(), sapSystem);
        tid = getTid(destination, sapSystem);
        if (StringUtils.isEmpty(tid)) {
            function.execute(destination);
        } else {
            function.execute(destination, tid);
        }
        if (isSynchronous()) {
            return functionResult2message(function);
        } else {
            return tid;
        }
    } catch (Exception e) {
        throw new SenderException(e);
    }
}
Also used : ParameterValueList(nl.nn.adapterframework.parameters.ParameterValueList) JCoFunction(com.sap.conn.jco.JCoFunction) JCoDestination(com.sap.conn.jco.JCoDestination) SenderException(nl.nn.adapterframework.core.SenderException) SenderException(nl.nn.adapterframework.core.SenderException) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) TimeOutException(nl.nn.adapterframework.core.TimeOutException)

Aggregations

JCoDestination (com.sap.conn.jco.JCoDestination)1 JCoFunction (com.sap.conn.jco.JCoFunction)1 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)1 SenderException (nl.nn.adapterframework.core.SenderException)1 TimeOutException (nl.nn.adapterframework.core.TimeOutException)1 ParameterValueList (nl.nn.adapterframework.parameters.ParameterValueList)1