use of nl.nn.adapterframework.extensions.sap.SapException in project iaf by ibissource.
the class SapSender method getFunction.
public JCoFunction getFunction(SapSystem sapSystem, ParameterValueList pvl) throws SapException {
if (StringUtils.isNotEmpty(getSapSystemName()) && StringUtils.isNotEmpty(getFunctionName())) {
return getFunctionTemplate().getFunction();
}
String functionName = getFunctionName();
if (StringUtils.isEmpty(functionName)) {
if (pvl == null) {
throw new SapException("no parameters to determine functionName from");
}
ParameterValue pv = pvl.getParameterValue(getFunctionNameParam());
if (pv == null) {
throw new SapException("could not get ParameterValue for parameter [" + getFunctionNameParam() + "]");
}
functionName = pv.asStringValue(null);
}
if (StringUtils.isEmpty(functionName)) {
throw new SapException("could not determine functionName using parameter [" + getFunctionNameParam() + "]");
}
return getFunctionTemplate(sapSystem, functionName).getFunction();
}
use of nl.nn.adapterframework.extensions.sap.SapException in project iaf by ibissource.
the class JcoResourceHolder method commitAll.
public void commitAll() throws SapException {
for (Iterator<JCoDestination> itc = this.destinations.iterator(); itc.hasNext(); ) {
JCoDestination destination = itc.next();
List<String> tids = this.tidsPerDestination.get(destination);
for (Iterator<String> itt = tids.iterator(); itt.hasNext(); ) {
String tid = itt.next();
try {
destination.confirmTID(tid);
} catch (Throwable t) {
throw new SapException("Could not confirm TID [" + tid + "]");
}
}
}
}
use of nl.nn.adapterframework.extensions.sap.SapException in project iaf by ibissource.
the class SapFunctionFacade method openFacade.
public void openFacade() throws SapException {
if (sapSystem != null) {
sapSystem.openSystem();
log.info("open SapSystem [" + sapSystem.toString() + "]");
// Something has changed, so remove the cached templates
SapSystemDataProvider.getInstance().updateSystem(sapSystem);
if (StringUtils.isNotEmpty(getFunctionName())) {
// Listeners and IdocSenders don't use a functionName
ftemplate = getFunctionTemplate(sapSystem, getFunctionName());
log.debug("found JCoFunctionTemplate [" + ftemplate.toString() + "]");
try {
calculateStaticFieldIndices(ftemplate);
} catch (Exception e) {
throw new SapException(getLogPrefix() + "Exception calculation field-indices [" + getFunctionName() + "]", e);
}
}
} else {
log.info("open ALL SapSystems");
SapSystem.openSystems();
}
}
use of nl.nn.adapterframework.extensions.sap.SapException in project iaf by ibissource.
the class SapSystem method initSystem.
private void initSystem() throws SapException {
try {
SapSystemDataProvider.getInstance().updateSystem(this);
if (log.isDebugEnabled() && getTraceLevel() > 0) {
String logPath = AppConstants.getInstance().getResolvedProperty("logging.path");
JCo.setTrace(getTraceLevel(), logPath);
}
} catch (Throwable t) {
throw new SapException(getLogPrefix() + "exception initializing", t);
}
}
Aggregations