Transaction Using the Dynamic Java Connector
You use the dynamic Java connector to do a JD Edwards EnterpriseOne transaction in either automatic or manual mode. This example code for a purchase order entry transaction shows the steps for using the dynamic Java connector in manual mode.
int sessionID = Connector.getInstance().login("user", "pwd", "env", "role"); UserSession userSession = Connector.getInstance().getUserSession (sessionID); boolean isManulCommit; //set isManualCommit as true or false //Step 1: create OneWorldTransaction OneworldTransaction transaction = userSession.createOneworldTransaction (isManualCommit); // Step2: create the Purchase Order Entry executable methods (such as // poeBeginDoc, poeEditLine, poeEndDoc) from the BSFN metadata. //Step 3: begin the transaction transaction.begin(); //Step 4: run BSFNs in this transaction //set poeBeginDoc input parameters (code not provided) BSFNExecutionWarning warning = poeBeginDoc.execute(transaction); //set poeEditLine input parameters (code not provided) BSFNExecutionWarning warning = poeEditLine.execute(transaction); //set poeEndDocinput parameters (code not provided) BSFNExecutionWarning warning = poeEndDoc.execute(transaction); //Step 5: Commit or rollback transaction transaction.commit(); //or transaction.rollback();