Commit a05360f8 authored by akhokar's avatar akhokar

Changes done to invoke process method from events affecting confirmation.

ShiftProcess.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@206921 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e33c5d87
......@@ -12,8 +12,9 @@ import javax.ejb.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.GenericUtility;
//import ibase.webitm.utility.GenericUtility;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.system.config.*;
//Changed by Dhiraj req ID: AD01SUN008 [05/10/10].start
import javax.naming.InitialContext;
......@@ -41,8 +42,10 @@ public class ShiftProcess extends ProcessEJB implements ShiftProcessLocal,ShiftP
AdmCommon admCommon = new AdmCommon();
GenericUtility genericUtility = GenericUtility.getInstance();
//Modified by Azhar on [06-Sep-2019][As per new framework][Start]
//GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
//Modified by Azhar on [06-Sep-2019][As per new framework][End]
CommonConstants commonConstants = new CommonConstants();
......@@ -88,9 +91,15 @@ public class ShiftProcess extends ProcessEJB implements ShiftProcessLocal,ShiftP
Document headerDom = null;
Document detailDom = null;
String userId = "";
//Modified by Azhar on[06-Sep-2019][Conn created to invoke process method from Events Affecting Confirmation][Start]
Connection conn = null;
//Modified by Azhar on[06-Sep-2019][Conn created to invoke process method from Events Affecting Confirmation][End]
try
{
//Modified by Azhar on[06-Sep-2019][Conn created to invoke process method from Events Affecting Confirmation][Start]
conn = getConnection();
//Modified by Azhar on[06-Sep-2019][Conn created to invoke process method from Events Affecting Confirmation][End]
System.out.println("xtraParams :: " + xtraParams);
System.out.println("xmlString2 :: " + xmlString2);
System.out.println("xmlString :: " + xmlString);
......@@ -114,7 +123,20 @@ public class ShiftProcess extends ProcessEJB implements ShiftProcessLocal,ShiftP
System.out.println("XML String2 :"+xmlString2);
detailDom = genericUtility.parseString(xmlString2);
}
rtrStr = process(headerDom, detailDom, windowName, xtraParams);
//Modified by Azhar on[06-Sep-2019][To invoke process method from Events Affecting Confirmation][Start]
//rtrStr = process(headerDom, detailDom, windowName, xtraParams);
rtrStr = process(headerDom, detailDom, windowName, xtraParams,conn);
if(rtrStr == null || rtrStr.trim().length() == 0)
{
conn.commit();
}
else
{
conn.rollback();
return rtrStr;
}
//Modified by Azhar on[06-Sep-2019][To invoke process method from Events Affecting Confirmation][End]
}
catch (Exception e)
{
......@@ -123,12 +145,35 @@ public class ShiftProcess extends ProcessEJB implements ShiftProcessLocal,ShiftP
//rtrStr = itmDBAccessEJB.getErrorString("","VTPROUNSUC",userId);
throw new ITMException(e);
}
//Modified by Azhar on[06-Sep-2019][To invoke process method from Events Affecting Confirmation][Start]
finally
{
try
{
if(conn != null)
{
conn.close();
conn = null;
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
//Modified by Azhar on[06-Sep-2019][To invoke process method from Events Affecting Confirmation][End]
return rtrStr;
}
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
//Modified by Azhar on[06-Sep-2019][To invoke process method from Events Affecting Confirmation][Start]
//public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams,Connection conn) throws RemoteException,ITMException
//Modified by Azhar on[06-Sep-2019][To invoke process method from Events Affecting Confirmation][End]
{
ConnDriver connDriver = null;
//Commented by Azhar on[06-Sep-2019][Connection created in above method][Start]
//ConnDriver connDriver = null;
//Commented by Azhar on[06-Sep-2019][Connection created in above method][End]
System.out.println("Process function called from process().........");
String empCodeFr = "", empCodeTo = "" ;
......@@ -171,7 +216,9 @@ public class ShiftProcess extends ProcessEJB implements ShiftProcessLocal,ShiftP
int count=0;
int upd =0;
int counter=0;
Connection conn = null;
//Commented by Azhar on[06-Sep-2019][Shifted in above method][Start]
//Connection conn = null;
//Commented by Azhar on[06-Sep-2019][Shifted in above method][End]
ResultSet rsn1 = null,rsn2=null,rsn3=null,rsn4=null;
ResultSet rs1 = null;
PreparedStatement pstmtn1=null,pstmtn2=null,pstmtn3=null,pstmtn4=null;
......@@ -214,9 +261,13 @@ public class ShiftProcess extends ProcessEJB implements ShiftProcessLocal,ShiftP
//itmdbAccessLocal = (ITMDBAccessLocal)ctx.lookup("ibase/ITMDBAccessEJB/local");
itmDBAccess = new ITMDBAccessEJB();
//Changed by Dhiraj 06/10/10 [AD01SUN008].end
connDriver = new ConnDriver();
//Commented by Azhar on[06-Sep-2019][Connection created in above method][Start]
//connDriver = new ConnDriver();
//Commented by Azhar on[06-Sep-2019][Connection created in above method][End]
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat());
conn = connDriver.getConnectDB("DriverITM");
//Commented by Azhar on[06-Sep-2019][Shifted in above method][Start]
//conn = connDriver.getConnectDB("DriverITM");
//Commented by Azhar on[06-Sep-2019][Shifted in above method][End]
System.out.println("xtraParams :"+xtraParams);
conn.setAutoCommit(false);
if( xtraParams != null )
......@@ -949,7 +1000,9 @@ public class ShiftProcess extends ProcessEJB implements ShiftProcessLocal,ShiftP
else
{
System.out.println("Process complete");
conn.commit();
//Commented by Azhar on [06-Sep-2019][Shifted in above method][Start]
//conn.commit();
//Commented by Azhar on [06-Sep-2019][Shifted in above method][End]
//Added by Santosh on [19/12/11][to solve the issue when called on Employee Event Confirmation][Start] -->
if(patternCodeFilt != null && patternCodeFilt.length() > 0)
{
......@@ -1002,11 +1055,12 @@ public class ShiftProcess extends ProcessEJB implements ShiftProcessLocal,ShiftP
{
try
{
if(conn != null)
//Commented by Azhar on [06-Sep-2019][Shifted in above method][Start]
/*if(conn != null)
{
conn.close();
conn = null;
conn = null;*/
//Commented by Azhar on [06-Sep-2019][Shifted in above method][End]
if(pstmtn1!=null)
{
pstmtn1.close();
......@@ -1017,7 +1071,7 @@ public class ShiftProcess extends ProcessEJB implements ShiftProcessLocal,ShiftP
pstmtn3.close();
pstmtn3=null;
}
}
//}
}
catch(Exception e)
{
......@@ -1332,7 +1386,10 @@ public class ShiftProcess extends ProcessEJB implements ShiftProcessLocal,ShiftP
System.out.println("\n\n shiftIndex "+shiftIndex);
try{
patternList = GenericUtility.getInstance().getTokenList(shiftPattern,";");
//Modified by Azhar on [06-Sep-2019][Changes as per new framework][Start]
//patternList = GenericUtility.getInstance().getTokenList(shiftPattern,";");
patternList = genericUtility.getTokenList(shiftPattern,";");
//Modified by Azhar on [06-Sep-2019][Changes as per new framework][End]
System.out.println("noOfDays :"+noOfDays+"noDays :"+noDays);
if (shiftIndex > noOfDays )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment