throw e;
} finally {
SharkUtilities.releaseMappingTransaction(t);
}
}
SessionHandle shandle=null;
String tacn=(tad!=null) ? tad.getToolAgentClassName() : defaultToolAgentClassName;
String uname=(tad!=null) ? tad.getUsername() : "";
String pwd=(tad!=null) ? tad.getPassword() : "";
String appN=(tad!=null) ? tad.getApplicationName() : "";
Integer appM=(tad!=null) ? tad.getApplicationMode() : null;
ToolAgent ta=SharkEngineManager.getInstance().
getToolAgentFactory().
createToolAgent(transaction,tacn);
// try to connect to the tool agent
try {
shandle=ta.connect(transaction,uname,pwd,cus.getProperty("enginename","imaobihostrezube"),"");
} catch (ConnectFailed cf) {
cus.error("Activity"+activity.toString()+" - connection to Tool agent "+tacn+" failed !");
throw cf;
}
String procId=activity.container(transaction).key(transaction);
String actKey=activity.key(transaction);
String assId=getAssignmentId(procId,actKey);
// invoke the procedure with the specified parameters
AppParameter[] aprs=(AppParameter[])parameters.toArray(
new AppParameter[parameters.size()]);
ta.invokeApplication(transaction,
shandle.getHandle(),
appN,
procId,
assId,
aprs,
appM);
long appStatus;
appStatus=ta.requestAppStatus(transaction,
shandle.getHandle(),
procId,
assId,
aprs);
if (appStatus==APP_STATUS_INVALID) {
ta.disconnect(transaction,shandle);