По шагам:
1. Создаем наш класс
1. Создаем наш класс
package oracle.apps.test; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.InvocationTargetException; import java.sql.Connection; import java.sql.SQLException; import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import oracle.apps.fnd.common.Message; import oracle.apps.fnd.cp.request.CpContext; import oracle.apps.fnd.cp.request.JavaConcurrentProgram; import oracle.apps.fnd.cp.request.LogFile; import oracle.apps.fnd.cp.request.ReqCompletion; public class MyJavaTest implements JavaConcurrentProgram { public static final String APPLICATION_SHORT_NAME = "XXXX"; public static final String CONCURRENT_PROGRAM_NAME = "MY_CONC_PROGRAM"; private Connection connection; private int requestId; private LogFile logFile; private ReqCompletion reqCompletion; public void initialize(CpContext cpContext) throws SQLException, XMLParseException, SAXException, IOException, InstantiationException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException { connection = cpContext.getJDBCConnection(); requestId = cpContext.getReqDetails().getRequestId(); logFile = cpContext.getLogFile(); reqCompletion = cpContext.getReqCompletion(); Enumeration params = cpContext.getReqDetails().getParaInfo().elements(); String Value = (String)params.nextElement(); int fileId = Integer.parseInt(Value); // some code } public void runProgram(CpContext cpContext) { try { initialize(cpContext); // some code connection.commit(); // успешное заверщение канкарента Message normComplMessage = new Message("FND", "CONC-CP SUCCESSFUL TERMINATION"); reqCompletion.setCompletion(ReqCompletion.NORMAL, normComplMessage.getMessageText(cpContext.getResourceStore())); } catch (Exception e) { reqCompletion.setCompletion(ReqCompletion.ERROR, e.getMessage()); StringWriter errStringWriter = new StringWriter(); PrintWriter errPrintWriter = new PrintWriter(errStringWriter, true); e.printStackTrace(errPrintWriter); logFile.writeln(errStringWriter.toString(), LogFile.ERROR); } finally { cpContext.releaseJDBCConnection(); } } }2. Создаем канкарент