first commit

This commit is contained in:
2025-07-28 13:56:49 +05:30
commit e9eb805edb
3438 changed files with 520990 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class DocHistoryDtlBean extends BaseDetailBean implements Serializable {
private String txtSrlNo = "";
private String txtEmpNum = "";
private String txtStartTime = "";
private String txtDuration = "";
private String txtActivity = "";
private String txtDocType = "";
public String getTxtSrlNo() {
return this.txtSrlNo;
}
public void setTxtSrlNo(String newTxtSrlNo) {
this.txtSrlNo = newTxtSrlNo;
}
public String getTxtEmpNum() {
return this.txtEmpNum;
}
public void setTxtEmpNum(String newTxtEmpNum) {
this.txtEmpNum = newTxtEmpNum;
}
public String getTxtStartTime() {
return this.txtStartTime;
}
public void setTxtStartTime(String newTxtStartTime) {
this.txtStartTime = newTxtStartTime;
}
public String getTxtDuration() {
return this.txtDuration;
}
public void setTxtDuration(String newTxtDuration) {
this.txtDuration = newTxtDuration;
}
public String getTxtActivity() {
return this.txtActivity;
}
public void setTxtActivity(String newTxtActivity) {
this.txtActivity = newTxtActivity;
}
public String getTxtDocType() {
return this.txtDocType;
}
public void setTxtDocType(String newTxtDocType) {
this.txtDocType = newTxtDocType;
}
}

View File

@@ -0,0 +1,146 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class WFLRouteDtlBean extends BaseDetailBean implements Serializable {
String txtEmpId;
String txtDeptId;
String txtGrpId;
String txtClassId;
String txtEmp;
String txtClassCode;
String txtLane;
String txtLevel;
String txtDept;
String txtHlevel;
String txtGroup;
String txtFlag;
String txtNotifFlag = "N";
private String txtReptHead;
public String getTxtEmpId() {
return this.txtEmpId;
}
public void setTxtEmpId(String newTxtEmpId) {
this.txtEmpId = newTxtEmpId;
}
public String getTxtDeptId() {
return this.txtDeptId;
}
public void setTxtDeptId(String newTxtDeptId) {
this.txtDeptId = newTxtDeptId;
}
public String getTxtGrpId() {
return this.txtGrpId;
}
public void setTxtGrpId(String newTxtGrpId) {
this.txtGrpId = newTxtGrpId;
}
public String getTxtClassId() {
return this.txtClassId;
}
public void setTxtClassId(String newTxtClassId) {
this.txtClassId = newTxtClassId;
}
public String getTxtEmp() {
return this.txtEmp;
}
public void setTxtEmp(String newTxtEmp) {
this.txtEmp = newTxtEmp;
}
public String getTxtClassCode() {
return this.txtClassCode;
}
public void setTxtClassCode(String newTxtClassCode) {
this.txtClassCode = newTxtClassCode;
}
public String getTxtLane() {
return this.txtLane;
}
public void setTxtLane(String newTxtLane) {
this.txtLane = newTxtLane;
}
public String getTxtLevel() {
return this.txtLevel;
}
public void setTxtLevel(String newTxtLevel) {
this.txtLevel = newTxtLevel;
}
public String getTxtDept() {
return this.txtDept;
}
public void setTxtDept(String newTxtDept) {
this.txtDept = newTxtDept;
}
public String getTxtHlevel() {
return this.txtHlevel;
}
public void setTxtHlevel(String newTxtHlevel) {
this.txtHlevel = newTxtHlevel;
}
public String getTxtGroup() {
return this.txtGroup;
}
public void setTxtGroup(String newTxtGroup) {
this.txtGroup = newTxtGroup;
}
public String getTxtFlag() {
return this.txtFlag;
}
public void setTxtFlag(String newTxtFlag) {
this.txtFlag = newTxtFlag;
}
public String getTxtNotifFlag() {
return this.txtNotifFlag;
}
public void setTxtNotifFlag(String newTxtNotifFlag) {
this.txtNotifFlag = newTxtNotifFlag;
}
public String getTxtReptHead() {
return this.txtReptHead;
}
public void setTxtReptHead(String newTxtReptHead) {
this.txtReptHead = newTxtReptHead;
}
}

View File

@@ -0,0 +1,66 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class WFLRouteHdrBean extends BaseHeaderBean implements Serializable {
public String actCode;
public String actCodeDesc;
public String dtlDocCode;
public String dtlDocDesc;
public String activityId;
public String dtlDocId;
public String getActCode() {
return this.actCode;
}
public void setActCode(String newActCode) {
this.actCode = newActCode;
}
public String getActCodeDesc() {
return this.actCodeDesc;
}
public void setActCodeDesc(String newActCodeDesc) {
this.actCodeDesc = newActCodeDesc;
}
public String getDtlDocCode() {
return this.dtlDocCode;
}
public void setDtlDocCode(String newDtlDocCode) {
this.dtlDocCode = newDtlDocCode;
}
public String getDtlDocDesc() {
return this.dtlDocDesc;
}
public void setDtlDocDesc(String newDtlDocDesc) {
this.dtlDocDesc = newDtlDocDesc;
}
public String getActivityId() {
return this.activityId;
}
public void setActivityId(String newActivityId) {
this.activityId = newActivityId;
}
public String getDtlDocId() {
return this.dtlDocId;
}
public void setDtlDocId(String newDtlDocId) {
this.dtlDocId = newDtlDocId;
}
}

View File

@@ -0,0 +1,96 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class WFLTransDtlBean extends BaseDetailBean implements Serializable {
public String txtFlane;
public String txtFLevel;
public String txtTLane;
public String txtCDesc;
public String txtCValue;
public String txtToRootDtlId;
public String txtFromRootDtlId;
String txtTLevel;
public String txtConditionId;
public String getTxtFlane() {
return this.txtFlane;
}
public void setTxtFlane(String newTxtFlane) {
this.txtFlane = newTxtFlane;
}
public String getTxtFLevel() {
return this.txtFLevel;
}
public void setTxtFLevel(String newTxtFLevel) {
this.txtFLevel = newTxtFLevel;
}
public String getTxtTLane() {
return this.txtTLane;
}
public void setTxtTLane(String newTxtTLane) {
this.txtTLane = newTxtTLane;
}
public String getTxtCDesc() {
return this.txtCDesc;
}
public void setTxtCDesc(String newTxtCDesc) {
this.txtCDesc = newTxtCDesc;
}
public String getTxtCValue() {
return this.txtCValue;
}
public void setTxtCValue(String newTxtCValue) {
this.txtCValue = newTxtCValue;
}
public String getTxtToRootDtlId() {
return this.txtToRootDtlId;
}
public void setTxtToRootDtlId(String newTxtToRootDtlId) {
this.txtToRootDtlId = newTxtToRootDtlId;
}
public String getTxtFromRootDtlId() {
return this.txtFromRootDtlId;
}
public void setTxtFromRootDtlId(String newTxtFromRootDtlId) {
this.txtFromRootDtlId = newTxtFromRootDtlId;
}
public String getTxtTLevel() {
return this.txtTLevel;
}
public void setTxtTLevel(String newTxtTLevel) {
this.txtTLevel = newTxtTLevel;
}
public String getTxtConditionId() {
return this.txtConditionId;
}
public void setTxtConditionId(String newTxtConditionId) {
this.txtConditionId = newTxtConditionId;
}
}

View File

@@ -0,0 +1,26 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class WflActMstDtlBean extends BaseDetailBean implements Serializable {
public String txtAttrCode;
public String txtAttrDesc;
public String getTxtAttrCode() {
return this.txtAttrCode;
}
public void setTxtAttrCode(String newTxtAttrCode) {
this.txtAttrCode = newTxtAttrCode;
}
public String getTxtAttrDesc() {
return this.txtAttrDesc;
}
public void setTxtAttrDesc(String newTxtAttrDesc) {
this.txtAttrDesc = newTxtAttrDesc;
}
}

View File

@@ -0,0 +1,25 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
public class WflAuthorizationBean implements Serializable {
private boolean authStatus;
private String errorCode;
public boolean isAuthStatus() {
return this.authStatus;
}
public void setAuthStatus(boolean newAuthStatus) {
this.authStatus = newAuthStatus;
}
public String getErrorCode() {
return this.errorCode;
}
public void setErrorCode(String newErrorCode) {
this.errorCode = newErrorCode;
}
}

View File

@@ -0,0 +1,56 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class WflDOPGrpDtlBean extends BaseDetailBean implements Serializable {
String txtempNo;
String txtHiLevel;
String dfltMembr;
String empId;
String txtEmpName;
public String getTxtempNo() {
return this.txtempNo;
}
public void setTxtempNo(String newTxtempNo) {
this.txtempNo = newTxtempNo;
}
public String getTxtHiLevel() {
return this.txtHiLevel;
}
public void setTxtHiLevel(String newTxtHiLevel) {
this.txtHiLevel = newTxtHiLevel;
}
public String getDfltMembr() {
return this.dfltMembr;
}
public void setDfltMembr(String newDfltMembr) {
this.dfltMembr = newDfltMembr;
}
public String getEmpId() {
return this.empId;
}
public void setEmpId(String newEmpId) {
this.empId = newEmpId;
}
public String getTxtEmpName() {
return this.txtEmpName;
}
public void setTxtEmpName(String newTxtEmpName) {
this.txtEmpName = newTxtEmpName;
}
}

View File

@@ -0,0 +1,46 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class WflDOPGrpHdrBean extends BaseHeaderBean implements Serializable {
String grpCode;
String grpDesc;
String remarks;
String grpFlag;
public String getGrpCode() {
return this.grpCode;
}
public void setGrpCode(String newGrpCode) {
this.grpCode = newGrpCode;
}
public String getGrpDesc() {
return this.grpDesc;
}
public void setGrpDesc(String newGrpDesc) {
this.grpDesc = newGrpDesc;
}
public String getRemarks() {
return this.remarks;
}
public void setRemarks(String newRemarks) {
this.remarks = newRemarks;
}
public String getGrpFlag() {
return this.grpFlag;
}
public void setGrpFlag(String newGrpFlag) {
this.grpFlag = newGrpFlag;
}
}

View File

@@ -0,0 +1,46 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class WflDelegateMstDtlBean extends BaseDetailBean implements Serializable {
private String txtDocType;
private String txtDesc;
String txtDocTypeId;
String disabbutDocType;
public String getTxtDocType() {
return this.txtDocType;
}
public void setTxtDocType(String newTxtDocType) {
this.txtDocType = newTxtDocType;
}
public String getTxtDesc() {
return this.txtDesc;
}
public void setTxtDesc(String newTxtDesc) {
this.txtDesc = newTxtDesc;
}
public String getTxtDocTypeId() {
return this.txtDocTypeId;
}
public void setTxtDocTypeId(String newTxtDocTypeId) {
this.txtDocTypeId = newTxtDocTypeId;
}
public String getDisabbutDocType() {
return this.disabbutDocType;
}
public void setDisabbutDocType(String newDisabbutDocType) {
this.disabbutDocType = newDisabbutDocType;
}
}

View File

@@ -0,0 +1,86 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class WflDelegateMstHdrBean extends BaseHeaderBean implements Serializable {
String empName;
String empNo;
String fromDate;
String toDate;
String delegateAll;
String empId;
String remarks;
String delegateAllDoc = "N";
public String getEmpName() {
return this.empName;
}
public void setEmpName(String newEmpName) {
this.empName = newEmpName;
}
public String getEmpNo() {
return this.empNo;
}
public void setEmpNo(String newEmpNo) {
this.empNo = newEmpNo;
}
public String getFromDate() {
return this.fromDate;
}
public void setFromDate(String newFromDate) {
this.fromDate = newFromDate;
}
public String getToDate() {
return this.toDate;
}
public void setToDate(String newToDate) {
this.toDate = newToDate;
}
public String getDelegateAll() {
return this.delegateAll;
}
public void setDelegateAll(String newDelegateAll) {
this.delegateAll = newDelegateAll;
}
public String getEmpId() {
return this.empId;
}
public void setEmpId(String newEmpId) {
this.empId = newEmpId;
}
public String getRemarks() {
return this.remarks;
}
public void setRemarks(String newRemarks) {
this.remarks = newRemarks;
}
public String getDelegateAllDoc() {
return this.delegateAllDoc;
}
public void setDelegateAllDoc(String newDelegateAllDoc) {
this.delegateAllDoc = newDelegateAllDoc;
}
}

View File

@@ -0,0 +1,56 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class WflDocMstAttrDtlBean extends BaseDetailBean implements Serializable {
private String txtAttrName;
private String txtType;
private String txtDesc;
private String docTypeHdrId;
public String txtLovKey;
public String getTxtAttrName() {
return this.txtAttrName;
}
public void setTxtAttrName(String newTxtAttrName) {
this.txtAttrName = newTxtAttrName;
}
public String getTxtType() {
return this.txtType;
}
public void setTxtType(String newTxtType) {
this.txtType = newTxtType;
}
public String getTxtDesc() {
return this.txtDesc;
}
public void setTxtDesc(String newTxtDesc) {
this.txtDesc = newTxtDesc;
}
public String getDocTypeHdrId() {
return this.docTypeHdrId;
}
public void setDocTypeHdrId(String newDocTypeHdrId) {
this.docTypeHdrId = newDocTypeHdrId;
}
public String getTxtLovKey() {
return this.txtLovKey;
}
public void setTxtLovKey(String newTxtLovKey) {
this.txtLovKey = newTxtLovKey;
}
}

View File

@@ -0,0 +1,26 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class WflDocMstConditionsDtlBean extends BaseDetailBean implements Serializable {
private String docTypeDtlDesc;
private String conditionExpression;
public String getDocTypeDtlDesc() {
return this.docTypeDtlDesc;
}
public void setDocTypeDtlDesc(String newDocTypeDtlDesc) {
this.docTypeDtlDesc = newDocTypeDtlDesc;
}
public String getConditionExpression() {
return this.conditionExpression;
}
public void setConditionExpression(String newConditionExpression) {
this.conditionExpression = newConditionExpression;
}
}

View File

@@ -0,0 +1,46 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class WflDocMstHdrBean extends BaseHeaderBean implements Serializable {
String documentDesc;
String documentCode;
private String screenName;
String maxAppLevel;
public String getDocumentDesc() {
return this.documentDesc;
}
public void setDocumentDesc(String newDocumentDesc) {
this.documentDesc = newDocumentDesc;
}
public String getDocumentCode() {
return this.documentCode;
}
public void setDocumentCode(String newDocumentCode) {
this.documentCode = newDocumentCode;
}
public String getScreenName() {
return this.screenName;
}
public void setScreenName(String newScreenName) {
this.screenName = newScreenName;
}
public String getMaxAppLevel() {
return this.maxAppLevel;
}
public void setMaxAppLevel(String newMaxAppLevel) {
this.maxAppLevel = newMaxAppLevel;
}
}

View File

@@ -0,0 +1,36 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class WflDocTypeDtlBean extends BaseDetailBean implements Serializable {
public String txtCode;
public String txtDesc;
public String txtActFlag;
public String getTxtCode() {
return this.txtCode;
}
public void setTxtCode(String newTxtCode) {
this.txtCode = newTxtCode;
}
public String getTxtDesc() {
return this.txtDesc;
}
public void setTxtDesc(String newTxtDesc) {
this.txtDesc = newTxtDesc;
}
public String getTxtActFlag() {
return this.txtActFlag;
}
public void setTxtActFlag(String newTxtActFlag) {
this.txtActFlag = newTxtActFlag;
}
}

View File

@@ -0,0 +1,46 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class WflDtlDocActivityMapDtlBean extends BaseDetailBean implements Serializable {
private String activityId;
private String activityCode;
private String activityDesc;
private String activityFlag;
public String getActivityId() {
return this.activityId;
}
public void setActivityId(String newActivityId) {
this.activityId = newActivityId;
}
public String getActivityCode() {
return this.activityCode;
}
public void setActivityCode(String newActivityCode) {
this.activityCode = newActivityCode;
}
public String getActivityDesc() {
return this.activityDesc;
}
public void setActivityDesc(String newActivityDesc) {
this.activityDesc = newActivityDesc;
}
public String getActivityFlag() {
return this.activityFlag;
}
public void setActivityFlag(String newActivityFlag) {
this.activityFlag = newActivityFlag;
}
}

View File

@@ -0,0 +1,56 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class WflDtlDocActivityMapHdrBean extends BaseHeaderBean implements Serializable {
private String dtlDocId;
private String dtlDocCode;
private String dtlDocDesc;
private String dtlDocActCode;
private String dtlDocActDesc;
public String getDtlDocId() {
return this.dtlDocId;
}
public void setDtlDocId(String newDtlDocId) {
this.dtlDocId = newDtlDocId;
}
public String getDtlDocCode() {
return this.dtlDocCode;
}
public void setDtlDocCode(String newDtlDocCode) {
this.dtlDocCode = newDtlDocCode;
}
public String getDtlDocDesc() {
return this.dtlDocDesc;
}
public void setDtlDocDesc(String newDtlDocDesc) {
this.dtlDocDesc = newDtlDocDesc;
}
public String getDtlDocActCode() {
return this.dtlDocActCode;
}
public void setDtlDocActCode(String newDtlDocActCode) {
this.dtlDocActCode = newDtlDocActCode;
}
public String getDtlDocActDesc() {
return this.dtlDocActDesc;
}
public void setDtlDocActDesc(String newDtlDocActDesc) {
this.dtlDocActDesc = newDtlDocActDesc;
}
}

View File

@@ -0,0 +1,76 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class WflDtlDocTypeDtlBean extends BaseDetailBean implements Serializable {
public String txtDtlDocCode;
public String txtDtlDocDesc;
public String txtConDesc;
public String txtExp;
public String txtPriority;
public String txtConditionId;
String disabbutCondDesc;
public String getTxtDtlDocCode() {
return this.txtDtlDocCode;
}
public void setTxtDtlDocCode(String newTxtDtlDocCode) {
this.txtDtlDocCode = newTxtDtlDocCode;
}
public String getTxtDtlDocDesc() {
return this.txtDtlDocDesc;
}
public void setTxtDtlDocDesc(String newTxtDtlDocDesc) {
this.txtDtlDocDesc = newTxtDtlDocDesc;
}
public String getTxtConDesc() {
return this.txtConDesc;
}
public void setTxtConDesc(String newTxtConDesc) {
this.txtConDesc = newTxtConDesc;
}
public String getTxtExp() {
return this.txtExp;
}
public void setTxtExp(String newTxtExp) {
this.txtExp = newTxtExp;
}
public String getTxtPriority() {
return this.txtPriority;
}
public void setTxtPriority(String newTxtPriority) {
this.txtPriority = newTxtPriority;
}
public String getTxtConditionId() {
return this.txtConditionId;
}
public void setTxtConditionId(String newTxtConditionId) {
this.txtConditionId = newTxtConditionId;
}
public String getDisabbutCondDesc() {
return this.disabbutCondDesc;
}
public void setDisabbutCondDesc(String newDisabbutCondDesc) {
this.disabbutCondDesc = newDisabbutCondDesc;
}
}

View File

@@ -0,0 +1,3 @@
package wenrgise.workflow.bean;
public class WflDtlDocTypeHdrBean {}

View File

@@ -0,0 +1,76 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class WflDtlsHdrBean extends BaseHeaderBean implements Serializable {
String toDtls;
String fromDtls;
String subjectDtls;
String descDtls;
String notifFlag;
String moduleId;
String moduleName;
public String getToDtls() {
return this.toDtls;
}
public void setToDtls(String newToDtls) {
this.toDtls = newToDtls;
}
public String getFromDtls() {
return this.fromDtls;
}
public void setFromDtls(String newFromDtls) {
this.fromDtls = newFromDtls;
}
public String getSubjectDtls() {
return this.subjectDtls;
}
public void setSubjectDtls(String newSubjectDtls) {
this.subjectDtls = newSubjectDtls;
}
public String getDescDtls() {
return this.descDtls;
}
public void setDescDtls(String newDescDtls) {
this.descDtls = newDescDtls;
}
public String getNotifFlag() {
return this.notifFlag;
}
public void setNotifFlag(String newNotifFlag) {
this.notifFlag = newNotifFlag;
}
public String getModuleId() {
return this.moduleId;
}
public void setModuleId(String newModuleId) {
this.moduleId = newModuleId;
}
public String getModuleName() {
return this.moduleName;
}
public void setModuleName(String newModuleName) {
this.moduleName = newModuleName;
}
}

View File

@@ -0,0 +1,135 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
public class WflWorkListBean implements Serializable {
private String txtDocNo;
private String txtAssignedOn;
private String txtDocTypeId;
private String txtSerialNo;
private String txtDocId;
private String txtEmpId;
private String txtActionName;
private String routeDtlId;
private String txtModuleId;
private String txtModuleCode;
private String txtDocTypeCode;
private String txtHiddenId;
private String txtEmpNo;
public String getTxtDocNo() {
return this.txtDocNo;
}
public void setTxtDocNo(String newTxtDocNo) {
this.txtDocNo = newTxtDocNo;
}
public String getTxtAssignedOn() {
return this.txtAssignedOn;
}
public void setTxtAssignedOn(String newTxtAssignedOn) {
this.txtAssignedOn = newTxtAssignedOn;
}
public String getTxtDocTypeId() {
return this.txtDocTypeId;
}
public void setTxtDocTypeId(String newTxtDocTypeId) {
this.txtDocTypeId = newTxtDocTypeId;
}
public String getTxtSerialNo() {
return this.txtSerialNo;
}
public void setTxtSerialNo(String newTxtSerialNo) {
this.txtSerialNo = newTxtSerialNo;
}
public String getTxtDocId() {
return this.txtDocId;
}
public void setTxtDocId(String newTxtDocId) {
this.txtDocId = newTxtDocId;
}
public String getTxtEmpId() {
return this.txtEmpId;
}
public void setTxtEmpId(String newTxtEmpId) {
this.txtEmpId = newTxtEmpId;
}
public String getTxtActionName() {
return this.txtActionName;
}
public void setTxtActionName(String newTxtActionName) {
this.txtActionName = newTxtActionName;
}
public String getRouteDtlId() {
return this.routeDtlId;
}
public void setRouteDtlId(String newRouteDtlId) {
this.routeDtlId = newRouteDtlId;
}
public String getTxtModuleId() {
return this.txtModuleId;
}
public void setTxtModuleId(String newTxtModuleId) {
this.txtModuleId = newTxtModuleId;
}
public String getTxtModuleCode() {
return this.txtModuleCode;
}
public void setTxtModuleCode(String newTxtModuleCode) {
this.txtModuleCode = newTxtModuleCode;
}
public String getTxtDocTypeCode() {
return this.txtDocTypeCode;
}
public void setTxtDocTypeCode(String newTxtDocTypeCode) {
this.txtDocTypeCode = newTxtDocTypeCode;
}
public String getTxtHiddenId() {
return this.txtHiddenId;
}
public void setTxtHiddenId(String newTxtHiddenId) {
this.txtHiddenId = newTxtHiddenId;
}
public String getTxtEmpNo() {
return this.txtEmpNo;
}
public void setTxtEmpNo(String newTxtEmpNo) {
this.txtEmpNo = newTxtEmpNo;
}
}

View File

@@ -0,0 +1,96 @@
package wenrgise.workflow.bean;
import java.io.Serializable;
import wenrgise.workflow.utility.Node;
public class WflWorkListInfoBean implements Serializable {
String docTypeCode;
String docId;
Node oNode;
String creatorempId;
String requestorEmpId;
String siteId;
String lastEmpId;
String assignedOn;
String status;
public String getDocTypeCode() {
return this.docTypeCode;
}
public void setDocTypeCode(String newDocTypeCode) {
this.docTypeCode = newDocTypeCode;
}
public String getDocId() {
return this.docId;
}
public void setDocId(String newDocId) {
this.docId = newDocId;
}
public Node getONode() {
return this.oNode;
}
public void setONode(Node newONode) {
this.oNode = newONode;
}
public String getCreatorempId() {
return this.creatorempId;
}
public void setCreatorempId(String newCreatorempId) {
this.creatorempId = newCreatorempId;
}
public String getRequestorEmpId() {
return this.requestorEmpId;
}
public void setRequestorEmpId(String newRequestorEmpId) {
this.requestorEmpId = newRequestorEmpId;
}
public String getSiteId() {
return this.siteId;
}
public void setSiteId(String newSiteId) {
this.siteId = newSiteId;
}
public String getLastEmpId() {
return this.lastEmpId;
}
public void setLastEmpId(String newLastEmpId) {
this.lastEmpId = newLastEmpId;
}
public String getAssignedOn() {
return this.assignedOn;
}
public void setAssignedOn(String newAssignedOn) {
this.assignedOn = newAssignedOn;
}
public String getStatus() {
return this.status;
}
public void setStatus(String newStatus) {
this.status = newStatus;
}
}

View File

@@ -0,0 +1,91 @@
package wenrgise.workflow.core;
public class WflConstants {
public static final String APPROVE = "Approve";
public static final String SUBMIT = "Submit";
public static final String REJECT = "Reject";
public static final String REVISE = "Revise";
public static final String CLOSE = "Close";
public static final String CANCEL = "Cancel";
public static final String PI = "PurchaseIndent";
public static final String TE = "TenderEnquiry";
public static final String QT = "Quotation";
public static final String TEP = "TenderEnquiryProposal";
public static final String PP = "PurchaseProposal";
public static final String PO = "PurchaseOrder";
public static final String DO = "DeliveryOrder";
public static final String DS = "DeliverySchedule";
public static final String LEAVE = "Leave";
public static final String LOAN = "Loan";
public static final String APPRAISAL = "Appraisal";
public static final String ADVANCE = "Advance";
public static final String TRANSFER = "Transfer";
public static final String DEPUTATION = "Deputation";
public static final String SEPARATION = "Separation";
public static final String TRAINING = "Training";
public static final String MR = "Marerial Requisition";
public static final String GRS = "Good Receipt Sheet";
public static final String MRN = "Material Return Note";
public static final String MIN = "Material Issue Note";
public static final String STNIN = "Stores Transfer Note IN";
public static final String STNOUT = "Stores Transfer Note Out";
public static final String SAJ = "Stores Adjustment";
public static final String CHALLAN = "Challan";
public static final String RSV = "Reservation";
public static final String REJECTED = "Rejected";
public static final String PENDING = "Pending";
public static final String FINALLY_APPROVED = "FinallyApproved";
public static final String APPROVED = "Approved";
public static final String REVISED = "Revised";
public static final String CLOSED = "Closed";
public static final String INITIATED = "Initiated";
public static final String SUCCESS = "Success";
public static final String ERROR = "Error";
public static final String MAIL_SENT = "MailSent";
public static final String TRUE = "true";
public static final String FALSE = "false";
public static final String SYSTEM_MAIL_ADDRESS = "enrgise@tcs.com";
}

View File

@@ -0,0 +1,13 @@
package wenrgise.workflow.core;
import java.io.Serializable;
public interface WflDepartment extends Serializable {
String getDepartmentId();
void setDepartmentId(String paramString);
String getDepartmentName();
void setDepartmentName(String paramString);
}

View File

@@ -0,0 +1,58 @@
package wenrgise.workflow.core;
import java.io.Serializable;
import java.util.HashMap;
public interface WflDocumentInfo extends Serializable {
WflResource getRequester();
void setRequester(WflResource paramWflResource);
WflResource getCreator();
void setCreator(WflResource paramWflResource);
String getRequesterAction();
void setRequesterAction(String paramString);
String getDocumentTypeId();
void setDocumentTypeId(String paramString);
String getDocumentId();
void setDocumentId(String paramString);
String getDocumentNumber();
void setDocumentNumber(String paramString);
String getModuleId();
void setModuleId(String paramString);
WflSite getSite();
void setSite(WflSite paramWflSite);
HashMap getDocumentAttributes();
void setDocumentAttributes(HashMap paramHashMap);
String getWorkListId();
void setWorkListId(String paramString);
String getDocumentType();
void setDocumentType(String paramString);
String getInitiatedFlag();
void setInitiatedFlag(String paramString);
String getDocDesc();
void setDocDesc(String paramString);
}

View File

@@ -0,0 +1,33 @@
package wenrgise.workflow.core;
import java.io.Serializable;
public interface WflResource extends Serializable {
String getEmployeeId();
void setEmployeeId(String paramString);
String getEmpNo();
void setEmpNo(String paramString);
WflSite getLoginSite();
void setLoginSite(WflSite paramWflSite);
String getUserId();
void setUserId(String paramString);
WflDepartment getDepartment();
void setDepartment(WflDepartment paramWflDepartment);
String getRouteDtlId();
void setRouteDtlId(String paramString);
String getDelegatedBy();
void setDelegatedBy(String paramString);
}

View File

@@ -0,0 +1,41 @@
package wenrgise.workflow.core;
import java.io.Serializable;
public interface WflRole extends Serializable {
String getApprovalLevel();
void setApprovalLevel(String paramString);
String getDeleteFlag();
void setDeleteFlag(String paramString);
String getDocTypeId();
void setDocTypeId(String paramString);
String getInsertFlag();
void setInsertFlag(String paramString);
String getPreAuditFlag();
void setPreAuditFlag(String paramString);
String getQueryFlag();
void setQueryFlag(String paramString);
String getRoleDesc();
void setRoleDesc(String paramString);
String getRoleId();
void setRoleId(String paramString);
String getUpdateFlag();
void setUpdateFlag(String paramString);
}

View File

@@ -0,0 +1,11 @@
package wenrgise.workflow.core;
import java.io.Serializable;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
public interface WflService extends Serializable {
WflStatus process(WflDocumentInfo paramWflDocumentInfo);
boolean canDo(WflDocumentInfo paramWflDocumentInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
}

View File

@@ -0,0 +1,17 @@
package wenrgise.workflow.core;
import java.io.Serializable;
public interface WflSite extends Serializable {
String getSiteId();
void setSiteId(String paramString);
String getSiteName();
void setSiteName(String paramString);
String getParentSiteId();
void setParentSiteId(String paramString);
}

View File

@@ -0,0 +1,21 @@
package wenrgise.workflow.core;
import java.io.Serializable;
public interface WflStatus extends Serializable {
String getStatus();
void setStatus(String paramString);
WflResource assignedTo();
void assign(WflResource paramWflResource);
String getErrCode();
void setErrCode(String paramString);
String getErrMsg();
void setErrMsg(String paramString);
}

View File

@@ -0,0 +1,10 @@
package wenrgise.workflow.core;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
public interface WorkFlow {
WflStatus start(WflDocumentInfo paramWflDocumentInfo);
boolean canDo(WflDocumentInfo paramWflDocumentInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
}

View File

@@ -0,0 +1,25 @@
package wenrgise.workflow.core.impl;
import wenrgise.workflow.core.WflDepartment;
public class WflDepartmentImpl implements WflDepartment {
private String departmentId;
private String departmentName;
public String getDepartmentId() {
return this.departmentId;
}
public void setDepartmentId(String newDepartmentId) {
this.departmentId = newDepartmentId;
}
public String getDepartmentName() {
return this.departmentName;
}
public void setDepartmentName(String newDepartmentName) {
this.departmentName = newDepartmentName;
}
}

View File

@@ -0,0 +1,138 @@
package wenrgise.workflow.core.impl;
import java.util.HashMap;
import wenrgise.workflow.core.WflDocumentInfo;
import wenrgise.workflow.core.WflResource;
import wenrgise.workflow.core.WflSite;
public class WflDocumentInfoImpl implements WflDocumentInfo {
private WflResource requester = null;
private WflResource creator = null;
private String requesterAction = null;
private String documentTypeId = null;
private String documentId = null;
private String documentNumber = null;
private String moduleId = null;
private WflSite site = null;
private HashMap documentAttributes;
private String workListId;
private String documentType = null;
private String initiatedFlag;
private String docDesc;
public WflResource getCreator() {
return this.creator;
}
public void setCreator(WflResource newCreator) {
this.creator = newCreator;
}
public String getDocumentId() {
return this.documentId;
}
public void setDocumentId(String newDocumentId) {
this.documentId = newDocumentId;
}
public String getDocumentNumber() {
return this.documentNumber;
}
public void setDocumentNumber(String newDocumentNumber) {
this.documentNumber = newDocumentNumber;
}
public String getDocumentTypeId() {
return this.documentTypeId;
}
public void setDocumentTypeId(String newDocumentTypeId) {
this.documentTypeId = newDocumentTypeId;
}
public String getModuleId() {
return this.moduleId;
}
public void setModuleId(String newModuleId) {
this.moduleId = newModuleId;
}
public WflResource getRequester() {
return this.requester;
}
public void setRequester(WflResource newRequester) {
this.requester = newRequester;
}
public String getRequesterAction() {
return this.requesterAction;
}
public void setRequesterAction(String newRequesterAction) {
this.requesterAction = newRequesterAction;
}
public WflSite getSite() {
return this.site;
}
public void setSite(WflSite newSite) {
this.site = newSite;
}
public HashMap getDocumentAttributes() {
return this.documentAttributes;
}
public void setDocumentAttributes(HashMap newDocumentAttributes) {
this.documentAttributes = newDocumentAttributes;
}
public String getWorkListId() {
return this.workListId;
}
public void setWorkListId(String newWorkListId) {
this.workListId = newWorkListId;
}
public String getDocumentType() {
return this.documentType;
}
public void setDocumentType(String newDocumentType) {
this.documentType = newDocumentType;
}
public String getInitiatedFlag() {
return this.initiatedFlag;
}
public void setInitiatedFlag(String newInitiatedFlag) {
this.initiatedFlag = newInitiatedFlag;
}
public String getDocDesc() {
return this.docDesc;
}
public void setDocDesc(String newDocDesc) {
this.docDesc = newDocDesc;
}
}

View File

@@ -0,0 +1,77 @@
package wenrgise.workflow.core.impl;
import wenrgise.workflow.core.WflDepartment;
import wenrgise.workflow.core.WflResource;
import wenrgise.workflow.core.WflSite;
public class WflResourceImpl implements WflResource {
private String employeeId = null;
private String empNo = null;
private String userId = null;
private WflSite loginSite = null;
private WflDepartment department = null;
private String routeDtlId;
private String delegatedBy;
public WflDepartment getDepartment() {
return this.department;
}
public void setDepartment(WflDepartment newDepartment) {
this.department = newDepartment;
}
public String getEmployeeId() {
return this.employeeId;
}
public void setEmployeeId(String newEmployeeId) {
this.employeeId = newEmployeeId;
}
public String getEmpNo() {
return this.empNo;
}
public void setEmpNo(String newEmpNo) {
this.empNo = newEmpNo;
}
public WflSite getLoginSite() {
return this.loginSite;
}
public void setLoginSite(WflSite newLoginSite) {
this.loginSite = newLoginSite;
}
public String getUserId() {
return this.userId;
}
public void setUserId(String newUserId) {
this.userId = newUserId;
}
public String getRouteDtlId() {
return this.routeDtlId;
}
public void setRouteDtlId(String newRouteDtlId) {
this.routeDtlId = newRouteDtlId;
}
public String getDelegatedBy() {
return this.delegatedBy;
}
public void setDelegatedBy(String newDelegatedBy) {
this.delegatedBy = newDelegatedBy;
}
}

View File

@@ -0,0 +1,37 @@
package wenrgise.workflow.core.impl;
import java.util.logging.Logger;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.workflow.core.WflDocumentInfo;
import wenrgise.workflow.core.WflService;
import wenrgise.workflow.core.WflStatus;
import wenrgise.workflow.core.WorkFlow;
import wenrgise.workflow.exception.WorkFlowServiceNotFoundException;
import wenrgise.workflow.impl.WorkFlowImpl;
public class WflServiceImpl implements WflService {
public static final Logger log = Logger.getLogger("wenrgise.workflow.utility.WorkflowPlugin");
public boolean canDo(WflDocumentInfo docInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
return true;
}
public WflStatus process(WflDocumentInfo docInfo) {
try {
WorkFlow wfl = getWorkFlowImplementation(docInfo);
log.severe("proc1");
if (wfl != null) {
log.severe("proc2");
return wfl.start(docInfo);
}
return null;
} catch (WorkFlowServiceNotFoundException oSx) {
return null;
}
}
private WorkFlow getWorkFlowImplementation(WflDocumentInfo docInfo) throws WorkFlowServiceNotFoundException {
return (WorkFlow)new WorkFlowImpl();
}
}

View File

@@ -0,0 +1,35 @@
package wenrgise.workflow.core.impl;
import wenrgise.workflow.core.WflSite;
public class WflSiteImpl implements WflSite {
private String siteId = null;
private String parentSiteId = null;
private String siteName = null;
public String getSiteId() {
return this.siteId;
}
public void setSiteId(String siteId) {
this.siteId = siteId;
}
public String getParentSiteId() {
return this.parentSiteId;
}
public void setParentSiteId(String parentSiteId) {
this.parentSiteId = parentSiteId;
}
public String getSiteName() {
return this.siteName;
}
public void setSiteName(String newSiteName) {
this.siteName = newSiteName;
}
}

View File

@@ -0,0 +1,46 @@
package wenrgise.workflow.core.impl;
import wenrgise.workflow.core.WflResource;
import wenrgise.workflow.core.WflStatus;
public class WflStatusImpl implements WflStatus {
private String status = null;
private WflResource wflResource = null;
private String errCode;
private String errMsg;
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public WflResource assignedTo() {
return this.wflResource;
}
public void assign(WflResource resource) {
this.wflResource = resource;
}
public String getErrCode() {
return this.errCode;
}
public void setErrCode(String newErrCode) {
this.errCode = newErrCode;
}
public String getErrMsg() {
return this.errMsg;
}
public void setErrMsg(String newErrMsg) {
this.errMsg = newErrMsg;
}
}

View File

@@ -0,0 +1,61 @@
package wenrgise.workflow.ejb.business;
import java.util.ArrayList;
import java.util.Iterator;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.helper.QueryValue;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.workflow.bean.DocHistoryDtlBean;
public class DocHistoryDtlBO extends WorkFlowBaseBO {
public ArrayList getDocHistDtl(String sDocID, String sDocType, String sModuleID) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList arylstParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
int count = 0;
String sActivity = "";
ArrayList arylstOutArray = new ArrayList();
DocHistoryDtlBean oDocHistoryDtlBean = null;
ArrayList oDocHistDtl = null;
QueryRow oRow = null;
QueryValue oValue = null;
ArrayList oList = null;
oBean = new DBUtilitiesBean();
arylstParameters = new ArrayList();
arylstParameters = new ArrayList();
arylstParameters.add(new DBObject(1, 1, 12, sDocID));
arylstParameters.add(new DBObject(2, 1, 12, sDocType));
arylstParameters.add(new DBObject(3, 1, 12, sModuleID));
arylstParameters.add(new DBObject(4, 2, -10));
arylstParameters.add(new DBObject(5, 2, 12));
arylstParameters.add(new DBObject(6, 2, 12));
arylstParameters.add(new DBObject(7, 2, 4));
arylstOutArray = oBean.callProc(arylstParameters, "WFLDOCUMENTHISTORY.proc_WflDocHistDtl(?,?,?,?,?,?,?)");
oList = (ArrayList)((DBObject)arylstOutArray.get(0)).getObject();
if (oList.size() == 0)
throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M");
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (oDocHistDtl == null)
oDocHistDtl = new ArrayList();
count++;
oRow = oIt.next();
oDocHistoryDtlBean = new DocHistoryDtlBean();
oDocHistoryDtlBean.setTxtSrlNo(String.valueOf(count));
oDocHistoryDtlBean.setTxtEmpNum(oRow.get("empName").getString());
oDocHistoryDtlBean.setTxtDocType(oRow.get("doc_type_desc").getString());
oDocHistoryDtlBean.setTxtStartTime(oRow.get("stDate").getString());
oDocHistoryDtlBean.setTxtDuration(oRow.get("duration").getString());
sActivity = oRow.get("status").getString();
if (sActivity.equalsIgnoreCase("A")) {
oDocHistoryDtlBean.setTxtActivity("Approved");
} else {
oDocHistoryDtlBean.setTxtActivity("Pending");
}
oDocHistDtl.add(oDocHistoryDtlBean);
}
return oDocHistDtl;
}
}

View File

@@ -0,0 +1,483 @@
package wenrgise.workflow.ejb.business;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Iterator;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.bean.LOVBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseMessageKeyException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.MessageKey;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.ejb.common.business.BaseBO;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.workflow.bean.WflDtlDocActivityMapDtlBean;
import wenrgise.workflow.bean.WflDtlDocActivityMapHdrBean;
import wenrgise.workflow.vo.WflDtlDocActivityMapQVO;
public class WFLDtlDocActivityMapBO extends BaseBO {
public WFLDtlDocActivityMapBO() {}
public WFLDtlDocActivityMapBO(UserInfo oUserInfo) {
super(oUserInfo);
}
public RecordMetaInfo getWFLDtlDocActivityHdrMetaInfo(WflDtlDocActivityMapQVO oWflDtlDocActivityMapQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList arylstParameters = new ArrayList();
DBUtilitiesBean objBean = new DBUtilitiesBean();
arylstParameters = new ArrayList();
arylstParameters.add(new DBObject(1, 1, 12, oWflDtlDocActivityMapQVO.getHeaderPrimaryKey()));
arylstParameters.add(new DBObject(2, 1, 12, oWflDtlDocActivityMapQVO.getDtlDocId()));
arylstParameters.add(new DBObject(3, 2, -5));
arylstParameters.add(new DBObject(4, 2, 93));
arylstParameters.add(new DBObject(5, 2, 12));
arylstParameters.add(new DBObject(6, 2, 12));
arylstParameters.add(new DBObject(7, 2, 4));
ArrayList arylstOutArray = objBean.callProc(arylstParameters, "WFLDOCACTIVITYMAP.proc_GetWFlDocActHdrMetaInfo(?,?,?,?,?,?,?)");
RecordMetaInfo objRecordMetaInfo = new RecordMetaInfo();
DBObject objTotalRecord = arylstOutArray.get(0);
objRecordMetaInfo.setRecordCount(((Long)objTotalRecord.getObject()).longValue());
DBObject oTimeObject = arylstOutArray.get(1);
objRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
return objRecordMetaInfo;
}
public ArrayList getWFLDtlDocActivityHdrInfo(WflDtlDocActivityMapQVO oWflDtlDocActivityMapQVO, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList arylstParameters = new ArrayList();
DBUtilitiesBean objBean = new DBUtilitiesBean();
Timestamp tmstWhenPicked = null;
int count = 0;
ArrayList arylstDetailList = null;
arylstParameters = new ArrayList();
arylstParameters.add(new DBObject(1, 1, -5, new Long(lStartPosition)));
arylstParameters.add(new DBObject(2, 1, -5, new Long(lLastPosition)));
arylstParameters.add(new DBObject(3, 1, 12, oWflDtlDocActivityMapQVO.getHeaderPrimaryKey()));
arylstParameters.add(new DBObject(4, 1, 12, oWflDtlDocActivityMapQVO.getDtlDocId()));
arylstParameters.add(new DBObject(5, 2, -10));
arylstParameters.add(new DBObject(6, 2, 12));
arylstParameters.add(new DBObject(7, 2, 12));
arylstParameters.add(new DBObject(8, 2, 4));
ArrayList arylstOutArray = objBean.callProc(arylstParameters, "WFLDOCACTIVITYMAP.proc_GetWFlDocActHdrInfo(?,?,?,?,?,?,?,?)");
DBObject objOutObject = arylstOutArray.get(0);
ArrayList arylstList = (ArrayList)objOutObject.getObject();
if (arylstList.size() == 0)
throw new EnrgiseApplicationException("wenrgise.workflow.norecordfound", "M");
QueryRow objRow = null;
Iterator itrIt = arylstList.iterator();
while (itrIt.hasNext()) {
if (count == 0)
arylstDetailList = new ArrayList();
count++;
objRow = itrIt.next();
WflDtlDocActivityMapHdrBean oWflDtlDocActivityMapHdrBean = new WflDtlDocActivityMapHdrBean();
oWflDtlDocActivityMapHdrBean.setHeaderPrimaryKey(objRow.get("ID").getString());
oWflDtlDocActivityMapHdrBean.setDtlDocActCode(objRow.get("docActHdrCode").getString());
oWflDtlDocActivityMapHdrBean.setDtlDocActDesc(objRow.get("docActHdrDesc").getString());
oWflDtlDocActivityMapHdrBean.setDtlDocCode(objRow.get("docDtlCode").getString());
oWflDtlDocActivityMapHdrBean.setDtlDocId(objRow.get("docTypeDtlId").getString());
oWflDtlDocActivityMapHdrBean.setDtlDocDesc(objRow.get("docDtlDesc").getString());
arylstDetailList.add(oWflDtlDocActivityMapHdrBean);
}
return arylstDetailList;
}
public RecordMetaInfo getWFLDtlDocActivityDtlMetaInfo(String sPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new String(sPrimaryKey)));
oParameters.add(new DBObject(2, 2, -5));
oParameters.add(new DBObject(3, 2, 93));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLDOCACTIVITYMAP.proc_GetWFlDocActDtlMetaInfo(?,?,?,?,?,?)");
RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
DBObject oTotalRecord = oOutArray.get(0);
oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
DBObject oTimeObject = oOutArray.get(1);
oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
System.out.println(oRecordMetaInfo);
return oRecordMetaInfo;
}
public ArrayList getWFLDtlDocActivityDtlInfo(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
DBUtilitiesBean oBean = new DBUtilitiesBean();
QueryRow oRow = null;
ArrayList oList = null;
Iterator oIt = null;
ArrayList oDtlList = new ArrayList();
ArrayList oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new Long(lDetailFirstPosition)));
oParameters.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
oParameters.add(new DBObject(3, 1, 12, lPrimaryKey));
oParameters.add(new DBObject(4, 2, -10));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLDOCACTIVITYMAP.proc_GetWFlDocActDtlInfo(?,?,?,?,?,?,?)");
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
WflDtlDocActivityMapDtlBean oWflDtlDocActivityMapDtlBean = new WflDtlDocActivityMapDtlBean();
oWflDtlDocActivityMapDtlBean.setDetailId(oRow.get("Id").getString());
oWflDtlDocActivityMapDtlBean.setActivityCode(oRow.get("activityCode").getString());
oWflDtlDocActivityMapDtlBean.setActivityDesc(oRow.get("activityDesc").getString());
oWflDtlDocActivityMapDtlBean.setActivityId(oRow.get("activityId").getString());
oWflDtlDocActivityMapDtlBean.setActivityFlag(oRow.get("activityFlag").getString());
oDtlList.add(oWflDtlDocActivityMapDtlBean);
}
return oDtlList;
}
public void initializeBOImpl() {
this.headerTable = "wfl_doc_activity_hdr";
}
public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String ScreenMode) throws EnrgiseSystemException {
String returnString = null;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
WflDtlDocActivityMapHdrBean oWflDtlDocActivityMapHdrBean = new WflDtlDocActivityMapHdrBean();
if (ScreenMode.equalsIgnoreCase("N")) {
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, oWflDtlDocActivityMapHdrBean.getDtlDocActCode()));
oParameters.add(new DBObject(4, 1, 12, oWflDtlDocActivityMapHdrBean.getDtlDocActDesc()));
oParameters.add(new DBObject(5, 1, 12, oWflDtlDocActivityMapHdrBean.getDtlDocId()));
oParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(9, 2, 12));
oParameters.add(new DBObject(10, 2, 12));
oParameters.add(new DBObject(11, 2, 12));
oParameters.add(new DBObject(12, 2, 12));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLDOCACTIVITYMAP.proc_UpsertWflDtlDocActMapHdr(?,?,?,?,?,?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
returnString = (String)oOutObject.getObject();
} else if (ScreenMode.equalsIgnoreCase("U")) {
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWflDtlDocActivityMapHdrBean.getHeaderPrimaryKey()));
oParameters.add(new DBObject(3, 1, 12, oWflDtlDocActivityMapHdrBean.getDtlDocActCode()));
oParameters.add(new DBObject(4, 1, 12, oWflDtlDocActivityMapHdrBean.getDtlDocActDesc()));
oParameters.add(new DBObject(5, 1, 12, oWflDtlDocActivityMapHdrBean.getDtlDocId()));
oParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(9, 2, 12));
oParameters.add(new DBObject(10, 2, 12));
oParameters.add(new DBObject(11, 2, 12));
oParameters.add(new DBObject(12, 2, 12));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLDOCACTIVITYMAP.proc_UpsertWflDtlDocActMapHdr(?,?,?,?,?,?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
returnString = (String)oOutObject.getObject();
} else if (ScreenMode.equalsIgnoreCase("D")) {
oParameters.add(new DBObject(1, 1, 12, oWflDtlDocActivityMapHdrBean.getHeaderPrimaryKey()));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLDOCACTIVITYMAP.proc_DeleteWflDtlDocActMapHdr(?)");
}
return returnString;
}
public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
saveDtlDocActivityDtls(sHeaderPrimaryKey, oDetailBeanArray);
}
private void saveDtlDocActivityDtls(String sHeaderPrimaryKey, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
boolean bUpsert = false;
boolean bDelete = false;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = null;
DBUtilitiesBean oBean1 = null;
Iterator oIt = oDetailBeanArray.iterator();
while (oIt.hasNext()) {
WflDtlDocActivityMapDtlBean oWflDtlDocActivityMapDtlBean = oIt.next();
if (oWflDtlDocActivityMapDtlBean.getStatus().equals("N")) {
if (!bUpsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WFLDOCACTIVITYMAP.proc_UpsertWflDtlDocActMapDtl(?,?,?,?,?,?,?,?)");
bUpsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
oParameters.add(new DBObject(4, 1, 12, oWflDtlDocActivityMapDtlBean.getActivityId()));
oParameters.add(new DBObject(5, 1, 12, oWflDtlDocActivityMapDtlBean.getActivityFlag()));
oParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflDtlDocActivityMapDtlBean.getStatus().equals("U")) {
if (!bUpsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WFLDOCACTIVITYMAP.proc_UpsertWflDtlDocActMapDtl(?,?,?,?,?,?,?,?)");
bUpsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWflDtlDocActivityMapDtlBean.getDetailId()));
oParameters.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
oParameters.add(new DBObject(4, 1, 12, oWflDtlDocActivityMapDtlBean.getActivityId()));
oParameters.add(new DBObject(5, 1, 12, oWflDtlDocActivityMapDtlBean.getActivityFlag()));
oParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflDtlDocActivityMapDtlBean.getStatus().equals("D")) {
if (!bDelete) {
oBean1 = new DBUtilitiesBean();
oBean1.createBatch("WFLDOCACTIVITYMAP.proc_DeleteWflDtlDocActMapDtl(?)");
bDelete = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWflDtlDocActivityMapDtlBean.getDetailId()));
oBean1.addToBatch(oParameters);
}
}
if (bUpsert)
oBean.executeBatch();
if (bDelete)
oBean1.executeBatch();
}
public void updateHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
System.out.println("Update Nischt!");
}
public String saveNewHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
return "saveNewHeaderImpl Nischt!";
}
public void additionalFieldValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oErrorList = new ArrayList();
if (bHeaderDataChanged)
if (!sScreenMode.equalsIgnoreCase("D"))
checkMandatoryHdr((WflDtlDocActivityMapHdrBean)oBaseHeaderBean);
if (bDetailDataChanged)
if (sScreenName.equalsIgnoreCase("WflDtlDocActivityMap")) {
Iterator oIt = oDetailBeanArray.iterator();
int count = 1;
while (oIt.hasNext()) {
WflDtlDocActivityMapDtlBean oWflDtlDocActivityMapDtlBean = oIt.next();
if (!oWflDtlDocActivityMapDtlBean.getStatus().equalsIgnoreCase("D"))
checkMandatoryDtls(oWflDtlDocActivityMapDtlBean, count, oDetailBeanArray);
count++;
}
}
reportError(oErrorList);
}
public void additionalTimestampValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {}
public void additionalBusinessValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oErrorList = new ArrayList();
if (bHeaderDataChanged)
if (!sScreenMode.equalsIgnoreCase("D"))
checkUniqueHeader((WflDtlDocActivityMapHdrBean)oBaseHeaderBean);
if (bDetailDataChanged)
if (!sScreenMode.equalsIgnoreCase("D"))
if (sScreenName.equalsIgnoreCase("WflDtlDocActivityMap")) {
Iterator oIt1 = oDetailBeanArray.iterator();
checkUniqueMaterialDtl(oBaseHeaderBean.getHeaderPrimaryKey(), oDetailBeanArray, oErrorList);
}
reportError(oErrorList);
}
public LovVO getWflMapCodeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
String sQuery = "Select distinct wdah.id,wdah.activity_hdr_code from wfl_doc_activity_hdr wdah where 1=1";
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wdah.activity_hdr_code) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("WFL.WFLDtlDocActMap.dtlDocActCode");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("id").getString());
oLOVBean.setDetailField2(oRow.get("activity_hdr_code").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
public LovVO getWflDocCodeDtlLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
String sQuery = "Select distinct wdtd.id,wdtd.doc_dtl_code,wdtd.doc_dtl_desc from wfl_doc_type_dtl wdtd where 1=1 ";
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wdtd.doc_dtl_code) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wdtd.doc_dtl_desc) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("WFL.WFLDtlDocActMap.dtlDocCode");
oHeaderList.add("WFL.WFLDtlDocActMap.dtlDocDesc");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("id").getString());
oLOVBean.setDetailField2(oRow.get("doc_dtl_code").getString());
oLOVBean.setDetailField3(oRow.get("doc_dtl_desc").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
public LovVO getWflActCodeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
String sQuery = "Select distinct wam.id,wam.ACTIVITY_CODE,wam.ACTIVITY_DESC from wfl_activity_mst wam where 1=1 ";
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wam.ACTIVITY_CODE) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wam.ACTIVITY_DESC) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("WFL.WFLDtlDocActMap.activityCode");
oHeaderList.add("WFL.WFLDtlDocActMap.activityDesc");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("id").getString());
oLOVBean.setDetailField2(oRow.get("doc_dtl_code").getString());
oLOVBean.setDetailField3(oRow.get("doc_dtl_desc").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
private void checkMandatoryHdr(WflDtlDocActivityMapHdrBean oWflDtlDocActivityMapHdrBean) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oList = new ArrayList();
if (!EnrgiseUtil.checkString(oWflDtlDocActivityMapHdrBean.getDtlDocActCode())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDtlDocActMap.dtlDocActCode");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryfieldmissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWflDtlDocActivityMapHdrBean.getDtlDocCode())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDtlDocActMap.dtlDocCode");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryfieldmissing", oParam, "E"));
}
reportError(oList);
}
private void checkMandatoryDtls(WflDtlDocActivityMapDtlBean oWflDtlDocActivityMapDtlBean, int count, ArrayList oDetailBeanArray) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oList = new ArrayList();
if (!EnrgiseUtil.checkString(oWflDtlDocActivityMapDtlBean.getActivityCode())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDtlDocActMap.activityCode");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryfieldmissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWflDtlDocActivityMapDtlBean.getActivityDesc())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDtlDocActMap.activityDesc");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryfieldmissing", oParam, "E"));
}
reportError(oList);
}
private void checkUniqueMaterialDtl(String sHeaderPrimaryKey, ArrayList oDetailBeanArray, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
Iterator oIt1 = oDetailBeanArray.iterator();
int rowCount = 1;
while (oIt1.hasNext()) {
WflDtlDocActivityMapDtlBean oWflDtlDocActivityMapDtlBean = oIt1.next();
if (!EnrgiseUtil.checkString(oWflDtlDocActivityMapDtlBean.getDetailId())) {
String sQuery = String.valueOf(" Select id as ID from WFL_DOC_ACTIVITY_DTL where ACTIVITY_ID= ").concat(String.valueOf(oWflDtlDocActivityMapDtlBean.getActivityCode()));
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
ArrayList oParams = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDtlDocActMap.activityCode");
oParams.add(oMessageKey);
oParams.add(new Integer(rowCount));
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.workflow.detail.UniqueKeyConstraint", oParams));
}
}
rowCount++;
}
}
private void checkUniqueHeader(WflDtlDocActivityMapHdrBean oWflDtlDocActivityMapHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
String sQuery = String.valueOf(String.valueOf(String.valueOf(" Select ID as ID from wfl_doc_activity_hdr where ACTIVITY_HDR_CODE= '").concat(String.valueOf(oWflDtlDocActivityMapHdrBean.getDtlDocActCode()))).concat(String.valueOf("' and DOC_TYPE_DTL_ID="))).concat(String.valueOf(oWflDtlDocActivityMapHdrBean.getDtlDocCode()));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
QueryRow oRow = oIt.next();
if (!oRow.get("ID").getString().equalsIgnoreCase(oWflDtlDocActivityMapHdrBean.getHeaderPrimaryKey())) {
MessageKey oMessageKey = new MessageKey("WFL.WFLDtlDocActMap.dtlDocActCode");
MessageKey oMessageKey1 = new MessageKey("WFL.WFLDtlDocActMap.dtlDocCode");
ArrayList oParams = new ArrayList();
oParams.add(oMessageKey);
oParams.add(oMessageKey1);
throw new EnrgiseMessageKeyException("wenrgise.workflow.header.UniqueKeyConstraint", oParams, "E");
}
}
}
}

View File

@@ -0,0 +1,237 @@
package wenrgise.workflow.ejb.business;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseMessageKeyException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.MessageKey;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.ejb.common.business.BaseBO;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.workflow.bean.WflActMstDtlBean;
public class WflActivityMstBO extends BaseBO {
public WflActivityMstBO() {}
public WflActivityMstBO(UserInfo oUserInfo) {
super(oUserInfo);
}
public RecordMetaInfo getWflActivityDtlMetaInfo() throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList arylstParameters = new ArrayList();
DBUtilitiesBean objBean = new DBUtilitiesBean();
arylstParameters = new ArrayList();
arylstParameters.add(new DBObject(1, 2, -5));
arylstParameters.add(new DBObject(2, 2, 93));
arylstParameters.add(new DBObject(3, 2, 12));
arylstParameters.add(new DBObject(4, 2, 12));
arylstParameters.add(new DBObject(5, 2, 4));
ArrayList arylstOutArray = objBean.callProc(arylstParameters, "WflActivityMst.proc_GetActMstDtlMetaInfo(?,?,?,?,?)");
RecordMetaInfo objRecordMetaInfo = new RecordMetaInfo();
DBObject objTotalRecord = arylstOutArray.get(0);
objRecordMetaInfo.setRecordCount(((Long)objTotalRecord.getObject()).longValue());
DBObject oTimeObject = arylstOutArray.get(1);
objRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
return objRecordMetaInfo;
}
public ArrayList getWflActivityDtlInfo(long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList arylstParameters = new ArrayList();
DBUtilitiesBean objBean = new DBUtilitiesBean();
Timestamp tmstWhenPicked = null;
int count = 0;
ArrayList arylstDetailList = null;
arylstParameters = new ArrayList();
arylstParameters.add(new DBObject(1, 1, -5, new Long(lStartPosition)));
arylstParameters.add(new DBObject(2, 1, -5, new Long(lLastPosition)));
arylstParameters.add(new DBObject(3, 2, -10));
arylstParameters.add(new DBObject(4, 2, 12));
arylstParameters.add(new DBObject(5, 2, 12));
arylstParameters.add(new DBObject(6, 2, 4));
ArrayList arylstOutArray = objBean.callProc(arylstParameters, "WflActivityMst.proc_GetActMstDtlInfo(?,?,?,?,?,?)");
DBObject objOutObject = arylstOutArray.get(0);
ArrayList arylstList = (ArrayList)objOutObject.getObject();
if (arylstList.size() == 0)
throw new EnrgiseApplicationException("wenrgise.workflow.norecordfound", "M");
QueryRow objRow = null;
HashMap objColumns = null;
Iterator itrIt = arylstList.iterator();
while (itrIt.hasNext()) {
if (count == 0)
arylstDetailList = new ArrayList();
count++;
objRow = itrIt.next();
WflActMstDtlBean oWflActMstDtlBean = new WflActMstDtlBean();
oWflActMstDtlBean.setDetailId(objRow.get("id").getString());
oWflActMstDtlBean.setTxtAttrCode(objRow.get("activity_code").getString());
oWflActMstDtlBean.setTxtAttrDesc(objRow.get("activity_desc").getString());
arylstDetailList.add(oWflActMstDtlBean);
}
return arylstDetailList;
}
private void saveWflActivityDtls(String sHeaderPrimaryKey, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
boolean bInsert = false;
boolean bUpdate = false;
boolean bDelete = false;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = null;
DBUtilitiesBean oBean1 = null;
Iterator oIt = oDetailBeanArray.iterator();
while (oIt.hasNext()) {
WflActMstDtlBean oWflActMstDtlBean = oIt.next();
if (oWflActMstDtlBean.getStatus().equals("N")) {
if (!bInsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflActivityMst.proc_UpsertWflActivityMstDtl(?,?,?,?,?,?,?)");
bInsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, oWflActMstDtlBean.getTxtAttrCode()));
oParameters.add(new DBObject(4, 1, 12, oWflActMstDtlBean.getTxtAttrDesc()));
oParameters.add(new DBObject(5, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflActMstDtlBean.getStatus().equals("U")) {
if (!bUpdate) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflActivityMst.proc_UpsertWflActivityMstDtl(?,?,?,?,?,?,?)");
bUpdate = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWflActMstDtlBean.getDetailId()));
oParameters.add(new DBObject(3, 1, 12, oWflActMstDtlBean.getTxtAttrCode()));
oParameters.add(new DBObject(4, 1, 12, oWflActMstDtlBean.getTxtAttrDesc()));
oParameters.add(new DBObject(5, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflActMstDtlBean.getStatus().equals("D")) {
if (!bDelete) {
oBean1 = new DBUtilitiesBean();
oBean1.createBatch("WflActivityMst.proc_DeleteWflActivityMstDtl(?)");
bDelete = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWflActMstDtlBean.getDetailId()));
oBean1.addToBatch(oParameters);
}
}
if (bInsert)
oBean.executeBatch();
if (bUpdate)
oBean.executeBatch();
if (bDelete)
oBean1.executeBatch();
}
public void initializeBOImpl() {
this.headerTable = "WFL_ACTIVITY_MST";
}
public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String ScreenMode) throws EnrgiseSystemException {
String returnString = null;
return returnString;
}
public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
if (sScreenName.equalsIgnoreCase("WflActivityMst"))
saveWflActivityDtls(sHeaderPrimaryKey, oDetailBeanArray);
}
public void updateHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
System.out.println("Update Nischt!");
}
public String saveNewHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
return "saveNewHeaderImpl Nischt!";
}
public void additionalFieldValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oErrorList = new ArrayList();
if (bDetailDataChanged)
if (sScreenName.equalsIgnoreCase("WflActivityMst")) {
Iterator oIt = oDetailBeanArray.iterator();
int count = 1;
while (oIt.hasNext()) {
WflActMstDtlBean oWflActMstDtlBean = oIt.next();
if (!oWflActMstDtlBean.getStatus().equalsIgnoreCase("D"))
checkMandatoryDtls(oWflActMstDtlBean, count, oDetailBeanArray);
count++;
}
}
reportError(oErrorList);
}
public void additionalBusinessValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oErrorList = new ArrayList();
if (bDetailDataChanged) {
if (!sScreenMode.equalsIgnoreCase("D"))
if (sScreenName.equalsIgnoreCase("WflActivityMst")) {
Iterator oIt1 = oDetailBeanArray.iterator();
checkUniqueMaterialDtl(oBaseHeaderBean.getHeaderPrimaryKey(), oDetailBeanArray, oErrorList);
EnrgiseUtil.checkDuplicate(oDetailBeanArray, "txtAttrCode", "wfl.WflActivityMst.attrCode", oErrorList, true);
}
reportError(oErrorList);
}
}
public void additionalTimestampValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {}
private void checkMandatoryDtls(WflActMstDtlBean oWflActMstDtlBean, int count, ArrayList oDetailBeanArray) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oList = new ArrayList();
if (!EnrgiseUtil.checkString(oWflActMstDtlBean.getTxtAttrCode())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("wfl.WflActivityMst.attrCode");
oParam.add(oMessageKey);
oParam.add(new Integer(count));
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWflActMstDtlBean.getTxtAttrDesc())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("wfl.WflActivityMst.attrDesc");
oParam.add(oMessageKey);
oParam.add(new Integer(count));
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParam, "E"));
}
reportError(oList);
}
private void checkUniqueMaterialDtl(String sHeaderPrimaryKey, ArrayList oDetailBeanArray, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
Iterator oIt1 = oDetailBeanArray.iterator();
int rowCount = 1;
while (oIt1.hasNext()) {
WflActMstDtlBean oWflActMstDtlBean = oIt1.next();
if (!EnrgiseUtil.checkString(oWflActMstDtlBean.getDetailId())) {
String sQuery = String.valueOf(String.valueOf(" Select id as ID from WFL_ACTIVITY_MST where activity_code='").concat(String.valueOf(oWflActMstDtlBean.getTxtAttrCode()))).concat(String.valueOf("' "));
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
ArrayList oParams = new ArrayList();
MessageKey oMessageKey = new MessageKey("wfl.WflActivityMst.attrCode");
oParams.add(oMessageKey);
oParams.add(new Integer(rowCount));
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.workflow.detail.UniqueKeyConstraint", oParams));
}
}
rowCount++;
}
}
}

View File

@@ -0,0 +1,452 @@
package wenrgise.workflow.ejb.business;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Iterator;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.bean.LOVBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseMessageKeyException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.MessageKey;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.ejb.common.business.BaseBO;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.workflow.bean.WflDOPGrpDtlBean;
import wenrgise.workflow.bean.WflDOPGrpHdrBean;
import wenrgise.workflow.vo.WflDOPGrpQVO;
public class WflDOPGrpBO extends BaseBO {
public WflDOPGrpBO() {}
public WflDOPGrpBO(UserInfo oUserInfo) {
super(oUserInfo);
}
public void updateHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {}
public String saveNewHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
return "saveNewHeaderImpl ille!";
}
public void additionalFieldValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDOPGrpHdrBean oWflDOPGrpHdrBean = (WflDOPGrpHdrBean)oBaseHeaderBean;
ArrayList oErrorList = new ArrayList();
if (bHeaderDataChanged)
if (!sScreenMode.equalsIgnoreCase("D"))
checkMandatoryHeader(oWflDOPGrpHdrBean);
if (bDetailDataChanged)
if (sScreenName.equalsIgnoreCase("WflDOPGrp")) {
Iterator oIt = oDetailBeanArray.iterator();
int count = 1;
while (oIt.hasNext()) {
WflDOPGrpDtlBean oWflDOPGrpDtlBean = oIt.next();
if (!oWflDOPGrpDtlBean.getStatus().equalsIgnoreCase("D"))
checkMandatoryDtls(oWflDOPGrpDtlBean, count, oDetailBeanArray);
count++;
}
}
reportError(oErrorList);
}
private void checkMandatoryHeader(WflDOPGrpHdrBean oWflDOPGrpHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oList = new ArrayList();
if (!EnrgiseUtil.checkString(oWflDOPGrpHdrBean.getGrpCode())) {
MessageKey oMessageKey = new MessageKey("WFL.WflDOPGrp.grpCode");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParam, "E"));
}
reportError(oList);
}
public void additionalTimestampValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {}
public void additionalBusinessValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oList = new ArrayList();
if (bHeaderDataChanged)
checkUniqueHeader((WflDOPGrpHdrBean)oBaseHeaderBean);
if (bDetailDataChanged)
if (!sScreenMode.equalsIgnoreCase("D"))
if (sScreenName.equalsIgnoreCase("WflDOPGrp")) {
Iterator oIt1 = oDetailBeanArray.iterator();
EnrgiseUtil.checkDuplicate(oDetailBeanArray, "txtempNo", "WFL.WflDOPGrp.empNo", oList, true);
checkUniqueDOPGrpDtl(oBaseHeaderBean.getHeaderPrimaryKey(), oDetailBeanArray, oList);
checkDefaultMember(oBaseHeaderBean.getHeaderPrimaryKey(), oDetailBeanArray, oList);
}
reportError(oList);
}
public void initializeBOImpl() {
this.headerTable = "wfl_dop_groups";
}
public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
if (sScreenName.equalsIgnoreCase("WflDOPGrp"))
saveWflDOPGrpDtls(sHeaderPrimaryKey, oDetailBeanArray);
}
public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String ScreenMode) throws EnrgiseSystemException {
String returnString = null;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
WflDOPGrpHdrBean oWflDOPGrpHdrBean = (WflDOPGrpHdrBean)oBaseHeaderBean;
String sGrpFlag = String.valueOf(oWflDOPGrpHdrBean.getGrpFlag()).equalsIgnoreCase("on") ? "Y" : "N";
if (ScreenMode.equalsIgnoreCase("N")) {
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, oWflDOPGrpHdrBean.getGrpCode()));
oParameters.add(new DBObject(4, 1, 12, oWflDOPGrpHdrBean.getGrpDesc()));
oParameters.add(new DBObject(5, 1, 12, oWflDOPGrpHdrBean.getRemarks()));
oParameters.add(new DBObject(6, 1, 12, sGrpFlag));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(10, 2, 12));
oParameters.add(new DBObject(11, 2, 12));
oParameters.add(new DBObject(12, 2, 12));
oParameters.add(new DBObject(13, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDOPGroupMst.proc_UpsertWflDopGrpHdr(?,?,?,?,?,?,?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
returnString = (String)oOutObject.getObject();
} else if (ScreenMode.equalsIgnoreCase("U")) {
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, oWflDOPGrpHdrBean.getGrpCode()));
oParameters.add(new DBObject(4, 1, 12, oWflDOPGrpHdrBean.getGrpDesc()));
oParameters.add(new DBObject(5, 1, 12, oWflDOPGrpHdrBean.getRemarks()));
oParameters.add(new DBObject(6, 1, 12, sGrpFlag));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(10, 2, 12));
oParameters.add(new DBObject(11, 2, 12));
oParameters.add(new DBObject(12, 2, 12));
oParameters.add(new DBObject(13, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDOPGroupMst.proc_UpsertWflDopGrpHdr(?,?,?,?,?,?,?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
returnString = (String)oOutObject.getObject();
} else if (ScreenMode.equalsIgnoreCase("D")) {
oParameters.add(new DBObject(1, 1, 12, oWflDOPGrpHdrBean.getHeaderPrimaryKey()));
oParameters.add(new DBObject(2, 2, 12));
oParameters.add(new DBObject(3, 2, 12));
oParameters.add(new DBObject(4, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDOPGroupMst.proc_DeleteWflDopGrpHdr(?,?,?,?)");
}
return returnString;
}
public void saveWflDOPGrpDtls(String sHeaderPrimaryKey, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
boolean bInsert = false;
boolean bDelete = false;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = null;
DBUtilitiesBean oBean1 = null;
Iterator oIt = oDetailBeanArray.iterator();
while (oIt.hasNext()) {
WflDOPGrpDtlBean oWflDOPGrpDtlBean = oIt.next();
String sDfliMem = String.valueOf(oWflDOPGrpDtlBean.getDfltMembr()).equalsIgnoreCase("on") ? "Y" : "N";
if (oWflDOPGrpDtlBean.getStatus().equals("N")) {
if (!bInsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflDOPGroupMst.proc_UpsertWflDopGrpMembers(?,?,?,?,?,?,?,?,?)");
bInsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
oParameters.add(new DBObject(4, 1, 12, oWflDOPGrpDtlBean.getEmpId()));
oParameters.add(new DBObject(5, 1, 12, oWflDOPGrpDtlBean.getTxtHiLevel()));
oParameters.add(new DBObject(6, 1, 12, sDfliMem));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflDOPGrpDtlBean.getStatus().equals("U")) {
if (!bInsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflDOPGroupMst.proc_UpsertWflDopGrpMembers(?,?,?,?,?,?,?,?,?)");
bInsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWflDOPGrpDtlBean.getDetailId()));
oParameters.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
oParameters.add(new DBObject(4, 1, 12, oWflDOPGrpDtlBean.getEmpId()));
oParameters.add(new DBObject(5, 1, 12, oWflDOPGrpDtlBean.getTxtHiLevel()));
oParameters.add(new DBObject(6, 1, 12, sDfliMem));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflDOPGrpDtlBean.getStatus().equals("D")) {
if (!bDelete) {
oBean1 = new DBUtilitiesBean();
oBean1.createBatch("WflDOPGroupMst.proc_DeleteWflDopGrpMembers(?)");
bDelete = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWflDOPGrpDtlBean.getDetailId()));
oBean1.addToBatch(oParameters);
}
}
if (bInsert)
oBean.executeBatch();
if (bDelete)
oBean1.executeBatch();
}
public RecordMetaInfo getWflDOPGrpHdrMetaInfo(WflDOPGrpQVO oWflDOPGrpQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
Timestamp oWhenPicked = null;
int count = 0;
BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWflDOPGrpQVO.getHeaderPrimaryKey()));
oParameters.add(new DBObject(2, 2, -5));
oParameters.add(new DBObject(3, 2, 93));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDOPGroupMst.proc_GetWFlDOPHdrMetaInfo(?,?,?,?,?,?)");
RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
DBObject oTimeObject = oOutArray.get(1);
oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
DBObject oTotalRecord = oOutArray.get(0);
oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
return oRecordMetaInfo;
}
public ArrayList getWflDOPGrpHdrInfo(WflDOPGrpQVO oWflDOPGrpQVO, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
int count = 0;
BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO();
ArrayList oHeaderList = null;
if (oWflDOPGrpQVO == null)
oWflDOPGrpQVO = new WflDOPGrpQVO();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, -5, new Long(lStartPosition)));
oParameters.add(new DBObject(2, 1, -5, new Long(lLastPosition)));
oParameters.add(new DBObject(3, 1, 12, oWflDOPGrpQVO.getHeaderPrimaryKey()));
oParameters.add(new DBObject(4, 2, -10));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDOPGroupMst.proc_GetWFlDOPHdrInfo(?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
ArrayList oList = (ArrayList)oOutObject.getObject();
if (oList.size() == 0)
throw new EnrgiseApplicationException("wenrgise.workflow.norecordfound", "M");
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oHeaderList = new ArrayList();
count++;
oRow = oIt.next();
WflDOPGrpHdrBean oWflDOPGrpHdrBean = new WflDOPGrpHdrBean();
oWflDOPGrpHdrBean.setHeaderPrimaryKey(oRow.get("ID").getString());
oWflDOPGrpHdrBean.setGrpCode(oRow.get("GrCode").getString());
oWflDOPGrpHdrBean.setGrpDesc(oRow.get("GrType").getString());
oWflDOPGrpHdrBean.setRemarks(oRow.get("Remarks").getString());
oWflDOPGrpHdrBean.setGrpFlag(String.valueOf(oRow.get("ValFlag").getString()).equalsIgnoreCase("Y") ? "on" : "off");
oHeaderList.add(oWflDOPGrpHdrBean);
}
return oHeaderList;
}
public RecordMetaInfo getWflDOPGrpDtlMetaInfo(String sPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new String(sPrimaryKey)));
oParameters.add(new DBObject(2, 2, -5));
oParameters.add(new DBObject(3, 2, 93));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDOPGroupMst.proc_GetWFlDOPGrpDtlMetaInfo(?,?,?,?,?,?)");
RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
DBObject oTotalRecord = oOutArray.get(0);
oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
DBObject oTimeObject = oOutArray.get(1);
oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
System.out.println(oRecordMetaInfo);
return oRecordMetaInfo;
}
public ArrayList getWflDOPGrpDtlInfo(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
DBUtilitiesBean oBean = new DBUtilitiesBean();
QueryRow oRow = null;
ArrayList oList = null;
Iterator oIt = null;
ArrayList oDtlList = new ArrayList();
ArrayList oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new Long(lDetailFirstPosition)));
oParameters.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
oParameters.add(new DBObject(3, 1, 12, lPrimaryKey));
oParameters.add(new DBObject(4, 2, -10));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDOPGroupMst.proc_GetWFlDOPGrpDtlInfo(?,?,?,?,?,?,?)");
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
WflDOPGrpDtlBean oWflDOPGrpDtlBean = new WflDOPGrpDtlBean();
oWflDOPGrpDtlBean.setDetailId(oRow.get("Id").getString());
oWflDOPGrpDtlBean.setTxtempNo(oRow.get("EmpNo").getString());
oWflDOPGrpDtlBean.setEmpId(oRow.get("e_per_dtl_id").getString());
oWflDOPGrpDtlBean.setTxtEmpName(oRow.get("MEMNAME").getString());
oWflDOPGrpDtlBean.setTxtHiLevel(oRow.get("Hlevel").getString());
oWflDOPGrpDtlBean.setDfltMembr(String.valueOf(oRow.get("DfltMem").getString()).equalsIgnoreCase("Y") ? "on" : "off");
oDtlList.add(oWflDOPGrpDtlBean);
}
return oDtlList;
}
public LovVO getWflDOPGrpCodeQLOV(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
String sQuery = "select distinct wdg.id as id,wdg.group_code as GrCode from wfl_dop_groups wdg";
if (oLovQueryVO.getSearchField1() != null)
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" where upper(wdg.group_code) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("WFL.WflDOPGrp.grpCode");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("id").getString());
oLOVBean.setDetailField2(oRow.get("GrCode").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
private void checkDefaultMember(String sHeaderPrimKey, ArrayList oDetailBeanArray, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = null;
ArrayList oOutArray = null;
Iterator oDetailBeanIterator = oDetailBeanArray.iterator();
String oBeanUpdate = new String();
boolean flag = false;
while (oDetailBeanIterator.hasNext()) {
WflDOPGrpDtlBean oWflDOPGrpDtlBean = oDetailBeanIterator.next();
if (oWflDOPGrpDtlBean.getStatus().equalsIgnoreCase("U") || oWflDOPGrpDtlBean.getStatus().equalsIgnoreCase("D")) {
if (flag == true)
oBeanUpdate = String.valueOf(oBeanUpdate).concat(String.valueOf(","));
oBeanUpdate = String.valueOf(oBeanUpdate).concat(String.valueOf(oWflDOPGrpDtlBean.getDetailId()));
flag = true;
}
}
String sQuery = new String();
if (!oBeanUpdate.equalsIgnoreCase("")) {
sQuery = String.valueOf(String.valueOf(String.valueOf(String.valueOf(" select t.id from wfl_dop_group_members t where t.dop_group_id=").concat(String.valueOf(sHeaderPrimKey))).concat(String.valueOf(" and t.id not in ("))).concat(String.valueOf(oBeanUpdate))).concat(String.valueOf(") and t.default_member='Y' "));
} else {
sQuery = String.valueOf(String.valueOf(" select t.id from wfl_dop_group_members t where t.dop_group_id=").concat(String.valueOf(sHeaderPrimKey))).concat(String.valueOf(" and t.default_member='Y' "));
}
System.out.println(sQuery);
DBUtilitiesBean oBean1 = new DBUtilitiesBean();
ArrayList arylstDefaultMemberNo = oBean1.executeQuery(sQuery);
ArrayList arylstCombMatIds = new ArrayList();
if (arylstDefaultMemberNo.size() > 1)
throw new EnrgiseApplicationException("WFL.WflDOPGrp.noExceedingOne", "E");
int iPersons = arylstDefaultMemberNo.size();
Iterator oIt = oDetailBeanArray.iterator();
while (oIt.hasNext()) {
WflDOPGrpDtlBean oWflDOPGrpDtlBean = oIt.next();
if (oWflDOPGrpDtlBean.getStatus().equalsIgnoreCase("U"))
if (oWflDOPGrpDtlBean.getDfltMembr().equalsIgnoreCase("on"))
iPersons++;
if (oWflDOPGrpDtlBean.getStatus().equalsIgnoreCase("D"))
if (oWflDOPGrpDtlBean.getDfltMembr().equalsIgnoreCase("off"))
iPersons--;
if (oWflDOPGrpDtlBean.getStatus().equalsIgnoreCase("N"))
if (oWflDOPGrpDtlBean.getDfltMembr().equalsIgnoreCase("on"))
iPersons++;
}
if (iPersons > 1)
throw new EnrgiseApplicationException("WFL.WflDOPGrp.noExceedingOne", "E");
if (iPersons < 1)
throw new EnrgiseApplicationException("WFL.WflDOPGrp.noLessthanOne", "E");
}
private void checkUniqueDOPGrpDtl(String sHeaderPrimaryKey, ArrayList oDetailBeanArray, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
Iterator oIt1 = oDetailBeanArray.iterator();
int rowCount = 1;
while (oIt1.hasNext()) {
WflDOPGrpDtlBean oWflDOPGrpDtlBean = oIt1.next();
if (!EnrgiseUtil.checkString(oWflDOPGrpDtlBean.getEmpId())) {
String sQuery = String.valueOf(" Select id as ID from wfl_dop_group_members a where a.dop_group_id= ").concat(String.valueOf(sHeaderPrimaryKey));
sQuery = String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and a.e_per_dtl_id= "))).concat(String.valueOf(oWflDOPGrpDtlBean.getEmpId()));
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
ArrayList oParams = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WflDOPGrp.empNo");
oParams.add(oMessageKey);
oParams.add(new Integer(rowCount));
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.workflow.detail.UniqueKeyConstraint", oParams));
}
}
rowCount++;
}
}
private void checkMandatoryDtls(WflDOPGrpDtlBean oWflDOPGrpDtlBean, int count, ArrayList oDetailBeanArray) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oList = new ArrayList();
if (!EnrgiseUtil.checkString(oWflDOPGrpDtlBean.getTxtempNo())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WflDOPGrp.empNo");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryfieldmissing", oParam, "E"));
}
reportError(oList);
}
private void checkUniqueHeader(WflDOPGrpHdrBean oWflDOPGrpHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
String sQuery = String.valueOf(String.valueOf(" select t.id from wfl_dop_groups t where t.group_code='").concat(String.valueOf(oWflDOPGrpHdrBean.getGrpCode()))).concat(String.valueOf("'"));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
QueryRow oRow = oIt.next();
if (!oRow.get("ID").getString().equalsIgnoreCase(oWflDOPGrpHdrBean.getHeaderPrimaryKey()))
throw new EnrgiseApplicationException("wenrgise.common.header.uniqueConstraintViolated", "E");
}
}
}

View File

@@ -0,0 +1,453 @@
package wenrgise.workflow.ejb.business;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Iterator;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.bean.LOVBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseMessageKeyException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.MessageKey;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.ejb.common.business.BaseBO;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.workflow.bean.WflDelegateMstDtlBean;
import wenrgise.workflow.bean.WflDelegateMstHdrBean;
import wenrgise.workflow.vo.WflDelegationQVO;
public class WflDelegationMstBO extends BaseBO {
public WflDelegationMstBO() {}
public WflDelegationMstBO(UserInfo oUserInfo) {
super(oUserInfo);
}
public RecordMetaInfo getWflDelegationHdrMetaInfo(WflDelegationQVO oWflDelegationQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
Timestamp oWhenPicked = null;
int count = 0;
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWflDelegationQVO.getHeaderPrimaryKey()));
oParameters.add(new DBObject(2, 1, 12, oWflDelegationQVO.getEmpId()));
oParameters.add(new DBObject(3, 2, -5));
oParameters.add(new DBObject(4, 2, 93));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLDELEGATIONMST.proc_GetWFlDelegationMetaInfo(?,?,?,?,?,?,?)");
RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
DBObject oTimeObject = oOutArray.get(1);
oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
DBObject oTotalRecord = oOutArray.get(0);
oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
return oRecordMetaInfo;
}
public ArrayList getWflDelegationHdrInfo(WflDelegationQVO oWflDelegationQVO, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
int count = 0;
ArrayList oHeaderList = null;
if (oWflDelegationQVO == null)
oWflDelegationQVO = new WflDelegationQVO();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, -5, new Long(lStartPosition)));
oParameters.add(new DBObject(2, 1, -5, new Long(lLastPosition)));
oParameters.add(new DBObject(3, 1, 12, oWflDelegationQVO.getHeaderPrimaryKey()));
oParameters.add(new DBObject(4, 1, 12, oWflDelegationQVO.getEmpId()));
oParameters.add(new DBObject(5, 2, -10));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 12));
oParameters.add(new DBObject(8, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLDELEGATIONMST.proc_GetWFlDelegationHdrInfo(?,?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
ArrayList oList = (ArrayList)oOutObject.getObject();
if (oList.size() == 0)
throw new EnrgiseApplicationException("wenrgise.workflow.norecordfound", "M");
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oHeaderList = new ArrayList();
count++;
oRow = oIt.next();
WflDelegateMstHdrBean oWflDelegateMstHdrBean = new WflDelegateMstHdrBean();
oWflDelegateMstHdrBean.setHeaderPrimaryKey(oRow.get("ID").getString());
oWflDelegateMstHdrBean.setFromDate(EnrgiseUtil.convertToString(oRow.get("FROM_DATE").getDate()));
oWflDelegateMstHdrBean.setToDate(EnrgiseUtil.convertToString(oRow.get("TO_DATE").getDate()));
oWflDelegateMstHdrBean.setDelegateAll(oRow.get("ALL_DOC").getString().equalsIgnoreCase("Y") ? "on" : "off");
oWflDelegateMstHdrBean.setEmpId(oRow.get("DELEGATED_ID").getString());
oWflDelegateMstHdrBean.setEmpNo(oRow.get("EMP_NO").getString());
oWflDelegateMstHdrBean.setEmpName(oRow.get("EMP_NAME").getString());
oWflDelegateMstHdrBean.setRemarks(oRow.get("REMARKS").getString());
oHeaderList.add(oWflDelegateMstHdrBean);
}
return oHeaderList;
}
public RecordMetaInfo getWflDelegationDtlMetaInfo(String sPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, sPrimaryKey));
oParameters.add(new DBObject(2, 2, -5));
oParameters.add(new DBObject(3, 2, 93));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLDELEGATIONMST.proc_GetWFlDelegDtlMetaInfo(?,?,?,?,?,?)");
RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
DBObject oTotalRecord = oOutArray.get(0);
oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
DBObject oTimeObject = oOutArray.get(1);
oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
System.out.println(oRecordMetaInfo);
return oRecordMetaInfo;
}
public ArrayList getWflDelegationDtlInfo(String sPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
DBUtilitiesBean oBean = new DBUtilitiesBean();
QueryRow oRow = null;
ArrayList oList = null;
Iterator oIt = null;
ArrayList oDtlList = new ArrayList();
ArrayList oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new Long(lDetailFirstPosition)));
oParameters.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
oParameters.add(new DBObject(3, 1, 12, sPrimaryKey));
oParameters.add(new DBObject(4, 2, -10));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLDELEGATIONMST.proc_GetWFlDelegationDtlInfo(?,?,?,?,?,?,?)");
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
WflDelegateMstDtlBean oWflDelegateMstDtlBean = new WflDelegateMstDtlBean();
oWflDelegateMstDtlBean.setDetailId(oRow.get("Id").getString());
oWflDelegateMstDtlBean.setTxtDocTypeId(oRow.get("doc_type_id").getString());
oWflDelegateMstDtlBean.setTxtDocType(oRow.get("doc_dtl_code").getString());
oWflDelegateMstDtlBean.setTxtDesc(oRow.get("doc_dtl_desc").getString());
oWflDelegateMstDtlBean.setDisabbutDocType("true");
oDtlList.add(oWflDelegateMstDtlBean);
}
return oDtlList;
}
public void initializeBOImpl() {
this.headerTable = "wfl_delegation_hdr";
}
public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String ScreenMode) throws EnrgiseSystemException {
String returnString = null;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
WflDelegateMstHdrBean oWflDelegateMstHdrBean = (WflDelegateMstHdrBean)oBaseHeaderBean;
if (oWflDelegateMstHdrBean.getDelegateAll().equalsIgnoreCase("off") || oWflDelegateMstHdrBean.getDelegateAll().equalsIgnoreCase(""))
oWflDelegateMstHdrBean.setDelegateAllDoc("N");
if (ScreenMode.equalsIgnoreCase("N")) {
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, this.oUserInfo.getUserTypeId()));
oParameters.add(new DBObject(4, 1, 12, oWflDelegateMstHdrBean.getEmpId()));
oParameters.add(new DBObject(5, 1, 12, oWflDelegateMstHdrBean.getFromDate()));
oParameters.add(new DBObject(6, 1, 12, oWflDelegateMstHdrBean.getToDate()));
oParameters.add(new DBObject(7, 1, 12, oWflDelegateMstHdrBean.getDelegateAllDoc()));
oParameters.add(new DBObject(8, 1, 12, oWflDelegateMstHdrBean.getRemarks()));
oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(10, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(11, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(12, 2, 12));
oParameters.add(new DBObject(13, 2, 12));
oParameters.add(new DBObject(14, 2, 12));
oParameters.add(new DBObject(15, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLDELEGATIONMST.proc_UpsertWflDelegationHdr(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
returnString = (String)oOutObject.getObject();
} else if (ScreenMode.equalsIgnoreCase("U")) {
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWflDelegateMstHdrBean.getHeaderPrimaryKey()));
oParameters.add(new DBObject(3, 1, 12, this.oUserInfo.getUserTypeId()));
oParameters.add(new DBObject(4, 1, 12, oWflDelegateMstHdrBean.getEmpId()));
oParameters.add(new DBObject(5, 1, 12, oWflDelegateMstHdrBean.getFromDate()));
oParameters.add(new DBObject(6, 1, 12, oWflDelegateMstHdrBean.getToDate()));
oParameters.add(new DBObject(7, 1, 12, oWflDelegateMstHdrBean.getDelegateAllDoc()));
oParameters.add(new DBObject(8, 1, 12, oWflDelegateMstHdrBean.getRemarks()));
oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(10, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(11, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(12, 2, 12));
oParameters.add(new DBObject(13, 2, 12));
oParameters.add(new DBObject(14, 2, 12));
oParameters.add(new DBObject(15, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLDELEGATIONMST.proc_UpsertWflDelegationHdr(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
returnString = (String)oOutObject.getObject();
} else if (ScreenMode.equalsIgnoreCase("D")) {
oParameters.add(new DBObject(1, 1, 12, oWflDelegateMstHdrBean.getHeaderPrimaryKey()));
oParameters.add(new DBObject(2, 2, 12));
oParameters.add(new DBObject(3, 2, 12));
oParameters.add(new DBObject(4, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLDELEGATIONMST.proc_DeleteWflDelegationHdr(?,?,?,?)");
}
return returnString;
}
public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
if (sScreenName.equalsIgnoreCase("WflDelegationMst"))
saveWflDelegationDtls(sHeaderPrimaryKey, oDetailBeanArray);
}
public void saveWflDelegationDtls(String sHeaderPrimaryKey, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
boolean bInsert = false;
boolean bUpdate = false;
boolean bDelete = false;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = null;
DBUtilitiesBean oBean1 = null;
Iterator oIt = oDetailBeanArray.iterator();
while (oIt.hasNext()) {
WflDelegateMstDtlBean oWflDelegateMstDtlBean = oIt.next();
if (oWflDelegateMstDtlBean.getStatus().equals("N")) {
if (!bInsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WFLDELEGATIONMST.proc_UpsertWflDelegationDtl(?,?,?,?,?,?,?)");
bInsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
oParameters.add(new DBObject(4, 1, 12, oWflDelegateMstDtlBean.getTxtDocTypeId()));
oParameters.add(new DBObject(5, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflDelegateMstDtlBean.getStatus().equals("U")) {
if (!bUpdate) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WFLDELEGATIONMST.proc_UpsertWflDelegationDtl(?,?,?,?,?,?,?)");
bUpdate = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWflDelegateMstDtlBean.getDetailId()));
oParameters.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
oParameters.add(new DBObject(4, 1, 12, oWflDelegateMstDtlBean.getTxtDocTypeId()));
oParameters.add(new DBObject(5, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflDelegateMstDtlBean.getStatus().equals("D")) {
if (!bDelete) {
oBean1 = new DBUtilitiesBean();
oBean1.createBatch("WFLDELEGATIONMST.proc_DeleteWflDelegationDtl(?)");
bDelete = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWflDelegateMstDtlBean.getDetailId()));
oBean1.addToBatch(oParameters);
}
}
if (bInsert)
oBean.executeBatch();
if (bUpdate)
oBean.executeBatch();
if (bDelete)
oBean1.executeBatch();
}
public void updateHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
System.out.println("Update Nischt!");
}
public String saveNewHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
return "saveNewHeaderImpl Nischt!";
}
public void additionalFieldValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oErrorList = new ArrayList();
WflDelegateMstHdrBean oWflDelegateMstHdrBean = (WflDelegateMstHdrBean)oBaseHeaderBean;
if (bHeaderDataChanged)
if (!sScreenMode.equalsIgnoreCase("D"))
checkMandatoryHeader(oWflDelegateMstHdrBean);
if (bDetailDataChanged)
if (sScreenName.equalsIgnoreCase("WflDelegationMst")) {
Iterator oIt = oDetailBeanArray.iterator();
int count = 1;
while (oIt.hasNext()) {
WflDelegateMstDtlBean oWflDelegateMstDtlBean = oIt.next();
if (!oWflDelegateMstDtlBean.getStatus().equalsIgnoreCase("D"))
checkMandatoryDtls(oWflDelegateMstDtlBean, count, oDetailBeanArray);
count++;
}
}
reportError(oErrorList);
}
private void checkMandatoryHeader(WflDelegateMstHdrBean oWflDelegateMstHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oList = new ArrayList();
if (!EnrgiseUtil.checkString(oWflDelegateMstHdrBean.getEmpNo())) {
MessageKey oMessageKey = new MessageKey("WFL.WflDelegateMst.empNo");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWflDelegateMstHdrBean.getFromDate())) {
MessageKey oMessageKey = new MessageKey("WFL.WflDelegateMst.fromDate");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWflDelegateMstHdrBean.getToDate())) {
MessageKey oMessageKey = new MessageKey("WFL.WflDelegateMst.toDate");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParam, "E"));
}
reportError(oList);
}
private void checkMandatoryDtls(WflDelegateMstDtlBean oWflDelegateMstDtlBean, int count, ArrayList oDetailBeanArray) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oList = new ArrayList();
if (!EnrgiseUtil.checkString(oWflDelegateMstDtlBean.getTxtDocType())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WflDelegateMst.docType");
oParam.add(oMessageKey);
oParam.add(new Integer(count));
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWflDelegateMstDtlBean.getTxtDesc())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WflDelegateMst.desc");
oParam.add(oMessageKey);
oParam.add(new Integer(count));
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParam, "E"));
}
reportError(oList);
}
public void additionalTimestampValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {}
public void additionalBusinessValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDelegateMstHdrBean oWflDelegateMstHdrBean = (WflDelegateMstHdrBean)oBaseHeaderBean;
ArrayList oErrorList = new ArrayList();
checkDatesConstraint(oWflDelegateMstHdrBean, oErrorList);
checkDuplicateHeader(oWflDelegateMstHdrBean, oErrorList);
checkDelegationFlag(oWflDelegateMstHdrBean, oErrorList);
if (bDetailDataChanged)
if (!sScreenMode.equalsIgnoreCase("D"))
if (sScreenName.equalsIgnoreCase("WflDelegationMst")) {
checkUniqueMaterialDtl(oBaseHeaderBean.getHeaderPrimaryKey(), oDetailBeanArray, oErrorList);
EnrgiseUtil.checkDuplicate(oDetailBeanArray, "txtDocType", "WFL.WflDelegateMst.docType", oErrorList, true);
}
reportError(oErrorList);
}
private void checkUniqueMaterialDtl(String sHeaderPrimaryKey, ArrayList oDetailBeanArray, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
Iterator oIt1 = oDetailBeanArray.iterator();
int rowCount = 1;
while (oIt1.hasNext()) {
WflDelegateMstDtlBean oWflDelegateMstDtlBean = oIt1.next();
if (!EnrgiseUtil.checkString(oWflDelegateMstDtlBean.getDetailId())) {
String sQuery = String.valueOf(String.valueOf(String.valueOf(String.valueOf(" Select id as ID from wfl_delegation_dtl where doc_type_id='").concat(String.valueOf(oWflDelegateMstDtlBean.getTxtDocTypeId()))).concat(String.valueOf("' and hdr_id = '"))).concat(String.valueOf(sHeaderPrimaryKey))).concat(String.valueOf("' "));
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
QueryRow oRow = oIt.next();
if (!oRow.get("ID").getString().equalsIgnoreCase(oWflDelegateMstDtlBean.getDetailId())) {
ArrayList oParams = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WflDelegateMst.docType");
oParams.add(oMessageKey);
oParams.add(new Integer(rowCount));
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.workflow.detail.UniqueKeyConstraint", oParams));
}
}
rowCount++;
}
rowCount++;
}
reportError(oErrorList);
}
private void checkDatesConstraint(WflDelegateMstHdrBean oWflDelegateMstHdrBean, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
DateFormat dateFormat = new SimpleDateFormat("dd-MMM-yyyy");
int dateFlag = EnrgiseUtil.compareDates(dateFormat, oWflDelegateMstHdrBean.getFromDate(), oWflDelegateMstHdrBean.getToDate());
if (dateFlag == 1 && dateFlag != -2)
oErrorList.add(new EnrgiseApplicationException("WFL.WflDelegateMst.dateConstraint"));
}
public void checkDelegationFlag(WflDelegateMstHdrBean oWflDelegateMstHdrBean, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oList = new ArrayList();
long sArraySize = getWflDelegationDtlMetaInfo(oWflDelegateMstHdrBean.getHeaderPrimaryKey()).getRecordCount();
if (EnrgiseUtil.checkString(oWflDelegateMstHdrBean.getDelegateAllDoc()))
if (oWflDelegateMstHdrBean.getDelegateAllDoc().equalsIgnoreCase("Y") && sArraySize != 0L)
oErrorList.add(new EnrgiseApplicationException("WFL.WflDelegateMst.deleteDetailRec"));
}
public LovVO getWflDtlDocTypeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
String sQuery = "select wdtd.id,wdtd.doc_dtl_code,wdtd.doc_dtl_desc from wfl_doc_type_dtl wdtd ";
if (oLovQueryVO.getSearchField1() != null)
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" where upper(wdtd.doc_dtl_code) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("WFL.WflDelegateMst.docType");
oHeaderList.add("WFL.WflDelegateMst.desc");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("id").getString());
oLOVBean.setDetailField2(oRow.get("doc_dtl_code").getString());
oLOVBean.setDetailField3(oRow.get("doc_dtl_desc").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
public void checkDuplicateHeader(WflDelegateMstHdrBean oWflDelegateMstHdrBean, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
String sQuery = String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf("select t.id from wfl_delegation_hdr t, (select '").concat(String.valueOf(oWflDelegateMstHdrBean.getFromDate()))).concat(String.valueOf("' a, '"))).concat(String.valueOf(oWflDelegateMstHdrBean.getToDate()))).concat(String.valueOf("' b from dual) x where x.a between t.from_dt and t.to_dt and x.b between t.from_dt and t.to_dt and t.delegator_id = "))).concat(String.valueOf(this.oUserInfo.getUserId()))).concat(String.valueOf(" and t.delegated_id='"))).concat(String.valueOf(oWflDelegateMstHdrBean.getEmpId()))).concat(String.valueOf("' and t.all_doc = '"))).concat(String.valueOf(oWflDelegateMstHdrBean.getDelegateAllDoc()))).concat(String.valueOf("' "));
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
QueryRow oRow = oIt.next();
if (!oRow.get("ID").getString().equalsIgnoreCase(oWflDelegateMstHdrBean.getHeaderPrimaryKey()))
oErrorList.add(new EnrgiseApplicationException("WFL.WflDelegateMst.alreadyDelegated"));
}
}
}

View File

@@ -0,0 +1,824 @@
package wenrgise.workflow.ejb.business;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Iterator;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.bean.LOVBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseMessageKeyException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.MessageKey;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.ejb.common.business.BaseBO;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.workflow.bean.WflDocMstAttrDtlBean;
import wenrgise.workflow.bean.WflDocMstConditionsDtlBean;
import wenrgise.workflow.bean.WflDocMstHdrBean;
import wenrgise.workflow.bean.WflDtlDocTypeDtlBean;
import wenrgise.workflow.vo.WflDocMstQVO;
public class WflDocMstBO extends BaseBO {
public WflDocMstBO() {}
public WflDocMstBO(UserInfo oUserInfo) {
super(oUserInfo);
}
public void updateHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {}
public String saveNewHeaderImpl(BaseHeaderBean oBaseHeaderBean) throws EnrgiseSystemException {
return "saveNewHeaderImpl ille!";
}
public void additionalFieldValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oErrorList = new ArrayList();
if (bHeaderDataChanged)
if (!sScreenMode.equalsIgnoreCase("D")) {
checkMandatoryHdr((WflDocMstHdrBean)oBaseHeaderBean);
checkNumericFields((WflDocMstHdrBean)oBaseHeaderBean, oErrorList);
}
if (bDetailDataChanged)
if (sScreenName.equalsIgnoreCase("WflWorkflowConditions")) {
Iterator oIt = oDetailBeanArray.iterator();
int count = 1;
while (oIt.hasNext()) {
WflDocMstConditionsDtlBean oWflDocMstConditionsDtlBean = oIt.next();
if (!oWflDocMstConditionsDtlBean.getStatus().equalsIgnoreCase("D"))
checkMandatoryDtls(oWflDocMstConditionsDtlBean, count, oDetailBeanArray);
count++;
}
} else if (sScreenName.equalsIgnoreCase("WFLDoctAttrDetail")) {
Iterator oIt1 = oDetailBeanArray.iterator();
int count = 1;
while (oIt1.hasNext()) {
WflDocMstAttrDtlBean oWflDocMstAttrDtlBean = oIt1.next();
if (!oWflDocMstAttrDtlBean.getStatus().equalsIgnoreCase("D"))
checkMandatoryDtls(oWflDocMstAttrDtlBean, count, oErrorList);
count++;
}
} else if (sScreenName.equalsIgnoreCase("WflDtlDocType")) {
Iterator oIt1 = oDetailBeanArray.iterator();
int count = 1;
while (oIt1.hasNext()) {
WflDtlDocTypeDtlBean oWflDtlDocTypeDtlBean = oIt1.next();
if (!oWflDtlDocTypeDtlBean.getStatus().equalsIgnoreCase("D"))
checkMandatoryDtlsDocType(oWflDtlDocTypeDtlBean, count, oErrorList);
count++;
}
}
reportError(oErrorList);
}
public void additionalTimestampValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {}
public void additionalBusinessValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oErrorList = new ArrayList();
if (bHeaderDataChanged)
if (sScreenName.equalsIgnoreCase("WFLDoctAttrDetail"))
checkUniqueHeader((WflDocMstHdrBean)oBaseHeaderBean);
if (bDetailDataChanged)
if (!sScreenMode.equalsIgnoreCase("D")) {
if (sScreenName.equalsIgnoreCase("WflWorkflowConditions")) {
Iterator oIt1 = oDetailBeanArray.iterator();
checkUniqueMaterialDtl(oBaseHeaderBean.getHeaderPrimaryKey(), oDetailBeanArray, oErrorList);
}
if (sScreenName.equalsIgnoreCase("WflDtlDocType")) {
Iterator oIt1 = oDetailBeanArray.iterator();
EnrgiseUtil.checkDuplicate(oDetailBeanArray, "txtDtlDocCode", "WFL.WFLDtlDocType.dtlDocCode", oErrorList, true);
checkUniqueDocDtl(oBaseHeaderBean.getHeaderPrimaryKey(), oDetailBeanArray, oErrorList);
}
if (sScreenName.equalsIgnoreCase("WFLDoctAttrDetail")) {
EnrgiseUtil.checkDuplicate(oDetailBeanArray, "txtAttrName", "WFL.WFLDocAttrDtl.attbName", oErrorList, true);
checkUniqueDocAttrDtl(oBaseHeaderBean.getHeaderPrimaryKey(), oDetailBeanArray, oErrorList);
}
}
reportError(oErrorList);
}
public void initializeBOImpl() {
this.headerTable = "WFL_DOC_TYPE_MST";
}
public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
if (sScreenName.equalsIgnoreCase("WFLDoctAttrDetail")) {
saveWflDocAttrDtls(sHeaderPrimaryKey, oDetailBeanArray);
} else if (sScreenName.equalsIgnoreCase("WflWorkflowConditions")) {
saveWflDocConditionsDtls(sHeaderPrimaryKey, oDetailBeanArray);
} else if (sScreenName.equalsIgnoreCase("WflDtlDocType")) {
saveWflDtlDocTypeDtls(sHeaderPrimaryKey, oDetailBeanArray);
}
}
public RecordMetaInfo getWflDocTypeHdrMetaInfo(WflDocMstQVO oWflDocMstQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
Timestamp oWhenPicked = null;
int count = 0;
BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWflDocMstQVO.getHeaderPrimaryKey()));
oParameters.add(new DBObject(2, 2, -5));
oParameters.add(new DBObject(3, 2, 93));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDocumentMst.proc_GetWFlDocTypeHdrMetaInfo(?,?,?,?,?,?)");
RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
DBObject oTimeObject = oOutArray.get(1);
oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
DBObject oTotalRecord = oOutArray.get(0);
oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
return oRecordMetaInfo;
}
public ArrayList getWflDocTypeHdrInfo(WflDocMstQVO oWflDocMstQVO, long lStartPosition, long lLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
int count = 0;
BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO();
ArrayList oHeaderList = null;
if (oWflDocMstQVO == null)
oWflDocMstQVO = new WflDocMstQVO();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, -5, new Long(lStartPosition)));
oParameters.add(new DBObject(2, 1, -5, new Long(lLastPosition)));
oParameters.add(new DBObject(3, 1, 12, oWflDocMstQVO.getHeaderPrimaryKey()));
oParameters.add(new DBObject(4, 2, -10));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDocumentMst.proc_GetWFlDocTypeHdrInfo(?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
ArrayList oList = (ArrayList)oOutObject.getObject();
if (oList.size() == 0)
throw new EnrgiseApplicationException("wenrgise.workflow.norecordfound", "M");
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oHeaderList = new ArrayList();
count++;
oRow = oIt.next();
WflDocMstHdrBean oWflDocMstHdrBean = new WflDocMstHdrBean();
oWflDocMstHdrBean.setHeaderPrimaryKey(oRow.get("ID").getString());
oWflDocMstHdrBean.setDocumentCode(oRow.get("doc_type_code").getString());
oWflDocMstHdrBean.setDocumentDesc(oRow.get("doc_type_desc").getString());
oWflDocMstHdrBean.setMaxAppLevel(oRow.get("max_aprooval_level").getString());
oHeaderList.add(oWflDocMstHdrBean);
}
return oHeaderList;
}
public RecordMetaInfo getWflDocTypeAttrDtlMetaInfo(String sPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new String(sPrimaryKey)));
oParameters.add(new DBObject(2, 2, -5));
oParameters.add(new DBObject(3, 2, 93));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDocumentMst.proc_GetWFlDocTypeDtlMetaInfo(?,?,?,?,?,?)");
RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
DBObject oTotalRecord = oOutArray.get(0);
oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
DBObject oTimeObject = oOutArray.get(1);
oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
System.out.println(oRecordMetaInfo);
return oRecordMetaInfo;
}
public ArrayList getWflDocTypeAttrDtlInfo(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
DBUtilitiesBean oBean = new DBUtilitiesBean();
QueryRow oRow = null;
ArrayList oList = null;
Iterator oIt = null;
ArrayList oDtlList = new ArrayList();
ArrayList oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new Long(lDetailFirstPosition)));
oParameters.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
oParameters.add(new DBObject(3, 1, 12, lPrimaryKey));
oParameters.add(new DBObject(4, 2, -10));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDocumentMst.proc_GetWFlDocTypeDtlInfo(?,?,?,?,?,?,?)");
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
WflDocMstAttrDtlBean oWflDocMstAttrDtlBean = new WflDocMstAttrDtlBean();
oWflDocMstAttrDtlBean.setDetailId(oRow.get("Id").getString());
oWflDocMstAttrDtlBean.setTxtAttrName(oRow.get("attr_name").getString());
oWflDocMstAttrDtlBean.setTxtType(oRow.get("attr_type").getString());
oWflDocMstAttrDtlBean.setTxtDesc(oRow.get("attr_desc").getString());
oWflDocMstAttrDtlBean.setTxtLovKey(oRow.get("attr_lov_key").getString());
oDtlList.add(oWflDocMstAttrDtlBean);
}
return oDtlList;
}
public RecordMetaInfo getWflDocTypeConditionsDtlMetaInfo(String sPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new String(sPrimaryKey)));
oParameters.add(new DBObject(2, 2, -5));
oParameters.add(new DBObject(3, 2, 93));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDocumentMst.proc_GetWFlDocCondDtlMetaInfo(?,?,?,?,?,?)");
RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
DBObject oTotalRecord = oOutArray.get(0);
oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
DBObject oTimeObject = oOutArray.get(1);
oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
System.out.println(oRecordMetaInfo);
return oRecordMetaInfo;
}
public ArrayList getWflDocTypeConditionsDtlInfo(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
DBUtilitiesBean oBean = new DBUtilitiesBean();
QueryRow oRow = null;
ArrayList oList = null;
Iterator oIt = null;
ArrayList oDtlList = new ArrayList();
ArrayList oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new Long(lDetailFirstPosition)));
oParameters.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
oParameters.add(new DBObject(3, 1, 12, lPrimaryKey));
oParameters.add(new DBObject(4, 2, -10));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDocumentMst.proc_GetWFlDocCondDtlInfo(?,?,?,?,?,?,?)");
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
WflDocMstConditionsDtlBean oWflDocMstConditionsDtlBean = new WflDocMstConditionsDtlBean();
oWflDocMstConditionsDtlBean.setDetailId(oRow.get("Id").getString());
oWflDocMstConditionsDtlBean.setDocTypeDtlDesc(oRow.get("condition_desc").getString());
oWflDocMstConditionsDtlBean.setConditionExpression(oRow.get("condition_expression").getString());
oDtlList.add(oWflDocMstConditionsDtlBean);
}
return oDtlList;
}
public RecordMetaInfo getDtlDocTypeMetaInfo(String sPrimaryKey) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new String(sPrimaryKey)));
oParameters.add(new DBObject(2, 2, -5));
oParameters.add(new DBObject(3, 2, 93));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDocumentMst.proc_GetDtlDocTypeMetaInfo(?,?,?,?,?,?)");
RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
DBObject oTotalRecord = oOutArray.get(0);
oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
DBObject oTimeObject = oOutArray.get(1);
oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
System.out.println(oRecordMetaInfo);
return oRecordMetaInfo;
}
public ArrayList getDtlDocTypeInfo(String lPrimaryKey, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
DBUtilitiesBean oBean = new DBUtilitiesBean();
QueryRow oRow = null;
ArrayList oList = null;
Iterator oIt = null;
ArrayList oDtlList = new ArrayList();
ArrayList oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new Long(lDetailFirstPosition)));
oParameters.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
oParameters.add(new DBObject(3, 1, 12, lPrimaryKey));
oParameters.add(new DBObject(4, 2, -10));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDocumentMst.proc_DtlDocTypeInfo(?,?,?,?,?,?,?)");
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
WflDtlDocTypeDtlBean oWflDtlDocTypeDtlBean = new WflDtlDocTypeDtlBean();
oWflDtlDocTypeDtlBean.setDetailId(oRow.get("Id").getString());
oWflDtlDocTypeDtlBean.setTxtDtlDocCode(oRow.get("doc_dtl_code").getString());
oWflDtlDocTypeDtlBean.setTxtDtlDocDesc(oRow.get("doc_dtl_desc").getString());
oWflDtlDocTypeDtlBean.setTxtConditionId(oRow.get("condition_id").getString());
oWflDtlDocTypeDtlBean.setTxtPriority(oRow.get("priority").getString());
oWflDtlDocTypeDtlBean.setTxtExp(oRow.get("condition_expression").getString());
oWflDtlDocTypeDtlBean.setTxtConDesc(oRow.get("condition_desc").getString());
oWflDtlDocTypeDtlBean.setDisabbutCondDesc("true");
oDtlList.add(oWflDtlDocTypeDtlBean);
}
return oDtlList;
}
public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String ScreenMode) throws EnrgiseSystemException {
String returnString = null;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
WflDocMstHdrBean oWflDocMstHdrBean = (WflDocMstHdrBean)oBaseHeaderBean;
if (ScreenMode.equalsIgnoreCase("N")) {
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, oWflDocMstHdrBean.getDocumentCode()));
oParameters.add(new DBObject(4, 1, 12, oWflDocMstHdrBean.getDocumentDesc()));
oParameters.add(new DBObject(5, 1, 12, oWflDocMstHdrBean.getMaxAppLevel()));
oParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(9, 2, 12));
oParameters.add(new DBObject(10, 2, 12));
oParameters.add(new DBObject(11, 2, 12));
oParameters.add(new DBObject(12, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDocumentMst.proc_UpsertWflDocTypeMstHdr(?,?,?,?,?,?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
returnString = (String)oOutObject.getObject();
} else if (ScreenMode.equalsIgnoreCase("U")) {
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWflDocMstHdrBean.getHeaderPrimaryKey()));
oParameters.add(new DBObject(3, 1, 12, oWflDocMstHdrBean.getDocumentCode()));
oParameters.add(new DBObject(4, 1, 12, oWflDocMstHdrBean.getDocumentDesc()));
oParameters.add(new DBObject(5, 1, 12, oWflDocMstHdrBean.getMaxAppLevel()));
oParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(9, 2, 12));
oParameters.add(new DBObject(10, 2, 12));
oParameters.add(new DBObject(11, 2, 12));
oParameters.add(new DBObject(12, 2, 12));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDocumentMst.proc_UpsertWflDocTypeMstHdr(?,?,?,?,?,?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
returnString = (String)oOutObject.getObject();
} else if (ScreenMode.equalsIgnoreCase("D")) {
oParameters.add(new DBObject(1, 1, 12, oWflDocMstHdrBean.getHeaderPrimaryKey()));
ArrayList oOutArray = oBean.callProc(oParameters, "WflDocumentMst.proc_DeleteWflDocTypeMstHdr(?)");
}
return returnString;
}
private void saveWflDocAttrDtls(String sHeaderPrimaryKey, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
boolean bInsert = false;
boolean bUpdate = false;
boolean bDelete = false;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = null;
DBUtilitiesBean oBean1 = null;
Iterator oIt = oDetailBeanArray.iterator();
while (oIt.hasNext()) {
WflDocMstAttrDtlBean oWflDocMstAttrDtlBean = oIt.next();
if (oWflDocMstAttrDtlBean.getStatus().equals("N")) {
if (!bInsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflDocumentMst.proc_UpsertWflDocMstAttrDtl(?,?,?,?,?,?,?,?,?,?)");
bInsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
oParameters.add(new DBObject(4, 1, 12, oWflDocMstAttrDtlBean.getTxtAttrName()));
oParameters.add(new DBObject(5, 1, 12, oWflDocMstAttrDtlBean.getTxtDesc()));
oParameters.add(new DBObject(6, 1, 12, oWflDocMstAttrDtlBean.getTxtType()));
oParameters.add(new DBObject(7, 1, 12, oWflDocMstAttrDtlBean.getTxtLovKey()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(10, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflDocMstAttrDtlBean.getStatus().equals("U")) {
if (!bUpdate) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflDocumentMst.proc_UpsertWflDocMstAttrDtl(?,?,?,?,?,?,?,?,?,?)");
bUpdate = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWflDocMstAttrDtlBean.getDetailId()));
oParameters.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
oParameters.add(new DBObject(4, 1, 12, oWflDocMstAttrDtlBean.getTxtAttrName()));
oParameters.add(new DBObject(5, 1, 12, oWflDocMstAttrDtlBean.getTxtDesc()));
oParameters.add(new DBObject(6, 1, 12, oWflDocMstAttrDtlBean.getTxtType()));
oParameters.add(new DBObject(7, 1, 12, oWflDocMstAttrDtlBean.getTxtLovKey()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(10, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflDocMstAttrDtlBean.getStatus().equals("D")) {
if (!bDelete) {
oBean1 = new DBUtilitiesBean();
oBean1.createBatch("WflDocumentMst.proc_DeleteWflDocMstAttrDtl(?)");
bDelete = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWflDocMstAttrDtlBean.getDetailId()));
oBean1.addToBatch(oParameters);
}
}
if (bInsert)
oBean.executeBatch();
if (bUpdate)
oBean.executeBatch();
if (bDelete)
oBean1.executeBatch();
}
private void saveWflDocConditionsDtls(String sHeaderPrimaryKey, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
boolean bInsert = false;
boolean bUpdate = false;
boolean bDelete = false;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = null;
DBUtilitiesBean oBean1 = null;
Iterator oIt = oDetailBeanArray.iterator();
while (oIt.hasNext()) {
WflDocMstConditionsDtlBean oWflDocMstConditionsDtlBean = oIt.next();
if (oWflDocMstConditionsDtlBean.getStatus().equals("N")) {
if (!bInsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflDocumentMst.proc_UpsertWflDocMstCondDtl(?,?,?,?,?,?,?,?)");
bInsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
oParameters.add(new DBObject(4, 1, 12, oWflDocMstConditionsDtlBean.getDocTypeDtlDesc()));
oParameters.add(new DBObject(5, 1, 12, oWflDocMstConditionsDtlBean.getConditionExpression()));
oParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflDocMstConditionsDtlBean.getStatus().equals("U")) {
if (!bUpdate) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflDocumentMst.proc_UpsertWflDocMstCondDtl(?,?,?,?,?,?,?,?)");
bUpdate = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWflDocMstConditionsDtlBean.getDetailId()));
oParameters.add(new DBObject(3, 1, 12, sHeaderPrimaryKey));
oParameters.add(new DBObject(4, 1, 12, oWflDocMstConditionsDtlBean.getDocTypeDtlDesc()));
oParameters.add(new DBObject(5, 1, 12, oWflDocMstConditionsDtlBean.getConditionExpression()));
oParameters.add(new DBObject(6, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflDocMstConditionsDtlBean.getStatus().equals("D")) {
if (!bDelete) {
oBean1 = new DBUtilitiesBean();
oBean1.createBatch("WflDocumentMst.proc_DeleteWflDocMstCondDtl(?)");
bDelete = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWflDocMstConditionsDtlBean.getDetailId()));
oBean1.addToBatch(oParameters);
}
}
if (bInsert)
oBean.executeBatch();
if (bUpdate)
oBean.executeBatch();
if (bDelete)
oBean1.executeBatch();
}
private void saveWflDtlDocTypeDtls(String sHeaderPrimaryKey, ArrayList oDetailBeanArray) throws EnrgiseSystemException {
boolean bInsert = false;
boolean bUpdate = false;
boolean bDelete = false;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = null;
DBUtilitiesBean oBean1 = null;
Iterator oIt = oDetailBeanArray.iterator();
while (oIt.hasNext()) {
WflDtlDocTypeDtlBean oWflDtlDocTypeDtlBean = oIt.next();
if (oWflDtlDocTypeDtlBean.getStatus().equals("N")) {
if (!bInsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflDocumentMst.proc_UpsertWflDtlDocTypeDtls(?,?,?,?,?,?,?,?,?)");
bInsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, oWflDtlDocTypeDtlBean.getTxtDtlDocCode()));
oParameters.add(new DBObject(4, 1, 12, oWflDtlDocTypeDtlBean.getTxtDtlDocDesc()));
oParameters.add(new DBObject(5, 1, 12, oWflDtlDocTypeDtlBean.getTxtConditionId()));
oParameters.add(new DBObject(6, 1, 12, oWflDtlDocTypeDtlBean.getTxtPriority()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflDtlDocTypeDtlBean.getStatus().equals("U")) {
if (!bUpdate) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflDocumentMst.proc_UpsertWflDtlDocTypeDtls(?,?,?,?,?,?,?,?,?)");
bUpdate = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWflDtlDocTypeDtlBean.getDetailId()));
oParameters.add(new DBObject(3, 1, 12, oWflDtlDocTypeDtlBean.getTxtDtlDocCode()));
oParameters.add(new DBObject(4, 1, 12, oWflDtlDocTypeDtlBean.getTxtDtlDocDesc()));
oParameters.add(new DBObject(5, 1, 12, oWflDtlDocTypeDtlBean.getTxtConditionId()));
oParameters.add(new DBObject(6, 1, 12, oWflDtlDocTypeDtlBean.getTxtPriority()));
oParameters.add(new DBObject(7, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWflDtlDocTypeDtlBean.getStatus().equals("D")) {
if (!bDelete) {
oBean1 = new DBUtilitiesBean();
oBean1.createBatch("WflDocumentMst.proc_DeleteWflDtlDocTypeDtls(?)");
bDelete = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWflDtlDocTypeDtlBean.getDetailId()));
oBean1.addToBatch(oParameters);
}
}
if (bInsert)
oBean.executeBatch();
if (bUpdate)
oBean.executeBatch();
if (bDelete)
oBean1.executeBatch();
}
public LovVO getWflDocCodeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
String sQuery = "Select distinct wdtm.id as Id,wdtm.doc_type_code as doc_type_code,wdtm.DOC_TYPE_DESC as DOC_TYPE_DESC,wdtm.max_aprooval_level as max_aprooval_level from wfl_doc_type_mst wdtm";
if (oLovQueryVO.getSearchField1() != null)
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" where upper(wdtm.doc_type_code) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("WFL.WFLDocAttrDtl.documentCode");
oHeaderList.add("WFL.WFLDocAttrDtl.documentDesc");
oHeaderList.add("WFL.WFLDocAttrDtl.maxAppLevel");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("Id").getString());
oLOVBean.setDetailField2(oRow.get("doc_type_code").getString());
oLOVBean.setDetailField3(oRow.get("DOC_TYPE_DESC").getString());
oLOVBean.setDetailField4(oRow.get("max_aprooval_level").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
public LovVO getWflDtlDocCodeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
String sQuery = String.valueOf("select wc.id,wc.condition_desc,wc.condition_expression from wfl_condition wc where wc.doc_type_hdr_id=").concat(String.valueOf(oLovQueryVO.getProperty("documentId")));
if (oLovQueryVO.getSearchField1() != null)
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wc.condition_desc) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("WFL.WFLDtlDocType.conditionDesc");
oHeaderList.add("WFL.WFLDtlDocType.exp");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("id").getString());
oLOVBean.setDetailField2(oRow.get("condition_desc").getString());
oLOVBean.setDetailField3(oRow.get("condition_expression").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
private void checkMandatoryDtls(WflDocMstConditionsDtlBean oWflDocMstConditionsDtlBean, int count, ArrayList oDetailBeanArray) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oList = new ArrayList();
if (!EnrgiseUtil.checkString(oWflDocMstConditionsDtlBean.getDocTypeDtlDesc())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("wfl.WorkFlowConditions.docDtlDesc");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryfieldmissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWflDocMstConditionsDtlBean.getConditionExpression())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("wfl.WorkFlowConditions.condExp");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryfieldmissing", oParam, "E"));
}
reportError(oList);
}
private void checkMandatoryHdr(WflDocMstHdrBean oWflDocMstHdrBean) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oList = new ArrayList();
if (!EnrgiseUtil.checkString(oWflDocMstHdrBean.getDocumentCode())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDocAttrDtl.documentCode");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryfieldmissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWflDocMstHdrBean.getDocumentDesc())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDocAttrDtl.documentDesc");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryfieldmissing", oParam, "E"));
}
reportError(oList);
}
private void checkMandatoryDtls(WflDocMstAttrDtlBean oWflDocMstAttrDtlBean, int count, ArrayList oDetailBeanArray) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oList = new ArrayList();
if (!EnrgiseUtil.checkString(oWflDocMstAttrDtlBean.getTxtAttrName())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDocAttrDtl.attbName");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryfieldmissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWflDocMstAttrDtlBean.getTxtType())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDocAttrDtl.type");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryfieldmissing", oParam, "E"));
}
reportError(oList);
}
private void checkNumericFields(WflDocMstHdrBean oWflDocMstHdrBean, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
if (!EnrgiseUtil.checkNumber(oWflDocMstHdrBean.getMaxAppLevel(), 10, 4, "P")) {
MessageKey oMessageKey = new MessageKey("WFL.WFLDocAttrDtl.maxAppLevel");
ArrayList oParams = new ArrayList();
oParams.add(oMessageKey);
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.invalidNumber", oParams));
}
}
private void checkUniqueMaterialDtl(String sHeaderPrimaryKey, ArrayList oDetailBeanArray, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
Iterator oIt1 = oDetailBeanArray.iterator();
int rowCount = 1;
while (oIt1.hasNext()) {
WflDocMstConditionsDtlBean oWflDocMstConditionsDtlBean = oIt1.next();
if (!EnrgiseUtil.checkString(oWflDocMstConditionsDtlBean.getDetailId())) {
String sQuery = String.valueOf(String.valueOf(String.valueOf(String.valueOf(" Select ID as ID from wfl_condition where CONDITION_DESC= '").concat(String.valueOf(oWflDocMstConditionsDtlBean.getDocTypeDtlDesc()))).concat(String.valueOf("' and CONDITION_EXPRESSION='"))).concat(String.valueOf(oWflDocMstConditionsDtlBean.getConditionExpression()))).concat(String.valueOf("' "));
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
ArrayList oParams = new ArrayList();
MessageKey oMessageKey = new MessageKey("wfl.WorkFlowConditions.docDtlDesc");
MessageKey oMessageKey1 = new MessageKey("wfl.WorkFlowConditions.condExp");
oParams.add(oMessageKey);
oParams.add(oMessageKey1);
oParams.add(new Integer(rowCount));
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.workflow.detail.UniqueKeyConstraint", oParams));
}
}
rowCount++;
}
}
private void checkMandatoryDtlsDocType(WflDtlDocTypeDtlBean oWflDtlDocTypeDtlBean, int count, ArrayList oDetailBeanArray) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oList = new ArrayList();
if (!EnrgiseUtil.checkString(oWflDtlDocTypeDtlBean.getTxtDtlDocCode())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDtlDocType.dtlDocCode");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryfieldmissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWflDtlDocTypeDtlBean.getTxtDtlDocDesc())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDtlDocType.dtlDocDesc");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryfieldmissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWflDtlDocTypeDtlBean.getTxtConDesc())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDtlDocType.conditionDesc");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryfieldmissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWflDtlDocTypeDtlBean.getTxtExp())) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDtlDocType.exp");
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryfieldmissing", oParam, "E"));
}
reportError(oList);
}
private void checkUniqueDocDtl(String sHeaderPrimaryKey, ArrayList oDetailBeanArray, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
Iterator oIt1 = oDetailBeanArray.iterator();
int rowCount = 1;
while (oIt1.hasNext()) {
WflDtlDocTypeDtlBean oWflDtlDocTypeDtlBean = oIt1.next();
if (!EnrgiseUtil.checkString(oWflDtlDocTypeDtlBean.getTxtDtlDocCode())) {
String sQuery = String.valueOf(String.valueOf(String.valueOf(" select a.id as Id from wfl_doc_type_dtl a where a.id= ").concat(String.valueOf(sHeaderPrimaryKey))).concat(String.valueOf(" and a.doc_dtl_code="))).concat(String.valueOf(oWflDtlDocTypeDtlBean.getTxtDtlDocCode()));
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
ArrayList oParams = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDtlDocType.dtlDocCode");
oParams.add(oMessageKey);
oParams.add(new Integer(rowCount));
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.workflow.detail.UniqueKeyConstraint", oParams));
}
}
rowCount++;
}
}
private void checkUniqueDocAttrDtl(String sHeaderPrimaryKey, ArrayList oDetailBeanArray, ArrayList oErrorList) throws EnrgiseApplicationException, EnrgiseSystemException {
int rowCount = 1;
Iterator oIt1 = oDetailBeanArray.iterator();
while (oIt1.hasNext()) {
WflDocMstAttrDtlBean oWflDocMstAttrDtlBean = oIt1.next();
String sQuery = String.valueOf(String.valueOf(String.valueOf(String.valueOf("select t.id from wfl_doc_attributes t where t.doc_type_hdr_id=").concat(String.valueOf(sHeaderPrimaryKey))).concat(String.valueOf(" and t.attr_name='"))).concat(String.valueOf(oWflDocMstAttrDtlBean.getTxtAttrName()))).concat(String.valueOf("'"));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
QueryRow oRow = oIt.next();
if (!oRow.get("ID").getString().equalsIgnoreCase(oWflDocMstAttrDtlBean.getDetailId())) {
ArrayList oParams = new ArrayList();
MessageKey oMessageKey = new MessageKey("WFL.WFLDtlDocType.dtlDocCode");
oParams.add(oMessageKey);
oParams.add(new Integer(rowCount));
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.workflow.detail.UniqueKeyConstraint", oParams));
}
}
rowCount++;
}
}
private void checkUniqueHeader(WflDocMstHdrBean oWflDocMstHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
String sQuery = String.valueOf(String.valueOf(" select t.id from wfl_doc_type_mst t where t.doc_type_code='").concat(String.valueOf(oWflDocMstHdrBean.getDocumentCode()))).concat(String.valueOf("'"));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
QueryRow oRow = oIt.next();
if (!oRow.get("ID").getString().equalsIgnoreCase(oWflDocMstHdrBean.getHeaderPrimaryKey()))
throw new EnrgiseApplicationException("wenrgise.common.header.uniqueConstraintViolated", "E");
}
}
}

View File

@@ -0,0 +1,706 @@
package wenrgise.workflow.ejb.business;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Iterator;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.bean.LOVBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseMessageKeyException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.MessageKey;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.ejb.common.business.BaseBO;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.workflow.bean.WFLRouteDtlBean;
import wenrgise.workflow.bean.WFLRouteHdrBean;
import wenrgise.workflow.bean.WFLTransDtlBean;
import wenrgise.workflow.vo.WflRouteDtlQVO;
public class WflRouteDtlBO extends BaseBO {
public WflRouteDtlBO() {}
public WflRouteDtlBO(UserInfo oUserInfo) {
super(oUserInfo);
}
public RecordMetaInfo getWFLRouteDtlMetaInfo(WflRouteDtlQVO oWflRouteDtlQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWflRouteDtlQVO.getDtlDocId()));
oParameters.add(new DBObject(2, 1, 12, oWflRouteDtlQVO.getActivityId()));
oParameters.add(new DBObject(3, 2, -5));
oParameters.add(new DBObject(4, 2, 93));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflRouteInfo.proc_GetRouteDtlMetaInfo(?,?,?,?,?,?,?)");
RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
DBObject oTotalRecord = oOutArray.get(0);
oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
DBObject oTimeObject = oOutArray.get(1);
oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
System.out.println(oRecordMetaInfo);
return oRecordMetaInfo;
}
public ArrayList getWFLRouteDtlInfo(WflRouteDtlQVO oWflRouteDtlQVO, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
DBUtilitiesBean oBean = new DBUtilitiesBean();
QueryRow oRow = null;
ArrayList oList = null;
Iterator oIt = null;
ArrayList oDtlList = new ArrayList();
ArrayList oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new Long(lDetailFirstPosition)));
oParameters.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
oParameters.add(new DBObject(3, 1, 12, oWflRouteDtlQVO.getDtlDocId()));
oParameters.add(new DBObject(4, 1, 12, oWflRouteDtlQVO.getActivityId()));
oParameters.add(new DBObject(5, 2, -10));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 12));
oParameters.add(new DBObject(8, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflRouteInfo.proc_GetRouteDtlInfo(?,?,?,?,?,?,?,?)");
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
WFLRouteDtlBean oWFLRouteDtlBean = new WFLRouteDtlBean();
oWFLRouteDtlBean.setDetailId(oRow.get("id").getString());
oWFLRouteDtlBean.setTxtEmpId(oRow.get("e_per_dtl_id").getString());
oWFLRouteDtlBean.setTxtReptHead(oRow.get("rept_head").getString());
oWFLRouteDtlBean.setTxtEmp(oRow.get("emp_no").getString());
oWFLRouteDtlBean.setTxtClassId(oRow.get("class_id").getString());
oWFLRouteDtlBean.setTxtClassCode(oRow.get("class_code").getString());
oWFLRouteDtlBean.setTxtDeptId(oRow.get("deptId").getString());
oWFLRouteDtlBean.setTxtDept(oRow.get("deptCode").getString());
oWFLRouteDtlBean.setTxtGrpId(oRow.get("wfl_group_id").getString());
oWFLRouteDtlBean.setTxtGroup(oRow.get("group_code").getString());
oWFLRouteDtlBean.setTxtLane(oRow.get("lane").getString());
oWFLRouteDtlBean.setTxtLevel(oRow.get("level_number").getString());
oWFLRouteDtlBean.setTxtFlag(oRow.get("split_join_flg").getString());
oWFLRouteDtlBean.setTxtHlevel(oRow.get("hierarchy_level").getString());
oWFLRouteDtlBean.setTxtNotifFlag(oRow.get("notification_flag").getString());
oDtlList.add(oWFLRouteDtlBean);
}
return oDtlList;
}
public RecordMetaInfo getWFLTransDtlMetaInfo(WflRouteDtlQVO oWflRouteDtlQVO) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWflRouteDtlQVO.getDtlDocId()));
oParameters.add(new DBObject(2, 1, 12, oWflRouteDtlQVO.getActivityId()));
oParameters.add(new DBObject(3, 2, -5));
oParameters.add(new DBObject(4, 2, 93));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflRouteInfo.proc_GetRouteTransMetaInfo(?,?,?,?,?,?,?)");
RecordMetaInfo oRecordMetaInfo = new RecordMetaInfo();
DBObject oTotalRecord = oOutArray.get(0);
oRecordMetaInfo.setRecordCount(((Long)oTotalRecord.getObject()).longValue());
DBObject oTimeObject = oOutArray.get(1);
oRecordMetaInfo.setOWhenPicked((Timestamp)oTimeObject.getObject());
System.out.println(oRecordMetaInfo);
return oRecordMetaInfo;
}
public ArrayList getWFLTransDtlInfo(WflRouteDtlQVO oWflRouteDtlQVO, long lDetailFirstPosition, long lDetailLastPosition) throws EnrgiseApplicationException, EnrgiseSystemException {
DBUtilitiesBean oBean = new DBUtilitiesBean();
QueryRow oRow = null;
ArrayList oList = null;
Iterator oIt = null;
ArrayList oDtlList = new ArrayList();
ArrayList oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, new Long(lDetailFirstPosition)));
oParameters.add(new DBObject(2, 1, -5, new Long(lDetailLastPosition)));
oParameters.add(new DBObject(3, 1, 12, oWflRouteDtlQVO.getDtlDocId()));
oParameters.add(new DBObject(4, 1, 12, oWflRouteDtlQVO.getActivityId()));
oParameters.add(new DBObject(5, 2, -10));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 12));
oParameters.add(new DBObject(8, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WflRouteInfo.proc_GetRouteTransInfo(?,?,?,?,?,?,?,?)");
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
WFLTransDtlBean oWFLTransDtlBean = new WFLTransDtlBean();
oWFLTransDtlBean.setDetailId(oRow.get("Id").getString());
oWFLTransDtlBean.setTxtFromRootDtlId(oRow.get("routeFromId").getString());
oWFLTransDtlBean.setTxtToRootDtlId(oRow.get("routeToId").getString());
oWFLTransDtlBean.setTxtFLevel(oRow.get("fromLevel").getString());
oWFLTransDtlBean.setTxtTLevel(oRow.get("toLevel").getString());
oWFLTransDtlBean.setTxtFlane(oRow.get("fromLane").getString());
oWFLTransDtlBean.setTxtTLane(oRow.get("toLane").getString());
oWFLTransDtlBean.setTxtConditionId(oRow.get("wfl_condition_hdr_id").getString());
oWFLTransDtlBean.setTxtCDesc(oRow.get("condition_desc").getString());
oWFLTransDtlBean.setTxtCValue(oRow.get("wfl_condition_value").getString());
oDtlList.add(oWFLTransDtlBean);
}
return oDtlList;
}
public void initializeBOImpl() {
this.headerTable = "WFL_ROUTE_DTL";
}
public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String ScreenMode) throws EnrgiseSystemException {
return null;
}
public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseSystemException {}
public void saveDetailImpl(BaseHeaderBean oBaseHeaderBean, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseApplicationException, EnrgiseSystemException {
if (sScreenName.equalsIgnoreCase("WFLRouteCodeDtl"))
saveRouteDtls(oBaseHeaderBean, oDetailBeanArray);
if (sScreenName.equalsIgnoreCase("WFLRouteTransDtl"))
saveRouteTransDtls(oBaseHeaderBean, oDetailBeanArray);
}
public void saveRouteDtls(BaseHeaderBean oBaseHeaderBean, ArrayList oDetailBeanArray) throws EnrgiseApplicationException, EnrgiseSystemException {
WFLRouteHdrBean oWFLRouteHdrBean = (WFLRouteHdrBean)oBaseHeaderBean;
boolean bUpsert = false;
boolean bDelete = false;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = null;
DBUtilitiesBean oBean1 = null;
Iterator oIt = oDetailBeanArray.iterator();
while (oIt.hasNext()) {
WFLRouteDtlBean oWFLRouteDtlBean = oIt.next();
if (oWFLRouteDtlBean.getStatus().equals("N")) {
if (!bUpsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflRouteInfo.proc_UpsertWflRouteDtl(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
bUpsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, oWFLRouteHdrBean.getActivityId()));
oParameters.add(new DBObject(4, 1, 12, oWFLRouteHdrBean.getDtlDocId()));
oParameters.add(new DBObject(5, 1, 12, oWFLRouteDtlBean.getTxtLane()));
oParameters.add(new DBObject(6, 1, 12, oWFLRouteDtlBean.getTxtLevel()));
oParameters.add(new DBObject(7, 1, 12, oWFLRouteDtlBean.getTxtEmpId()));
oParameters.add(new DBObject(8, 1, 12, oWFLRouteDtlBean.getTxtGrpId()));
oParameters.add(new DBObject(9, 1, 12, oWFLRouteDtlBean.getTxtClassId()));
oParameters.add(new DBObject(10, 1, 12, oWFLRouteDtlBean.getTxtHlevel()));
oParameters.add(new DBObject(11, 1, 12, oWFLRouteDtlBean.getTxtDeptId()));
oParameters.add(new DBObject(12, 1, 12, oWFLRouteDtlBean.getTxtFlag()));
oParameters.add(new DBObject(13, 1, 12, oWFLRouteDtlBean.getTxtNotifFlag()));
oParameters.add(new DBObject(14, 1, 12, oWFLRouteDtlBean.getTxtReptHead()));
oParameters.add(new DBObject(15, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(16, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(17, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWFLRouteDtlBean.getStatus().equals("U")) {
if (!bUpsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflRouteInfo.proc_UpsertWflRouteDtl(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
bUpsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWFLRouteDtlBean.getDetailId()));
oParameters.add(new DBObject(3, 1, 12, oWFLRouteHdrBean.getActivityId()));
oParameters.add(new DBObject(4, 1, 12, oWFLRouteHdrBean.getDtlDocId()));
oParameters.add(new DBObject(5, 1, 12, oWFLRouteDtlBean.getTxtLane()));
oParameters.add(new DBObject(6, 1, 12, oWFLRouteDtlBean.getTxtLevel()));
oParameters.add(new DBObject(7, 1, 12, oWFLRouteDtlBean.getTxtEmpId()));
oParameters.add(new DBObject(8, 1, 12, oWFLRouteDtlBean.getTxtGrpId()));
oParameters.add(new DBObject(9, 1, 12, oWFLRouteDtlBean.getTxtClassId()));
oParameters.add(new DBObject(10, 1, 12, oWFLRouteDtlBean.getTxtHlevel()));
oParameters.add(new DBObject(11, 1, 12, oWFLRouteDtlBean.getTxtDeptId()));
oParameters.add(new DBObject(12, 1, 12, oWFLRouteDtlBean.getTxtFlag()));
oParameters.add(new DBObject(13, 1, 12, oWFLRouteDtlBean.getTxtNotifFlag()));
oParameters.add(new DBObject(14, 1, 12, oWFLRouteDtlBean.getTxtReptHead()));
oParameters.add(new DBObject(15, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(16, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(17, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWFLRouteDtlBean.getStatus().equals("D")) {
if (!bDelete) {
oBean1 = new DBUtilitiesBean();
oBean1.createBatch("WflRouteInfo.proc_DeleteWflRouteDtl(?)");
bDelete = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWFLRouteDtlBean.getDetailId()));
oBean1.addToBatch(oParameters);
}
}
if (bUpsert)
oBean.executeBatch();
if (bDelete)
oBean1.executeBatch();
}
public void saveRouteTransDtls(BaseHeaderBean oBaseHeaderBean, ArrayList oDetailBeanArray) throws EnrgiseApplicationException, EnrgiseSystemException {
WFLRouteHdrBean oWFLRouteHdrBean = (WFLRouteHdrBean)oBaseHeaderBean;
boolean bUpsert = false;
boolean bDelete = false;
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = null;
DBUtilitiesBean oBean1 = null;
Iterator oIt = oDetailBeanArray.iterator();
while (oIt.hasNext()) {
WFLTransDtlBean oWFLTransDtlBean = oIt.next();
if (oWFLTransDtlBean.getStatus().equals("N")) {
if (!bUpsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflRouteInfo.proc_UpsertWflTransDtl(?,?,?,?,?,?,?,?,?,?)");
bUpsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "N"));
oParameters.add(new DBObject(2, 1, 12, null));
oParameters.add(new DBObject(3, 1, 12, oWFLRouteHdrBean.getActivityId()));
oParameters.add(new DBObject(4, 1, 12, oWFLTransDtlBean.getTxtFromRootDtlId()));
oParameters.add(new DBObject(5, 1, 12, oWFLTransDtlBean.getTxtToRootDtlId()));
oParameters.add(new DBObject(6, 1, 12, oWFLTransDtlBean.getTxtConditionId()));
oParameters.add(new DBObject(7, 1, 12, oWFLTransDtlBean.getTxtCValue()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(10, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWFLTransDtlBean.getStatus().equals("U")) {
if (!bUpsert) {
oBean = new DBUtilitiesBean();
oBean.createBatch("WflRouteInfo.proc_UpsertWflTransDtl(?,?,?,?,?,?,?,?,?,?)");
bUpsert = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWFLTransDtlBean.getDetailId()));
oParameters.add(new DBObject(3, 1, 12, oWFLRouteHdrBean.getActivityId()));
oParameters.add(new DBObject(4, 1, 12, oWFLTransDtlBean.getTxtFromRootDtlId()));
oParameters.add(new DBObject(5, 1, 12, oWFLTransDtlBean.getTxtToRootDtlId()));
oParameters.add(new DBObject(6, 1, 12, oWFLTransDtlBean.getTxtConditionId()));
oParameters.add(new DBObject(7, 1, 12, oWFLTransDtlBean.getTxtCValue()));
oParameters.add(new DBObject(8, 1, 12, this.oUserInfo.getSiteId()));
oParameters.add(new DBObject(9, 1, 12, this.oUserInfo.getUserId()));
oParameters.add(new DBObject(10, 1, 12, this.oUserInfo.getSiteId()));
oBean.addToBatch(oParameters);
continue;
}
if (oWFLTransDtlBean.getStatus().equals("D")) {
if (!bDelete) {
oBean1 = new DBUtilitiesBean();
oBean1.createBatch("WflRouteInfo.proc_DeleteWflTransDtl(?)");
bDelete = true;
}
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, oWFLTransDtlBean.getDetailId()));
oBean1.addToBatch(oParameters);
}
}
if (bUpsert)
oBean.executeBatch();
if (bDelete)
oBean1.executeBatch();
}
public void additionalTimestampValidationImpl(BaseHeaderBean param1, Timestamp param2, String param3, String param4, boolean param5, ArrayList param6, boolean param7, Timestamp param8) {}
public void additionalBusinessValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oErrorList = new ArrayList();
WFLRouteHdrBean oWFLRouteHdrBean = (WFLRouteHdrBean)oBaseHeaderBean;
if (bDetailDataChanged) {
if (sScreenName.equalsIgnoreCase("WFLRouteCodeDtl")) {
String sCompositeKey = "txtLane".concat(",").concat("txtLevel");
String[] sFieldName = sCompositeKey.split(",");
Iterator oIt1 = oDetailBeanArray.iterator();
while (oIt1.hasNext()) {
WFLRouteDtlBean oWFLRouteDtlBean = oIt1.next();
if (!oWFLRouteDtlBean.getStatus().equalsIgnoreCase("D"));
reportError(oErrorList);
}
}
if (sScreenName.equalsIgnoreCase("WFLRouteTransDtl")) {
String sCompositeKey = "txtFlane".concat(",").concat("txtTLane");
String[] sFieldName = sCompositeKey.split(",");
Iterator oIt1 = oDetailBeanArray.iterator();
while (oIt1.hasNext()) {
WFLTransDtlBean oWFLTransDtlBean = oIt1.next();
if (!oWFLTransDtlBean.getStatus().equalsIgnoreCase("D"));
reportError(oErrorList);
}
}
}
}
private void checkUniqueTransDtl(WFLRouteHdrBean oWFLRouteHdrBean, ArrayList oDetailBeanArray) throws EnrgiseApplicationException, EnrgiseSystemException {
int count = 0;
Iterator oIt1 = oDetailBeanArray.iterator();
while (oIt1.hasNext()) {
WFLTransDtlBean oWFLTransDtlBean = oIt1.next();
String sQuery = String.valueOf(String.valueOf(String.valueOf(String.valueOf(" Select wt.id from wfl_transitions wt where wt.route_from_id='").concat(String.valueOf(oWFLTransDtlBean.getTxtFromRootDtlId()))).concat(String.valueOf("' and wt.route_to_id ='"))).concat(String.valueOf(oWFLTransDtlBean.getTxtToRootDtlId()))).concat(String.valueOf("' "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
QueryRow oRow = oIt.next();
if (!oRow.get("ID").getString().equalsIgnoreCase(oWFLTransDtlBean.getDetailId()))
throw new EnrgiseApplicationException("wenrgise.common.detail.uniqueConstraintViolated");
}
}
}
private void checkUniqueRouteDtl(WFLRouteHdrBean oWFLRouteHdrBean, ArrayList oDetailBeanArray) throws EnrgiseApplicationException, EnrgiseSystemException {
int count = 0;
Iterator oIt1 = oDetailBeanArray.iterator();
while (oIt1.hasNext()) {
WFLRouteDtlBean oWFLRouteDtlBean = oIt1.next();
String sQuery = String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(" Select wrd.id from wfl_route_dtl wrd where wrd.lane='").concat(String.valueOf(oWFLRouteDtlBean.getTxtLane()))).concat(String.valueOf("' and wrd.level_number='"))).concat(String.valueOf(oWFLRouteDtlBean.getTxtLevel()))).concat(String.valueOf("' and wrd.dtl_doc_id='"))).concat(String.valueOf(oWFLRouteHdrBean.getDtlDocId()))).concat(String.valueOf("' and wrd.activity_id='"))).concat(String.valueOf(oWFLRouteHdrBean.getActivityId()))).concat(String.valueOf("' "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
QueryRow oRow = oIt.next();
if (!oRow.get("ID").getString().equalsIgnoreCase(oWFLRouteDtlBean.getDetailId()))
throw new EnrgiseApplicationException("wenrgise.common.detail.uniqueConstraintViolated");
}
}
}
public void additionalFieldValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
WFLRouteHdrBean oWFLRouteHdrBean = (WFLRouteHdrBean)oBaseHeaderBean;
ArrayList oErrorList = new ArrayList();
if (bHeaderDataChanged)
if (!sScreenMode.equalsIgnoreCase("D"))
checkMandatoryHeader(oWFLRouteHdrBean);
if (bDetailDataChanged) {
if (sScreenName.equalsIgnoreCase("WFLRouteTransDtl")) {
Iterator oIt1 = oDetailBeanArray.iterator();
int rowCount = 1;
while (oIt1.hasNext()) {
WFLTransDtlBean oWFLTransDtlBean = oIt1.next();
if (!oWFLTransDtlBean.getStatus().equalsIgnoreCase("D")) {
checkMandatoryTransDtls(oWFLTransDtlBean, rowCount);
checkforNumericfields(oWFLTransDtlBean, rowCount);
rowCount++;
}
}
}
if (sScreenName.equalsIgnoreCase("WFLRouteCodeDtl")) {
Iterator oIt1 = oDetailBeanArray.iterator();
int rowCount = 1;
while (oIt1.hasNext()) {
WFLRouteDtlBean oWFLRouteDtlBean = oIt1.next();
if (!oWFLRouteDtlBean.getStatus().equalsIgnoreCase("D")) {
checkMandatoryRouteDtls(oWFLRouteDtlBean, rowCount);
checkforNumericfields(oWFLRouteDtlBean, rowCount);
rowCount++;
}
}
}
}
}
private void checkMandatoryHeader(WFLRouteHdrBean oWFLRouteHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oList = new ArrayList();
if (!EnrgiseUtil.checkString(oWFLRouteHdrBean.getDtlDocId())) {
MessageKey oMessageKey = new MessageKey("WFL.TransDtl.dtlDocCode");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWFLRouteHdrBean.getActivityId())) {
MessageKey oMessageKey = new MessageKey("WFL.TransDtl.actCode");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oList.add(new EnrgiseMessageKeyException("wenrgise.common.header.mandatoryFieldMissing", oParam, "E"));
}
reportError(oList);
}
private void checkMandatoryTransDtls(WFLTransDtlBean oWFLTransDtlBean, int rowCount) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oErrorList = new ArrayList();
if (!EnrgiseUtil.checkString(oWFLTransDtlBean.getTxtFromRootDtlId())) {
MessageKey oMessageKey = new MessageKey("WFL.TransDtl.fLane");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oParam.add(new Integer(rowCount));
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWFLTransDtlBean.getTxtToRootDtlId())) {
ArrayList oParams = new ArrayList();
oParams.add("WFL.TransDtl.tLane");
MessageKey oMessageKey = new MessageKey("ivm.IVMMaterialReturnNote.materialCode");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oParam.add(new Integer(rowCount));
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParam, "E"));
}
reportError(oErrorList);
}
private void checkMandatoryRouteDtls(WFLRouteDtlBean oWFLRouteDtlBean, int rowCount) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oErrorList = new ArrayList();
if (!EnrgiseUtil.checkString(oWFLRouteDtlBean.getTxtLane())) {
MessageKey oMessageKey = new MessageKey("WFL.RouteDtl.lane");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oParam.add(new Integer(rowCount));
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParam, "E"));
}
if (!EnrgiseUtil.checkString(oWFLRouteDtlBean.getTxtLevel())) {
MessageKey oMessageKey = new MessageKey("WFL.RouteDtl.level");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oParam.add(new Integer(rowCount));
oErrorList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.mandatoryFieldMissing", oParam, "E"));
}
reportError(oErrorList);
}
private void checkforNumericfields(WFLRouteDtlBean oWFLRouteDtlBean, int rowCount) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oErrList = new ArrayList();
if (!EnrgiseUtil.checkNumber(oWFLRouteDtlBean.getTxtLane(), 3, 0, "NN")) {
MessageKey oMessageKey = new MessageKey("WFL.RouteDtl.lane");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oParam.add(new Integer(rowCount));
oErrList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.nonnumeric", oParam));
}
if (!EnrgiseUtil.checkNumber(oWFLRouteDtlBean.getTxtLevel(), 3, 0, "NN")) {
MessageKey oMessageKey = new MessageKey("WFL.RouteDtl.level");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oParam.add(new Integer(rowCount));
oErrList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.nonnumeric", oParam));
}
reportError(oErrList);
}
private void checkforNumericfields(WFLTransDtlBean oWFLTransDtlBean, int rowCount) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oErrList = new ArrayList();
if (!EnrgiseUtil.checkNumber(oWFLTransDtlBean.getTxtCValue(), 3, 0, "NN")) {
MessageKey oMessageKey = new MessageKey("WFL.TransDtl.cValue");
ArrayList oParam = new ArrayList();
oParam.add(oMessageKey);
oParam.add(new Integer(rowCount));
oErrList.add(new EnrgiseMessageKeyException("wenrgise.common.detail.nonnumeric", oParam));
}
reportError(oErrList);
}
public LovVO getWflDocDtlQLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
String sQuery = "select distinct wt.activity_id,wdtd.id as dtl_doc_id,wdtd.doc_dtl_code,wdtd.doc_dtl_desc,wam.activity_code,wam.activity_desc from wfl_transitions wt,wfl_activity_mst wam,wfl_route_dtl wrd,wfl_doc_type_dtl wdtd where wam.id = wt.activity_id and wt.route_from_id = wrd.id and wrd.dtl_doc_id=wdtd.id ";
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wam.activity_code) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wdtd.doc_dtl_code) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("WFL.TransDtl.actCode");
oHeaderList.add("WFL.TransDtl.actCodeDesc");
oHeaderList.add("");
oHeaderList.add("WFL.TransDtl.dtlDocCode");
oHeaderList.add("WFL.TransDtl.dtlDocDesc");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("activity_id").getString());
oLOVBean.setDetailField2(oRow.get("activity_code").getString());
oLOVBean.setDetailField3(oRow.get("activity_desc").getString());
oLOVBean.setDetailField4(oRow.get("dtl_doc_id").getString());
oLOVBean.setDetailField5(oRow.get("doc_dtl_code").getString());
oLOVBean.setDetailField6(oRow.get("doc_dtl_desc").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
public LovVO getWflDocDtlIdNLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
String sQuery = "select wdtd.id,wdtd.doc_dtl_code,wdtd.doc_dtl_desc from wfl_doc_type_dtl wdtd ";
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wdtd.doc_dtl_code) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wdtd.doc_dtl_desc) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("WFL.TransDtl.dtlDocCode");
oHeaderList.add("WFL.TransDtl.dtlDocDesc");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("id").getString());
oLOVBean.setDetailField2(oRow.get("doc_dtl_code").getString());
oLOVBean.setDetailField3(oRow.get("doc_dtl_desc").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
public LovVO getWflActIdNLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
String sQuery = "select wam.id,wam.activity_code,wam.activity_desc from Wfl_Activity_Mst wam ";
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wam.activity_code) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField2()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wam.activity_desc) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField2()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("WFL.TransDtl.actCode");
oHeaderList.add("WFL.TransDtl.actCodeDesc");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("H");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("id").getString());
oLOVBean.setDetailField2(oRow.get("activity_code").getString());
oLOVBean.setDetailField3(oRow.get("activity_desc").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
public LovVO getWflRouteDtlLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
String sQuery = String.valueOf(String.valueOf("select wrd.id,wrd.lane,wrd.level_number,wam.activity_code from wfl_route_dtl wrd,wfl_activity_mst wam where wrd.dtl_doc_id='").concat(String.valueOf(oLovQueryVO.getProperty("dtlDocId")))).concat(String.valueOf("' and wrd.activity_id=wam.id "));
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wrd.lane) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField2()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wrd.level_number) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField2()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("WFL.TransDtl.fLane");
oHeaderList.add("WFL.TransDtl.fLevel");
oHeaderList.add("WFL.TransDtl.actCode");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("id").getString());
oLOVBean.setDetailField2(oRow.get("lane").getString());
oLOVBean.setDetailField3(oRow.get("level_number").getString());
oLOVBean.setDetailField4(oRow.get("activity_code").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
public LovVO getWflConditionLOVData(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
String sQuery = "select distinct wc.id, wc.condition_expression,wc.condition_desc from wfl_condition wc, wfl_doc_type_dtl wdtd, wfl_condition wc2 ";
sQuery = String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" where wc.doc_type_hdr_id = wc2.doc_type_hdr_id and wdtd.condition_id = wc2.id and wdtd.id ="))).concat(String.valueOf(oLovQueryVO.getProperty("dtlDocId")));
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(wc.condition_expression) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("WFL.TransDtl.cDesc");
oHeaderList.add("WFL.TransDtl.cValue");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("id").getString());
oLOVBean.setDetailField2(oRow.get("condition_desc").getString());
oLOVBean.setDetailField3(oRow.get("condition_expression").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
}

View File

@@ -0,0 +1,3 @@
package wenrgise.workflow.ejb.business;
public class WorkFlowBaseBO {}

View File

@@ -0,0 +1,285 @@
package wenrgise.workflow.ejb.business;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.logging.Logger;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.UserInfo;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.helper.QueryValue;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.workflow.bean.WflDtlsHdrBean;
import wenrgise.workflow.bean.WflWorkListBean;
import wenrgise.workflow.core.WflDocumentInfo;
import wenrgise.workflow.core.WflResource;
public class WorkFlowCommonBO extends WorkFlowBaseBO {
public static final Logger log = Logger.getLogger("wenrgise.workflow.ejb.business.WorkFlowCommonBO");
public String getMailAddress(String sEmpId) {
String sMail = "kolkata.confroom@tcs.com";
DBUtilitiesBean oBean = new DBUtilitiesBean();
try {
if (EnrgiseUtil.checkString(sEmpId) == false) {
log.severe("Employee Id is null");
return sMail;
}
ArrayList oList = oBean.executeQuery(String.valueOf("SELECT email FROM HRM_EMP_PERS WHERE id = ").concat(String.valueOf(sEmpId)));
if (null != oList && oList.size() > 0) {
QueryRow oRow = oList.get(0);
sMail = oRow.get("EMAIL").getString();
log.severe(String.valueOf("E mail id is ").concat(String.valueOf(sMail)));
}
return sMail;
} catch (EnrgiseSystemException oSx) {
log.severe(String.valueOf(String.valueOf(oSx.getClass().getName()).concat(String.valueOf(" "))).concat(String.valueOf(oSx.getMessage())));
return sMail;
}
}
public UserInfo getLoginUserInfo(String sEmpNo, String sSiteId) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList arylstParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
int count = 0;
ArrayList arylstOutArray = new ArrayList();
UserInfo oUserInfo = null;
QueryRow oRow = null;
QueryValue oValue = null;
ArrayList oList = null;
oBean = new DBUtilitiesBean();
arylstParameters = new ArrayList();
arylstParameters = new ArrayList();
arylstParameters.add(new DBObject(1, 1, 12, sEmpNo));
arylstParameters.add(new DBObject(2, 1, 12, sSiteId));
arylstParameters.add(new DBObject(3, 2, -10));
arylstParameters.add(new DBObject(4, 2, 12));
arylstParameters.add(new DBObject(5, 2, 12));
arylstParameters.add(new DBObject(6, 2, 4));
arylstOutArray = oBean.callProc(arylstParameters, "HRMUSERINFO.procGetUserInfo(?,?,?,?,?,?)");
oList = (ArrayList)((DBObject)arylstOutArray.get(0)).getObject();
if (oList.size() == 0)
throw new EnrgiseApplicationException("wenrgise.hrms.norecordfound", "M");
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
oUserInfo = new UserInfo();
System.out.println(oRow.get("CURRENT_YEAR").getString());
oUserInfo.setCurrentYear(oRow.get("CURRENT_YEAR").getString());
System.out.println(oRow.get("SITE_ID").getString());
oUserInfo.setSiteId(oRow.get("SITE_ID").getString());
oUserInfo.setSiteName(oRow.get("SITE_NAME").getString());
oUserInfo.setUserActiveFlag(oRow.get("USER_ACTIVE_FLAG").getString());
oUserInfo.setUserId(oRow.get("USER_ID").getString());
oUserInfo.setUserLocked(oRow.get("USER_LOCKED").getString());
oUserInfo.setUserName(oRow.get("USER_NAME").getString());
oUserInfo.setUserSystemId(oRow.get("USER_SYSTEM_ID").getString());
oUserInfo.setUserType(oRow.get("USER_TYPE").getString());
oUserInfo.setUserTypeId(oRow.get("USER_TYPE_ID").getString());
}
return oUserInfo;
}
public String updateWorkList(String sUpsertFlag, WflResource wflResource, WflDocumentInfo docInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oParameters = null;
ArrayList oOutArray = null;
String returnString = null;
if (wflResource.getEmployeeId() == wflResource.getDelegatedBy())
wflResource.setDelegatedBy("");
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, sUpsertFlag));
oParameters.add(new DBObject(2, 1, 12, docInfo.getWorkListId()));
oParameters.add(new DBObject(3, 1, 12, wflResource.getRouteDtlId()));
oParameters.add(new DBObject(4, 1, 12, docInfo.getDocumentId()));
oParameters.add(new DBObject(5, 1, 12, docInfo.getDocumentTypeId()));
oParameters.add(new DBObject(6, 1, 12, docInfo.getDocumentNumber()));
oParameters.add(new DBObject(7, 1, 12, docInfo.getDocDesc()));
oParameters.add(new DBObject(8, 1, 12, wflResource.getEmployeeId()));
oParameters.add(new DBObject(9, 1, 12, docInfo.getRequester().getEmployeeId()));
oParameters.add(new DBObject(10, 1, 12, wflResource.getDelegatedBy()));
oParameters.add(new DBObject(11, 1, 12, null));
oParameters.add(new DBObject(12, 1, 12, docInfo.getCreator().getEmployeeId()));
oParameters.add(new DBObject(13, 1, 12, docInfo.getModuleId()));
oParameters.add(new DBObject(14, 1, 12, docInfo.getRequesterAction()));
oParameters.add(new DBObject(15, 1, 12, docInfo.getCreator().getEmployeeId()));
oParameters.add(new DBObject(16, 1, 12, docInfo.getCreator().getLoginSite().getSiteId()));
oParameters.add(new DBObject(17, 2, 12));
oParameters.add(new DBObject(18, 2, 12));
oParameters.add(new DBObject(19, 2, 12));
oParameters.add(new DBObject(20, 2, 4));
oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_UpsertWorkItem(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
returnString = (String)oOutObject.getObject();
return returnString;
}
public ArrayList getWorkListInfo(String sEmpId) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
Timestamp oWhenPicked = null;
int count = 0;
ArrayList oHeaderList = new ArrayList();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, sEmpId));
oParameters.add(new DBObject(2, 2, -10));
oParameters.add(new DBObject(3, 2, 12));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_GetWorkFlowList(?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
ArrayList oList = (ArrayList)oOutObject.getObject();
if (oList.size() == 0)
return oHeaderList;
QueryRow oRow = null;
HashMap oColumns = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
count++;
oRow = oIt.next();
WflWorkListBean oWrkFlowCommonBean = new WflWorkListBean();
oWrkFlowCommonBean.setTxtAssignedOn(oRow.get("LAST_ASSIGNED_DATE").getString());
oWrkFlowCommonBean.setRouteDtlId(oRow.get("route_dtl_id").getString());
oWrkFlowCommonBean.setTxtDocNo(oRow.get("doc_number").getString());
oWrkFlowCommonBean.setTxtDocTypeId(oRow.get("doc_type_id").getString());
oWrkFlowCommonBean.setTxtDocId(oRow.get("DOC_ID").getString());
oWrkFlowCommonBean.setTxtHiddenId(oRow.get("ID").getString());
oWrkFlowCommonBean.setTxtEmpNo(oRow.get("pending_for_emp_id").getString());
oWrkFlowCommonBean.setTxtModuleId(oRow.get("MODULE_ID").getString());
oWrkFlowCommonBean.setTxtModuleCode(oRow.get("MODULE_CODE").getString());
oWrkFlowCommonBean.setTxtDocTypeCode(oRow.get("doc_type_code").getString());
oHeaderList.add(oWrkFlowCommonBean);
}
return oHeaderList;
}
public String getDocumentTypeId(String documentType) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, documentType));
oParameters.add(new DBObject(2, 2, 12));
oParameters.add(new DBObject(3, 2, 12));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_GetDocumentTypeId(?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
if (null != oOutObject)
return (String)oOutObject.getObject();
return null;
}
public String getActivityId(String activity) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, activity));
oParameters.add(new DBObject(2, 2, 12));
oParameters.add(new DBObject(3, 2, 12));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_GetActivityId(?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
if (null != oOutObject)
return (String)oOutObject.getObject();
return null;
}
public String getActivityCode(String activityId) throws EnrgiseApplicationException, EnrgiseSystemException {
try {
log.severe(activityId);
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, activityId));
oParameters.add(new DBObject(2, 2, 12));
oParameters.add(new DBObject(3, 2, 12));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_GetActivityCode(?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
if (null != oOutObject)
return (String)oOutObject.getObject();
return null;
} catch (Exception oEx) {
log.severe(String.valueOf(String.valueOf(oEx.getClass().getName()).concat(String.valueOf(" "))).concat(String.valueOf(oEx.getMessage())));
return null;
}
}
public String getRouteDtlId(WflDocumentInfo docInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, docInfo.getWorkListId()));
oParameters.add(new DBObject(2, 2, 12));
oParameters.add(new DBObject(3, 2, 12));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_GetRouteDtl(?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
if (null != oOutObject)
return (String)oOutObject.getObject();
return null;
}
public WflDtlsHdrBean getWorkFlowDtlsInfo(String sWorkListId) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
WflDtlsHdrBean oWflDtlsHdrBean = new WflDtlsHdrBean();
Timestamp oWhenPicked = null;
int count = 0;
ArrayList oHeaderList = new ArrayList();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, sWorkListId));
oParameters.add(new DBObject(2, 2, -10));
oParameters.add(new DBObject(3, 2, 12));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_GetWorkFlowListDesc(?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
ArrayList oList = (ArrayList)oOutObject.getObject();
if (oList.size() == 0)
new EnrgiseApplicationException("wenrgise.common.norecordfound", "M");
QueryRow oRow = null;
HashMap oColumns = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
count++;
oRow = oIt.next();
oWflDtlsHdrBean = new WflDtlsHdrBean();
oWflDtlsHdrBean.setToDtls(oRow.get("EmpName").getString());
oWflDtlsHdrBean.setFromDtls(oRow.get("From_EmpName").getString());
oWflDtlsHdrBean.setSubjectDtls(oRow.get("subject").getString());
oWflDtlsHdrBean.setDescDtls(oRow.get("docDesc").getString());
oWflDtlsHdrBean.setNotifFlag(oRow.get("notificationFlag").getString());
oWflDtlsHdrBean.setModuleId(oRow.get("moduleId").getString());
oWflDtlsHdrBean.setModuleName(oRow.get("ModuleName").getString());
oHeaderList.add(oWflDtlsHdrBean);
}
return oWflDtlsHdrBean;
}
public String closeNotification(WflDtlsHdrBean oWflDtlsHdrBean) throws EnrgiseApplicationException, EnrgiseSystemException {
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oParameters = null;
ArrayList oOutArray = null;
String returnString = null;
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "U"));
oParameters.add(new DBObject(2, 1, 12, oWflDtlsHdrBean.getWorkListId()));
oParameters.add(new DBObject(3, 1, 12, "Close"));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_closeWorkList(?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
returnString = (String)oOutObject.getObject();
return returnString;
}
}

View File

@@ -0,0 +1,51 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.workflow.ejb.business.WflActivityMstBO;
public class WflActivityMstFacadeBean implements SessionBean {
SessionContext ctx;
public void ejbCreate() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
public void setSessionContext(SessionContext ctx) {
this.ctx = ctx;
}
public RecordMetaInfo getWflActivityDtlMetaInfo(UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflActivityMstBO oWflActivityMstBO = new WflActivityMstBO(oUserInfo);
return oWflActivityMstBO.getWflActivityDtlMetaInfo();
}
public ArrayList getWflActivityDtlInfo(long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflActivityMstBO oWflActivityMstBO = new WflActivityMstBO(oUserInfo);
return oWflActivityMstBO.getWflActivityDtlInfo(lStartPosition, lLastPosition);
}
public String saveWflActivityDtls(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
try {
WflActivityMstBO oWflActivityMstBO = new WflActivityMstBO(oUserInfo);
return oWflActivityMstBO.saveData(oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
} catch (EnrgiseSystemException oSysEx) {
this.ctx.setRollbackOnly();
throw oSysEx;
} catch (EnrgiseApplicationException oAppEx) {
this.ctx.setRollbackOnly();
throw oAppEx;
}
}
}

View File

@@ -0,0 +1,18 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.EJBLocalObject;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
public interface WflActivityMstFacadeLocal extends EJBLocalObject {
RecordMetaInfo getWflActivityDtlMetaInfo(UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflActivityDtlInfo(long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
String saveWflActivityDtls(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
}

View File

@@ -0,0 +1,8 @@
package wenrgise.workflow.ejb.facade;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
public interface WflActivityMstFacadeLocalHome extends EJBLocalHome {
WflActivityMstFacadeLocal create() throws CreateException;
}

View File

@@ -0,0 +1,103 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.logging.Logger;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.UserInfo;
import wenrgise.workflow.bean.WflDtlsHdrBean;
import wenrgise.workflow.core.WflDocumentInfo;
import wenrgise.workflow.core.WflService;
import wenrgise.workflow.core.WflStatus;
import wenrgise.workflow.ejb.business.DocHistoryDtlBO;
import wenrgise.workflow.ejb.business.WorkFlowCommonBO;
import wenrgise.workflow.utility.WorkFlowServiceFactory;
public class WflCommFacadeBean implements SessionBean {
public static Logger log = Logger.getLogger("wenrgise.workflow.ejb.facade.WflCommFacadeBean");
public void ejbCreate() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
public void setSessionContext(SessionContext ctx) {}
public UserInfo getLoginUserInfo(String sEmpId, String sSiteId) throws EnrgiseApplicationException, EnrgiseSystemException {
WorkFlowCommonBO oBo = new WorkFlowCommonBO();
return oBo.getLoginUserInfo(sEmpId, sSiteId);
}
public String getDocumentTypeId(String documentType) throws EnrgiseApplicationException, EnrgiseSystemException {
WorkFlowCommonBO oBo = new WorkFlowCommonBO();
return oBo.getDocumentTypeId(documentType);
}
public String getActivityId(String activity) throws EnrgiseApplicationException, EnrgiseSystemException {
WorkFlowCommonBO oBo = new WorkFlowCommonBO();
return oBo.getActivityId(activity);
}
public String getActivityCode(String activityId) throws EnrgiseApplicationException, EnrgiseSystemException {
WorkFlowCommonBO oBo = new WorkFlowCommonBO();
return oBo.getActivityCode(activityId);
}
public String getRouteDtlId(WflDocumentInfo docInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WorkFlowCommonBO oBo = new WorkFlowCommonBO();
return oBo.getRouteDtlId(docInfo);
}
public boolean canDo(WflDocumentInfo docInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
if (docInfo == null)
throw new EnrgiseApplicationException();
if (docInfo.getCreator() == null)
throw new EnrgiseApplicationException();
if (docInfo.getCreator().getLoginSite() == null)
throw new EnrgiseApplicationException();
WflService wflService = WorkFlowServiceFactory.getInstance().getWorkFlowService();
return wflService.canDo(docInfo);
}
public WflStatus process(WflDocumentInfo docInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
log.severe("step1");
if (docInfo == null)
throw new EnrgiseApplicationException();
log.severe("step2");
if (docInfo.getCreator() == null)
throw new EnrgiseApplicationException();
log.severe("step3");
if (docInfo.getCreator().getLoginSite() == null)
throw new EnrgiseApplicationException();
log.severe("step4");
WflService wflService = WorkFlowServiceFactory.getInstance().getWorkFlowService();
log.severe("step5");
return wflService.process(docInfo);
}
public ArrayList getWorkListInfo(String sEmpId) throws EnrgiseApplicationException, EnrgiseSystemException {
WorkFlowCommonBO wflCommBO = new WorkFlowCommonBO();
return wflCommBO.getWorkListInfo(sEmpId);
}
public WflDtlsHdrBean getWorkFlowDtlsInfo(String sWorkListId) throws EnrgiseApplicationException, EnrgiseSystemException {
WorkFlowCommonBO wflCommBO = new WorkFlowCommonBO();
return wflCommBO.getWorkFlowDtlsInfo(sWorkListId);
}
public ArrayList getDocHistDtl(String sDocID, String sDocType, String sModuleID) throws EnrgiseApplicationException, EnrgiseSystemException {
DocHistoryDtlBO oBo = new DocHistoryDtlBO();
return oBo.getDocHistDtl(sDocID, sDocType, sModuleID);
}
public String closeWorkList(WflDtlsHdrBean oWflDtlsHdrBean, Timestamp oWhenPicked, ArrayList oDetailBeanArray, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WorkFlowCommonBO wflCommBO = new WorkFlowCommonBO();
return wflCommBO.closeNotification(oWflDtlsHdrBean);
}
}

View File

@@ -0,0 +1,35 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.EJBLocalObject;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.UserInfo;
import wenrgise.workflow.bean.WflDtlsHdrBean;
import wenrgise.workflow.core.WflDocumentInfo;
import wenrgise.workflow.core.WflStatus;
public interface WflCommFacadeLocal extends EJBLocalObject {
UserInfo getLoginUserInfo(String paramString1, String paramString2) throws EnrgiseApplicationException, EnrgiseSystemException;
WflStatus process(WflDocumentInfo paramWflDocumentInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
boolean canDo(WflDocumentInfo paramWflDocumentInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
String getDocumentTypeId(String paramString) throws EnrgiseApplicationException, EnrgiseSystemException;
String getActivityId(String paramString) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWorkListInfo(String paramString) throws EnrgiseApplicationException, EnrgiseSystemException;
String getActivityCode(String paramString) throws EnrgiseApplicationException, EnrgiseSystemException;
String getRouteDtlId(WflDocumentInfo paramWflDocumentInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
WflDtlsHdrBean getWorkFlowDtlsInfo(String paramString) throws EnrgiseApplicationException, EnrgiseSystemException;
String closeWorkList(WflDtlsHdrBean paramWflDtlsHdrBean, Timestamp paramTimestamp1, ArrayList paramArrayList, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getDocHistDtl(String paramString1, String paramString2, String paramString3) throws EnrgiseApplicationException, EnrgiseSystemException;
}

View File

@@ -0,0 +1,8 @@
package wenrgise.workflow.ejb.facade;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
public interface WflCommFacadeLocalHome extends EJBLocalHome {
WflCommFacadeLocal create() throws CreateException;
}

View File

@@ -0,0 +1,60 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.workflow.ejb.business.WflDOPGrpBO;
import wenrgise.workflow.vo.WflDOPGrpQVO;
public class WflDOPGrpFacadeBean implements SessionBean {
SessionContext ctx;
public void ejbCreate() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
public void setSessionContext(SessionContext ctx) {}
public RecordMetaInfo getWflDOPGrpHdrMetaInfo(WflDOPGrpQVO oWflDOPGrpQVO, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDOPGrpBO oWflDOPGrpBO = new WflDOPGrpBO(oUserInfo);
return oWflDOPGrpBO.getWflDOPGrpHdrMetaInfo(oWflDOPGrpQVO);
}
public ArrayList getWflDOPGrpHdrInfo(WflDOPGrpQVO oWflDOPGrpQVO, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDOPGrpBO oWflDOPGrpBO = new WflDOPGrpBO(oUserInfo);
return oWflDOPGrpBO.getWflDOPGrpHdrInfo(oWflDOPGrpQVO, lStartPosition, lLastPosition);
}
public String saveWflDOPGrp(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDOPGrpBO oWflDOPGrpBO = new WflDOPGrpBO(oUserInfo);
return oWflDOPGrpBO.saveData(oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
}
public LovVO getWflDOPGrpCodeQLOV(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDOPGrpBO oWflDOPGrpBO = new WflDOPGrpBO();
LovVO oLovVO = oWflDOPGrpBO.getWflDOPGrpCodeQLOV(oLovQueryVO);
return oLovVO;
}
public RecordMetaInfo getWflDOPGrpDtlMetaInfo(String lPrimaryKey, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDOPGrpBO oWflDOPGrpBO = new WflDOPGrpBO(oUserInfo);
return oWflDOPGrpBO.getWflDOPGrpDtlMetaInfo(lPrimaryKey);
}
public ArrayList getWflDOPGrpDtlInfo(String lPrimaryKey, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDOPGrpBO oWflDOPGrpBO = new WflDOPGrpBO(oUserInfo);
return oWflDOPGrpBO.getWflDOPGrpDtlInfo(lPrimaryKey, lStartPosition, lLastPosition);
}
}

View File

@@ -0,0 +1,27 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.EJBLocalObject;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.workflow.vo.WflDOPGrpQVO;
public interface WflDOPGrpFacadeLocal extends EJBLocalObject {
RecordMetaInfo getWflDOPGrpHdrMetaInfo(WflDOPGrpQVO paramWflDOPGrpQVO, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDOPGrpHdrInfo(WflDOPGrpQVO paramWflDOPGrpQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
String saveWflDOPGrp(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDOPGrpCodeQLOV(LovQueryVO paramLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDOPGrpDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDOPGrpDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
}

View File

@@ -0,0 +1,8 @@
package wenrgise.workflow.ejb.facade;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
public interface WflDOPGrpFacadeLocalHome extends EJBLocalHome {
WflDOPGrpFacadeLocal create() throws CreateException;
}

View File

@@ -0,0 +1,58 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.workflow.ejb.business.WflDelegationMstBO;
import wenrgise.workflow.vo.WflDelegationQVO;
public class WflDelegateMstFacadeBean implements SessionBean {
public void ejbCreate() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
public void setSessionContext(SessionContext ctx) {}
public RecordMetaInfo getWflDelegationHdrMetaInfo(WflDelegationQVO oWflDelegationQVO, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDelegationMstBO oWflDelegationMstBO = new WflDelegationMstBO(oUserInfo);
return oWflDelegationMstBO.getWflDelegationHdrMetaInfo(oWflDelegationQVO);
}
public ArrayList getWflDelegationHdrInfo(WflDelegationQVO oWflDelegationQVO, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDelegationMstBO oWflDelegationMstBO = new WflDelegationMstBO(oUserInfo);
return oWflDelegationMstBO.getWflDelegationHdrInfo(oWflDelegationQVO, lStartPosition, lLastPosition);
}
public RecordMetaInfo getWflDelegationDtlMetaInfo(String lPrimaryKey, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDelegationMstBO oWflDelegationMstBO = new WflDelegationMstBO(oUserInfo);
return oWflDelegationMstBO.getWflDelegationDtlMetaInfo(lPrimaryKey);
}
public ArrayList getWflDelegationDtlInfo(String lPrimaryKey, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDelegationMstBO oWflDelegationMstBO = new WflDelegationMstBO(oUserInfo);
return oWflDelegationMstBO.getWflDelegationDtlInfo(lPrimaryKey, lStartPosition, lLastPosition);
}
public String saveWflDelegation(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDelegationMstBO oWflDelegationMstBO = new WflDelegationMstBO(oUserInfo);
return oWflDelegationMstBO.saveData(oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
}
public LovVO getWflDtlDocTypeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDelegationMstBO oWflDelegationMstBO = new WflDelegationMstBO();
LovVO oLovVO = oWflDelegationMstBO.getWflDtlDocTypeLOVdata(oLovQueryVO);
return oLovVO;
}
}

View File

@@ -0,0 +1,27 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.EJBLocalObject;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.workflow.vo.WflDelegationQVO;
public interface WflDelegateMstFacadeLocal extends EJBLocalObject {
RecordMetaInfo getWflDelegationHdrMetaInfo(WflDelegationQVO paramWflDelegationQVO, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDelegationHdrInfo(WflDelegationQVO paramWflDelegationQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDelegationDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDelegationDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
String saveWflDelegation(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDtlDocTypeLOVdata(LovQueryVO paramLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException;
}

View File

@@ -0,0 +1,8 @@
package wenrgise.workflow.ejb.facade;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
public interface WflDelegateMstFacadeLocalHome extends EJBLocalHome {
WflDelegateMstFacadeLocal create() throws CreateException;
}

View File

@@ -0,0 +1,86 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.workflow.ejb.business.WflDocMstBO;
import wenrgise.workflow.vo.WflDocMstQVO;
public class WflDocMstFacadeBean implements SessionBean {
SessionContext ctx;
public void ejbCreate() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
public void setSessionContext(SessionContext ctx) {}
public RecordMetaInfo getWflDocTypeHdrMetaInfo(WflDocMstQVO oWflDocMstQVO, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDocMstBO oWflDocMstBO = new WflDocMstBO(oUserInfo);
return oWflDocMstBO.getWflDocTypeHdrMetaInfo(oWflDocMstQVO);
}
public ArrayList getWflDocTypeHdrInfo(WflDocMstQVO oWflDocMstQVO, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDocMstBO oWflDocMstBO = new WflDocMstBO(oUserInfo);
return oWflDocMstBO.getWflDocTypeHdrInfo(oWflDocMstQVO, lStartPosition, lLastPosition);
}
public RecordMetaInfo getWflDocTypeAttrDtlMetaInfo(String lPrimaryKey, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDocMstBO oWflDocMstBO = new WflDocMstBO(oUserInfo);
return oWflDocMstBO.getWflDocTypeAttrDtlMetaInfo(lPrimaryKey);
}
public ArrayList getWflDocTypeAttrDtlInfo(String lPrimaryKey, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDocMstBO oWflDocMstBO = new WflDocMstBO(oUserInfo);
return oWflDocMstBO.getWflDocTypeAttrDtlInfo(lPrimaryKey, lStartPosition, lLastPosition);
}
public RecordMetaInfo getWflDocTypeConditionsDtlMetaInfo(String lPrimaryKey, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDocMstBO oWflDocMstBO = new WflDocMstBO(oUserInfo);
return oWflDocMstBO.getWflDocTypeConditionsDtlMetaInfo(lPrimaryKey);
}
public ArrayList getWflDocTypeConditionsDtlInfo(String lPrimaryKey, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDocMstBO oWflDocMstBO = new WflDocMstBO(oUserInfo);
return oWflDocMstBO.getWflDocTypeConditionsDtlInfo(lPrimaryKey, lStartPosition, lLastPosition);
}
public String saveWflDocTypeMst(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDocMstBO oWflDocMstBO = new WflDocMstBO(oUserInfo);
return oWflDocMstBO.saveData(oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
}
public LovVO getWflDocCodeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDocMstBO oWflDocMstBO = new WflDocMstBO();
LovVO oLovVO = oWflDocMstBO.getWflDocCodeLOVdata(oLovQueryVO);
return oLovVO;
}
public RecordMetaInfo getDtlDocTypeMetaInfo(String lPrimaryKey, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDocMstBO oWflDocMstBO = new WflDocMstBO(oUserInfo);
return oWflDocMstBO.getDtlDocTypeMetaInfo(lPrimaryKey);
}
public ArrayList getDtlDocTypeInfo(String lPrimaryKey, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDocMstBO oWflDocMstBO = new WflDocMstBO(oUserInfo);
return oWflDocMstBO.getDtlDocTypeInfo(lPrimaryKey, lStartPosition, lLastPosition);
}
public LovVO getWflDtlDocCodeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
WflDocMstBO oWflDocMstBO = new WflDocMstBO();
LovVO oLovVO = oWflDocMstBO.getWflDtlDocCodeLOVdata(oLovQueryVO);
return oLovVO;
}
}

View File

@@ -0,0 +1,37 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.EJBLocalObject;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.workflow.vo.WflDocMstQVO;
public interface WflDocMstFacadeLocal extends EJBLocalObject {
RecordMetaInfo getWflDocTypeHdrMetaInfo(WflDocMstQVO paramWflDocMstQVO, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDocTypeHdrInfo(WflDocMstQVO paramWflDocMstQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDocTypeAttrDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDocTypeAttrDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDocTypeConditionsDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDocTypeConditionsDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
String saveWflDocTypeMst(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDocCodeLOVdata(LovQueryVO paramLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getDtlDocTypeMetaInfo(String paramString, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getDtlDocTypeInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDtlDocCodeLOVdata(LovQueryVO paramLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException;
}

View File

@@ -0,0 +1,8 @@
package wenrgise.workflow.ejb.facade;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
public interface WflDocMstFacadeLocalHome extends EJBLocalHome {
WflDocMstFacadeLocal create() throws CreateException;
}

View File

@@ -0,0 +1,70 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.workflow.ejb.business.WFLDtlDocActivityMapBO;
import wenrgise.workflow.vo.WflDtlDocActivityMapQVO;
public class WflDtlDocActivityMapFacadeBean implements SessionBean {
public void ejbCreate() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
public void setSessionContext(SessionContext ctx) {}
public RecordMetaInfo getWFLDtlDocActivityHdrMetaInfo(WflDtlDocActivityMapQVO oWflDtlDocActivityMapQVO, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WFLDtlDocActivityMapBO oWFLDtlDocActivityMapBO = new WFLDtlDocActivityMapBO(oUserInfo);
return oWFLDtlDocActivityMapBO.getWFLDtlDocActivityHdrMetaInfo(oWflDtlDocActivityMapQVO);
}
public ArrayList getWFLDtlDocActivityHdrInfo(WflDtlDocActivityMapQVO oWflDtlDocActivityMapQVO, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WFLDtlDocActivityMapBO oWFLDtlDocActivityMapBO = new WFLDtlDocActivityMapBO(oUserInfo);
return oWFLDtlDocActivityMapBO.getWFLDtlDocActivityHdrInfo(oWflDtlDocActivityMapQVO, lStartPosition, lLastPosition);
}
public RecordMetaInfo getWFLDtlDocActivityDtlMetaInfo(String lPrimaryKey, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WFLDtlDocActivityMapBO oWFLDtlDocActivityMapBO = new WFLDtlDocActivityMapBO(oUserInfo);
return oWFLDtlDocActivityMapBO.getWFLDtlDocActivityDtlMetaInfo(lPrimaryKey);
}
public ArrayList getWFLDtlDocActivityDtlInfo(String lPrimaryKey, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WFLDtlDocActivityMapBO oWFLDtlDocActivityMapBO = new WFLDtlDocActivityMapBO(oUserInfo);
return oWFLDtlDocActivityMapBO.getWFLDtlDocActivityDtlInfo(lPrimaryKey, lStartPosition, lLastPosition);
}
public String saveWflDtlDocActivityMst(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WFLDtlDocActivityMapBO oWFLDtlDocActivityMapBO = new WFLDtlDocActivityMapBO();
return oWFLDtlDocActivityMapBO.saveData(oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
}
public LovVO getWflMapCodeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
WFLDtlDocActivityMapBO oWFLDtlDocActivityMapBO = new WFLDtlDocActivityMapBO();
LovVO oLovVO = oWFLDtlDocActivityMapBO.getWflMapCodeLOVdata(oLovQueryVO);
return oLovVO;
}
public LovVO getWflDocCodeDtlLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
WFLDtlDocActivityMapBO oWFLDtlDocActivityMapBO = new WFLDtlDocActivityMapBO();
LovVO oLovVO = oWFLDtlDocActivityMapBO.getWflDocCodeDtlLOVdata(oLovQueryVO);
return oLovVO;
}
public LovVO getWflActCodeLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
WFLDtlDocActivityMapBO oWFLDtlDocActivityMapBO = new WFLDtlDocActivityMapBO();
LovVO oLovVO = oWFLDtlDocActivityMapBO.getWflActCodeLOVdata(oLovQueryVO);
return oLovVO;
}
}

View File

@@ -0,0 +1,31 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.EJBLocalObject;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.workflow.vo.WflDtlDocActivityMapQVO;
public interface WflDtlDocActivityMapFacadeLocal extends EJBLocalObject {
RecordMetaInfo getWFLDtlDocActivityHdrMetaInfo(WflDtlDocActivityMapQVO paramWflDtlDocActivityMapQVO, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWFLDtlDocActivityHdrInfo(WflDtlDocActivityMapQVO paramWflDtlDocActivityMapQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWFLDtlDocActivityDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWFLDtlDocActivityDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
String saveWflDtlDocActivityMst(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflMapCodeLOVdata(LovQueryVO paramLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDocCodeDtlLOVdata(LovQueryVO paramLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflActCodeLOVdata(LovQueryVO paramLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException;
}

View File

@@ -0,0 +1,8 @@
package wenrgise.workflow.ejb.facade;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
public interface WflDtlDocActivityMapFacadeLocalHome extends EJBLocalHome {
WflDtlDocActivityMapFacadeLocal create() throws CreateException;
}

View File

@@ -0,0 +1,82 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.workflow.ejb.business.WflRouteDtlBO;
import wenrgise.workflow.vo.WflRouteDtlQVO;
public class WflRouteDtlFacadeBean implements SessionBean {
public void ejbCreate() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
public void setSessionContext(SessionContext ctx) {}
public RecordMetaInfo getWFLRouteDtlMetaInfo(WflRouteDtlQVO oWflRouteDtlQVO, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflRouteDtlBO oWflRouteDtlBO = new WflRouteDtlBO(oUserInfo);
return oWflRouteDtlBO.getWFLRouteDtlMetaInfo(oWflRouteDtlQVO);
}
public ArrayList getWFLRouteDtlInfo(WflRouteDtlQVO oWflRouteDtlQVO, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflRouteDtlBO oWflRouteDtlBO = new WflRouteDtlBO(oUserInfo);
return oWflRouteDtlBO.getWFLRouteDtlInfo(oWflRouteDtlQVO, lStartPosition, lLastPosition);
}
public RecordMetaInfo getWFLTransDtlMetaInfo(WflRouteDtlQVO oWflRouteDtlQVO, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflRouteDtlBO oWflRouteDtlBO = new WflRouteDtlBO(oUserInfo);
return oWflRouteDtlBO.getWFLTransDtlMetaInfo(oWflRouteDtlQVO);
}
public ArrayList getWFLTransDtlInfo(WflRouteDtlQVO oWflRouteDtlQVO, long lStartPosition, long lLastPosition, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflRouteDtlBO oWflRouteDtlBO = new WflRouteDtlBO(oUserInfo);
return oWflRouteDtlBO.getWFLTransDtlInfo(oWflRouteDtlQVO, lStartPosition, lLastPosition);
}
public String saveWFLRouteDtl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
WflRouteDtlBO oWflRouteDtlBO = new WflRouteDtlBO(oUserInfo);
return oWflRouteDtlBO.saveData(oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
}
public LovVO getWflDocDtlQLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
WflRouteDtlBO oWflRouteDtlBO = new WflRouteDtlBO();
LovVO oLovVO = oWflRouteDtlBO.getWflDocDtlQLOVdata(oLovQueryVO);
return oLovVO;
}
public LovVO getWflDocDtlIdNLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
WflRouteDtlBO oWflRouteDtlBO = new WflRouteDtlBO();
LovVO oLovVO = oWflRouteDtlBO.getWflDocDtlIdNLOVdata(oLovQueryVO);
return oLovVO;
}
public LovVO getWflActIdNLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
WflRouteDtlBO oWflRouteDtlBO = new WflRouteDtlBO();
LovVO oLovVO = oWflRouteDtlBO.getWflActIdNLOVdata(oLovQueryVO);
return oLovVO;
}
public LovVO getWflRouteDtlLOVdata(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
WflRouteDtlBO oWflRouteDtlBO = new WflRouteDtlBO();
LovVO oLovVO = oWflRouteDtlBO.getWflRouteDtlLOVdata(oLovQueryVO);
return oLovVO;
}
public LovVO getWflConditionLOVData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
WflRouteDtlBO oWflRouteDtlBO = new WflRouteDtlBO();
LovVO oLovVO = oWflRouteDtlBO.getWflConditionLOVData(oLovQueryVO);
return oLovVO;
}
}

View File

@@ -0,0 +1,35 @@
package wenrgise.workflow.ejb.facade;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.EJBLocalObject;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.workflow.vo.WflRouteDtlQVO;
public interface WflRouteDtlFacadeLocal extends EJBLocalObject {
RecordMetaInfo getWFLRouteDtlMetaInfo(WflRouteDtlQVO paramWflRouteDtlQVO, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWFLRouteDtlInfo(WflRouteDtlQVO paramWflRouteDtlQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWFLTransDtlMetaInfo(WflRouteDtlQVO paramWflRouteDtlQVO, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWFLTransDtlInfo(WflRouteDtlQVO paramWflRouteDtlQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
String saveWFLRouteDtl(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDocDtlQLOVdata(LovQueryVO paramLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDocDtlIdNLOVdata(LovQueryVO paramLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflActIdNLOVdata(LovQueryVO paramLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflRouteDtlLOVdata(LovQueryVO paramLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflConditionLOVData(LovQueryVO paramLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException;
}

View File

@@ -0,0 +1,8 @@
package wenrgise.workflow.ejb.facade;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
public interface WflRouteDtlFacadeLocalHome extends EJBLocalHome {
WflRouteDtlFacadeLocal create() throws CreateException;
}

View File

@@ -0,0 +1,16 @@
package wenrgise.workflow.ejb.facade;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
public class WflWorkFlowConditionsFacadeBean implements SessionBean {
public void ejbCreate() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
public void setSessionContext(SessionContext ctx) {}
}

View File

@@ -0,0 +1,5 @@
package wenrgise.workflow.ejb.facade;
import javax.ejb.EJBLocalObject;
public interface WflWorkFlowConditionsFacadeLocal extends EJBLocalObject {}

View File

@@ -0,0 +1,8 @@
package wenrgise.workflow.ejb.facade;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
public interface WflWorkFlowConditionsFacadeLocalHome extends EJBLocalHome {
WflWorkFlowConditionsFacadeLocal create() throws CreateException;
}

View File

@@ -0,0 +1,141 @@
package wenrgise.workflow.ejb.facade;
import java.rmi.RemoteException;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.CreateException;
import javax.ejb.EJBObject;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.workflow.bean.WflAuthorizationBean;
import wenrgise.workflow.bean.WflDtlsHdrBean;
import wenrgise.workflow.core.WflDocumentInfo;
import wenrgise.workflow.core.WflStatus;
import wenrgise.workflow.vo.WflDOPGrpQVO;
import wenrgise.workflow.vo.WflDelegationQVO;
import wenrgise.workflow.vo.WflDocMstQVO;
import wenrgise.workflow.vo.WflDtlDocActivityMapQVO;
import wenrgise.workflow.vo.WflRouteDtlQVO;
public interface WorkFlowFacade extends EJBObject {
WflStatus process(WflDocumentInfo paramWflDocumentInfo) throws RemoteException;
WflAuthorizationBean canDo(WflDocumentInfo paramWflDocumentInfo) throws RemoteException;
ArrayList getWorkListInfo(String paramString) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
String getDocumentTypeId(String paramString) throws RemoteException;
String getActivityId(String paramString) throws RemoteException;
UserInfo getLoginUserInfo(String paramString1, String paramString2) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDocTypeHdrMetaInfo(WflDocMstQVO paramWflDocMstQVO, UserInfo paramUserInfo) throws RemoteException, CreateException, RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDocTypeHdrInfo(WflDocMstQVO paramWflDocMstQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDocTypeAttrDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDocTypeAttrDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDocTypeConditionsDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDocTypeConditionsDtl(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String saveWflDocTypeMst(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDocCodeLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getDtlDocTypeMetaInfo(String paramString, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getDtlDocTypeInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDtlDocCodeLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWFLDtlDocActivityHdrMetaInfo(WflDtlDocActivityMapQVO paramWflDtlDocActivityMapQVO, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWFLDtlDocActivityHdrInfo(WflDtlDocActivityMapQVO paramWflDtlDocActivityMapQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWFLDtlDocActivityDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWFLDtlDocActivityDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String saveWflDtlDocActivityMst(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflMapCodeLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDocCodeDtlLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflActCodeLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String saveWflActivityDtls(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflActivityDtlMetaInfo(UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflActivityDtlInfo(long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWFLRouteDtlMetaInfo(WflRouteDtlQVO paramWflRouteDtlQVO, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWFLRouteDtlInfo(WflRouteDtlQVO paramWflRouteDtlQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWFLTransDtlMetaInfo(WflRouteDtlQVO paramWflRouteDtlQVO, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWFLTransDtlInfo(WflRouteDtlQVO paramWflRouteDtlQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String saveWFLRouteDtl(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDocDtlQLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDocDtlIdNLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflActIdNLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflRouteDtlLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseSystemException, EnrgiseApplicationException;
LovVO getWflConditionLOVData(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseSystemException, EnrgiseApplicationException;
ArrayList getWflDOPGrpHdrInfo(WflDOPGrpQVO paramWflDOPGrpQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDOPGrpHdrMetaInfo(WflDOPGrpQVO paramWflDOPGrpQVO, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String saveWflDOPGrp(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDOPGrpCodeQLOV(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseSystemException, EnrgiseApplicationException;
RecordMetaInfo getWflDOPGrpDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDOPGrpDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getEmpNameLOVData(LovQueryVO paramLovQueryVO) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException;
LovVO getWrkGroupLOVData(LovQueryVO paramLovQueryVO) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException;
LovVO getClassCodeLOVData(LovQueryVO paramLovQueryVO) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException;
String getRouteDtlId(WflDocumentInfo paramWflDocumentInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String getActivityCode(String paramString) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDelegationHdrMetaInfo(WflDelegationQVO paramWflDelegationQVO, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDelegationHdrInfo(WflDelegationQVO paramWflDelegationQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDelegationDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDelegationDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String saveWflDelegation(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDtlDocTypeLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseSystemException, EnrgiseApplicationException;
WflDtlsHdrBean getWorkFlowDtlsInfo(String paramString) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
String closeWorkList(WflDtlsHdrBean paramWflDtlsHdrBean, Timestamp paramTimestamp1, ArrayList paramArrayList, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getDocHistDtl(String paramString1, String paramString2, String paramString3) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
}

View File

@@ -0,0 +1,141 @@
package wenrgise.workflow.ejb.facade;
import java.rmi.RemoteException;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.ejb.CreateException;
import javax.ejb.EJBObject;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.RecordMetaInfo;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.workflow.bean.WflAuthorizationBean;
import wenrgise.workflow.bean.WflDtlsHdrBean;
import wenrgise.workflow.core.WflDocumentInfo;
import wenrgise.workflow.core.WflStatus;
import wenrgise.workflow.vo.WflDOPGrpQVO;
import wenrgise.workflow.vo.WflDelegationQVO;
import wenrgise.workflow.vo.WflDocMstQVO;
import wenrgise.workflow.vo.WflDtlDocActivityMapQVO;
import wenrgise.workflow.vo.WflRouteDtlQVO;
public interface WorkFlowFacade2 extends EJBObject {
WflStatus process(WflDocumentInfo paramWflDocumentInfo) throws RemoteException;
WflAuthorizationBean canDo(WflDocumentInfo paramWflDocumentInfo) throws RemoteException;
ArrayList getWorkListInfo(String paramString) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
String getDocumentTypeId(String paramString) throws RemoteException;
String getActivityId(String paramString) throws RemoteException;
UserInfo getLoginUserInfo(String paramString1, String paramString2) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDocTypeHdrMetaInfo(WflDocMstQVO paramWflDocMstQVO, UserInfo paramUserInfo) throws RemoteException, CreateException, RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDocTypeHdrInfo(WflDocMstQVO paramWflDocMstQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDocTypeAttrDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDocTypeAttrDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDocTypeConditionsDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDocTypeConditionsDtl(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String saveWflDocTypeMst(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDocCodeLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getDtlDocTypeMetaInfo(String paramString, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getDtlDocTypeInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDtlDocCodeLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWFLDtlDocActivityHdrMetaInfo(WflDtlDocActivityMapQVO paramWflDtlDocActivityMapQVO, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWFLDtlDocActivityHdrInfo(WflDtlDocActivityMapQVO paramWflDtlDocActivityMapQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWFLDtlDocActivityDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWFLDtlDocActivityDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String saveWflDtlDocActivityMst(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflMapCodeLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDocCodeDtlLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflActCodeLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String saveWflActivityDtls(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflActivityDtlMetaInfo(UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflActivityDtlInfo(long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWFLRouteDtlMetaInfo(WflRouteDtlQVO paramWflRouteDtlQVO, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWFLRouteDtlInfo(WflRouteDtlQVO paramWflRouteDtlQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWFLTransDtlMetaInfo(WflRouteDtlQVO paramWflRouteDtlQVO, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWFLTransDtlInfo(WflRouteDtlQVO paramWflRouteDtlQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String saveWFLRouteDtl(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDocDtlQLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDocDtlIdNLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflActIdNLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflRouteDtlLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseSystemException, EnrgiseApplicationException;
LovVO getWflConditionLOVData(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseSystemException, EnrgiseApplicationException;
ArrayList getWflDOPGrpHdrInfo(WflDOPGrpQVO paramWflDOPGrpQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDOPGrpHdrMetaInfo(WflDOPGrpQVO paramWflDOPGrpQVO, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String saveWflDOPGrp(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDOPGrpCodeQLOV(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseSystemException, EnrgiseApplicationException;
RecordMetaInfo getWflDOPGrpDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDOPGrpDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getEmpNameLOVData(LovQueryVO paramLovQueryVO) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException;
LovVO getWrkGroupLOVData(LovQueryVO paramLovQueryVO) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException;
LovVO getClassCodeLOVData(LovQueryVO paramLovQueryVO) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException;
String getRouteDtlId(WflDocumentInfo paramWflDocumentInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String getActivityCode(String paramString) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDelegationHdrMetaInfo(WflDelegationQVO paramWflDelegationQVO, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDelegationHdrInfo(WflDelegationQVO paramWflDelegationQVO, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
RecordMetaInfo getWflDelegationDtlMetaInfo(String paramString, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getWflDelegationDtlInfo(String paramString, long paramLong1, long paramLong2, UserInfo paramUserInfo) throws RemoteException, CreateException, EnrgiseApplicationException, EnrgiseSystemException;
String saveWflDelegation(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
LovVO getWflDtlDocTypeLOVdata(LovQueryVO paramLovQueryVO) throws RemoteException, CreateException, EnrgiseSystemException, EnrgiseApplicationException;
WflDtlsHdrBean getWorkFlowDtlsInfo(String paramString) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
String closeWorkList(WflDtlsHdrBean paramWflDtlsHdrBean, Timestamp paramTimestamp1, ArrayList paramArrayList, Timestamp paramTimestamp2, UserInfo paramUserInfo) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
ArrayList getDocHistDtl(String paramString1, String paramString2, String paramString3) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException;
}

View File

@@ -0,0 +1,9 @@
package wenrgise.workflow.ejb.facade;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
public interface WorkFlowFacade2Home extends EJBHome {
WorkFlowFacade2 create() throws CreateException, RemoteException;
}

View File

@@ -0,0 +1,9 @@
package wenrgise.workflow.ejb.facade;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
public interface WorkFlowFacadeHome extends EJBHome {
WorkFlowFacade create() throws CreateException, RemoteException;
}

View File

@@ -0,0 +1,218 @@
package wenrgise.workflow.ejb.facade;
import java.rmi.RemoteException;
import java.rmi.UnexpectedException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
import javax.ejb.EJBMetaData;
import javax.ejb.Handle;
import javax.ejb.HomeHandle;
import javax.ejb.RemoveException;
import javax.rmi.CORBA.Stub;
import javax.rmi.CORBA.Util;
import org.omg.CORBA.SystemException;
import org.omg.CORBA.portable.ApplicationException;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.RemarshalException;
import org.omg.CORBA.portable.ServantObject;
import org.omg.CORBA_2_3.portable.InputStream;
public class _WorkFlowFacade2Home_Stub extends Stub implements WorkFlowFacade2Home {
private static final String[] _type_ids = new String[] { "RMI:wenrgise.workflow.ejb.facade.WorkFlowFacade2Home:0000000000000000", "RMI:javax.ejb.EJBHome:0000000000000000" };
public String[] _ids() {
return _type_ids;
}
public WorkFlowFacade2 create() throws CreateException, RemoteException {
if (!Util.isLocal(this))
try {
InputStream inputStream = null;
try {
OutputStream outputStream = _request("create", true);
inputStream = (InputStream)_invoke(outputStream);
return (WorkFlowFacade2)inputStream.read_Object(WorkFlowFacade2.class);
} catch (ApplicationException applicationException) {
inputStream = (InputStream)applicationException.getInputStream();
String str = inputStream.read_string();
if (str.equals("IDL:javax/ejb/CreateEx:1.0"))
throw (CreateException)inputStream.read_value(CreateException.class);
throw new UnexpectedException(str);
} catch (RemarshalException remarshalException) {
return create();
} finally {
_releaseReply(inputStream);
}
} catch (SystemException systemException) {
throw Util.mapSystemException(systemException);
}
ServantObject servantObject = _servant_preinvoke("create", WorkFlowFacade2Home.class);
if (servantObject == null)
return create();
try {
WorkFlowFacade2 workFlowFacade2 = ((WorkFlowFacade2Home)servantObject.servant).create();
return (WorkFlowFacade2)Util.copyObject(workFlowFacade2, _orb());
} catch (Throwable throwable1) {
Throwable throwable2 = (Throwable)Util.copyObject(throwable1, _orb());
if (throwable2 instanceof CreateException)
throw (CreateException)throwable2;
throw Util.wrapException(throwable2);
} finally {
_servant_postinvoke(servantObject);
}
}
public EJBMetaData getEJBMetaData() throws RemoteException {
if (!Util.isLocal(this))
try {
InputStream inputStream = null;
try {
OutputStream outputStream = _request("_get_EJBMetaData", true);
inputStream = (InputStream)_invoke(outputStream);
return (EJBMetaData)inputStream.read_value(EJBMetaData.class);
} catch (ApplicationException applicationException) {
inputStream = (InputStream)applicationException.getInputStream();
String str = inputStream.read_string();
throw new UnexpectedException(str);
} catch (RemarshalException remarshalException) {
return getEJBMetaData();
} finally {
_releaseReply(inputStream);
}
} catch (SystemException systemException) {
throw Util.mapSystemException(systemException);
}
ServantObject servantObject = _servant_preinvoke("_get_EJBMetaData", EJBHome.class);
if (servantObject == null)
return getEJBMetaData();
try {
EJBMetaData eJBMetaData = ((EJBHome)servantObject.servant).getEJBMetaData();
return (EJBMetaData)Util.copyObject(eJBMetaData, _orb());
} catch (Throwable throwable1) {
Throwable throwable2 = (Throwable)Util.copyObject(throwable1, _orb());
throw Util.wrapException(throwable2);
} finally {
_servant_postinvoke(servantObject);
}
}
public HomeHandle getHomeHandle() throws RemoteException {
if (!Util.isLocal(this))
try {
InputStream inputStream = null;
try {
OutputStream outputStream = _request("_get_homeHandle", true);
inputStream = (InputStream)_invoke(outputStream);
return (HomeHandle)inputStream.read_abstract_interface(HomeHandle.class);
} catch (ApplicationException applicationException) {
inputStream = (InputStream)applicationException.getInputStream();
String str = inputStream.read_string();
throw new UnexpectedException(str);
} catch (RemarshalException remarshalException) {
return getHomeHandle();
} finally {
_releaseReply(inputStream);
}
} catch (SystemException systemException) {
throw Util.mapSystemException(systemException);
}
ServantObject servantObject = _servant_preinvoke("_get_homeHandle", EJBHome.class);
if (servantObject == null)
return getHomeHandle();
try {
HomeHandle homeHandle = ((EJBHome)servantObject.servant).getHomeHandle();
return (HomeHandle)Util.copyObject(homeHandle, _orb());
} catch (Throwable throwable1) {
Throwable throwable2 = (Throwable)Util.copyObject(throwable1, _orb());
throw Util.wrapException(throwable2);
} finally {
_servant_postinvoke(servantObject);
}
}
public void remove(Object paramObject) throws RemoteException, RemoveException {
if (!Util.isLocal(this))
try {
InputStream inputStream = null;
try {
OutputStream outputStream = _request("remove__java_lang_Object", true);
Util.writeAny(outputStream, paramObject);
_invoke(outputStream);
return;
} catch (ApplicationException applicationException) {
inputStream = (InputStream)applicationException.getInputStream();
String str = inputStream.read_string();
if (str.equals("IDL:javax/ejb/RemoveEx:1.0"))
throw (RemoveException)inputStream.read_value(RemoveException.class);
throw new UnexpectedException(str);
} catch (RemarshalException remarshalException) {
remove(paramObject);
return;
} finally {
_releaseReply(inputStream);
}
} catch (SystemException systemException) {
throw Util.mapSystemException(systemException);
}
ServantObject servantObject = _servant_preinvoke("remove__java_lang_Object", EJBHome.class);
if (servantObject == null) {
remove(paramObject);
return;
}
try {
Object object = Util.copyObject(paramObject, _orb());
((EJBHome)servantObject.servant).remove(object);
return;
} catch (Throwable throwable1) {
Throwable throwable2 = (Throwable)Util.copyObject(throwable1, _orb());
if (throwable2 instanceof RemoveException)
throw (RemoveException)throwable2;
throw Util.wrapException(throwable2);
} finally {
_servant_postinvoke(servantObject);
}
}
public void remove(Handle paramHandle) throws RemoteException, RemoveException {
if (!Util.isLocal(this))
try {
InputStream inputStream = null;
try {
OutputStream outputStream = _request("remove__javax_ejb_Handle", true);
Util.writeAbstractObject(outputStream, paramHandle);
_invoke(outputStream);
return;
} catch (ApplicationException applicationException) {
inputStream = (InputStream)applicationException.getInputStream();
String str = inputStream.read_string();
if (str.equals("IDL:javax/ejb/RemoveEx:1.0"))
throw (RemoveException)inputStream.read_value(RemoveException.class);
throw new UnexpectedException(str);
} catch (RemarshalException remarshalException) {
remove(paramHandle);
return;
} finally {
_releaseReply(inputStream);
}
} catch (SystemException systemException) {
throw Util.mapSystemException(systemException);
}
ServantObject servantObject = _servant_preinvoke("remove__javax_ejb_Handle", EJBHome.class);
if (servantObject == null) {
remove(paramHandle);
return;
}
try {
Handle handle = (Handle)Util.copyObject(paramHandle, _orb());
((EJBHome)servantObject.servant).remove(handle);
return;
} catch (Throwable throwable1) {
Throwable throwable2 = (Throwable)Util.copyObject(throwable1, _orb());
if (throwable2 instanceof RemoveException)
throw (RemoveException)throwable2;
throw Util.wrapException(throwable2);
} finally {
_servant_postinvoke(servantObject);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
package wenrgise.workflow.exception;
import java.io.Serializable;
import wenrgise.common.exception.EnrgiseApplicationException;
public class ApproverNotFoundException extends EnrgiseApplicationException implements Serializable {}

View File

@@ -0,0 +1,6 @@
package wenrgise.workflow.exception;
import java.io.Serializable;
import wenrgise.common.exception.EnrgiseApplicationException;
public class AtributesNotDefinedException extends EnrgiseApplicationException implements Serializable {}

View File

@@ -0,0 +1,6 @@
package wenrgise.workflow.exception;
import java.io.Serializable;
import wenrgise.common.exception.EnrgiseApplicationException;
public class MailNotSentException extends EnrgiseApplicationException implements Serializable {}

View File

@@ -0,0 +1,6 @@
package wenrgise.workflow.exception;
import java.io.Serializable;
import wenrgise.common.exception.EnrgiseApplicationException;
public class WorkFlowServiceNotFoundException extends EnrgiseApplicationException implements Serializable {}

View File

@@ -0,0 +1,290 @@
package wenrgise.workflow.helper;
import java.util.ArrayList;
import java.util.Iterator;
import wenrgise.common.bean.LOVBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.hrms.service.HrmsService;
public class HrmsSimulator implements HrmsService {
public LovVO getEmpNameLOVData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
String sQuery = "Select ID,Emp_No,First_Name || ' ' || Middle_Name || ' ' || Last_Name FULLNAME from hrm_emp_pers";
if (oLovQueryVO.getSearchField1() != null)
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" where Emp_No LIKE '%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%' "));
if (oLovQueryVO.getSearchField2() != null)
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" And upper(First_Name || ' ' || Middle_Name || ' ' || Last_Name) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField2()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("pm.pumMaintainPurCommonLOV.id");
oHeaderList.add("pm.pumMaintainPurCommonLOV.empNo");
oHeaderList.add("pm.pumMaintainPurCommonLOV.nameEmp");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("ID").getString());
oLOVBean.setDetailField2(oRow.get("Emp_No").getString());
oLOVBean.setDetailField3(oRow.get("FULLNAME").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
public LovVO getRepEmpNameLOVData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
String sEmpNo = oLovQueryVO.getProperty("EmpNo");
System.out.println(sEmpNo);
String sQuery = "Select ID,Emp_No,First_Name || ' ' || Middle_Name || ' ' || Last_Name FULLNAME from hrm_emp_pers where Emp_No <> '";
sQuery = String.valueOf(sQuery).concat(String.valueOf(sEmpNo.trim()));
sQuery = String.valueOf(sQuery).concat(String.valueOf("'"));
if (oLovQueryVO.getSearchField1() != null)
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and Emp_No LIKE '%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%' "));
if (oLovQueryVO.getSearchField2() != null)
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" And upper(First_Name || ' ' || Middle_Name || ' ' || Last_Name) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField2()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("pm.pumMaintainPurCommonLOV.id");
oHeaderList.add("pm.pumMaintainPurCommonLOV.nameEmp");
oHeaderList.add("pm.pumMaintainPurCommonLOV.empNo");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("ID").getString());
oLOVBean.setDetailField2(oRow.get("FULLNAME").getString());
oLOVBean.setDetailField3(oRow.get("Emp_No").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
public LovVO getLocLOVData(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "200"));
oParameters.add(new DBObject(2, 1, 12, "pc"));
oParameters.add(new DBObject(3, 2, -10));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "Site_Info.proc_GetChildSiteid(?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
int count = 0;
ArrayList oList = (ArrayList)oOutObject.getObject();
Iterator oIt = oList.iterator();
QueryRow oRow1 = null;
String str = "(";
boolean flag = false;
while (oIt.hasNext()) {
oRow1 = oIt.next();
if (flag == true) {
str = String.valueOf(str).concat(String.valueOf(","));
count++;
}
str = String.valueOf(str).concat(String.valueOf(oRow1.get("ID").getString()));
flag = true;
}
str = String.valueOf(str).concat(String.valueOf(")"));
System.out.println(str);
String sQuery = String.valueOf(String.valueOf("Select distinct gvm.ven_location_code,gcm.city_id from GEN_VENDOR_MST gvm,gen_city_mst gcm where gvm.ven_city_id(+)=gcm.city_id and gvm.site_id in ").concat(String.valueOf(str))).concat(String.valueOf(" "));
if (oLovQueryVO.getSearchField1() != null)
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(gvm.VEN_LOCATION_CODE) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean1 = new DBUtilitiesBean();
ArrayList oList1 = oBean1.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("pm.pumMaintainPurCommonLOV.id");
oHeaderList.add("pm.pumMaintainPurCommonLOV.venLocCode");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
count = 0;
QueryRow oRow = null;
Iterator oIt1 = oList1.iterator();
while (oIt1.hasNext()) {
if (count == 0)
oList1 = new ArrayList();
count++;
oRow = oIt1.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("city_id").getString());
oLOVBean.setDetailField2(oRow.get("VEN_LOCATION_CODE").getString());
oList1.add(oLOVBean);
}
oLovVO.setDetailList(oList1);
return oLovVO;
}
public LovVO getCountryLOVData(LovQueryVO oLovQueryVO) throws EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, "200"));
oParameters.add(new DBObject(2, 1, 12, "pc"));
oParameters.add(new DBObject(3, 2, -10));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "Site_Info.proc_GetChildSiteid(?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
int count = 0;
ArrayList oList = (ArrayList)oOutObject.getObject();
Iterator oIt = oList.iterator();
QueryRow oRow1 = null;
String str = "(";
boolean flag = false;
while (oIt.hasNext()) {
oRow1 = oIt.next();
if (flag == true) {
str = String.valueOf(str).concat(String.valueOf(","));
count++;
}
str = String.valueOf(str).concat(String.valueOf(oRow1.get("ID").getString()));
flag = true;
}
str = String.valueOf(str).concat(String.valueOf(")"));
System.out.println(str);
String sQuery = "Select gcm.country_id, gcm.country_code, gcm.name from GEN_COUNTRY_MST gcm ";
if (oLovQueryVO.getSearchField1() != null)
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" where upper(gcm.name) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
System.out.println(sQuery);
DBUtilitiesBean oBean1 = new DBUtilitiesBean();
ArrayList oList1 = oBean1.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("pm.pumMaintainPurCommonLOV.id");
oHeaderList.add("pm.pumMaintainPurCommonLOV.name");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
count = 0;
QueryRow oRow = null;
Iterator oIt1 = oList1.iterator();
while (oIt1.hasNext()) {
if (count == 0)
oList1 = new ArrayList();
count++;
oRow = oIt1.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("country_id").getString());
oLOVBean.setDetailField2(oRow.get("name").getString());
oList1.add(oLOVBean);
}
oLovVO.setDetailList(oList1);
return oLovVO;
}
public LovVO getWrkGroupLOVData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
String sQuery = " SELECT CODE,NAME,ID FROM GEN_WRKGRP_MST where 1=1";
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField1()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(code) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%') "));
if (EnrgiseUtil.checkString(oLovQueryVO.getSearchField2()))
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and upper(NAME) LIKE upper('%"))).concat(String.valueOf(oLovQueryVO.getSearchField2()))).concat(String.valueOf("%') "));
sQuery = String.valueOf(sQuery).concat(String.valueOf(" ORDER BY name"));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("pm.pumMaintainPurCommonLOV.id");
oHeaderList.add("pm.pumMaintainPurCommonLOV.name");
oHeaderList.add("pm.pumMaintainPurCommonLOV.code");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("Id").getString());
oLOVBean.setDetailField2(oRow.get("name").getString());
oLOVBean.setDetailField3(oRow.get("code").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
public LovVO getClassCodeLOVData(LovQueryVO oLovQueryVO) throws EnrgiseApplicationException, EnrgiseSystemException {
String sQuery = "select hcm.id,hcm.name from hrm_class_mst hcm";
if (oLovQueryVO.getSearchField1() != null)
sQuery = String.valueOf(String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" where name LIKE '%"))).concat(String.valueOf(oLovQueryVO.getSearchField1()))).concat(String.valueOf("%' "));
System.out.println(sQuery);
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
LovVO oLovVO = new LovVO();
ArrayList oHeaderList = new ArrayList();
oHeaderList.add("");
oHeaderList.add("pm.pumMaintainPurCommonLOV.classCode");
oLovVO.setHeaderList(oHeaderList);
ArrayList arylstVisibility = new ArrayList();
arylstVisibility.add("H");
arylstVisibility.add("V");
oLovVO.setVisibilityList(arylstVisibility);
int count = 0;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
if (count == 0)
oList = new ArrayList();
count++;
oRow = oIt.next();
LOVBean oLOVBean = new LOVBean();
oLOVBean.setDetailField1(oRow.get("ID").getString());
oLOVBean.setDetailField2(oRow.get("name").getString());
oList.add(oLOVBean);
}
oLovVO.setDetailList(oList);
return oLovVO;
}
}

View File

@@ -0,0 +1,158 @@
package wenrgise.workflow.impl;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.logging.Logger;
import javax.ejb.CreateException;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.UserInfo;
import wenrgise.workflow.bean.WflDocMstAttrDtlBean;
import wenrgise.workflow.bean.WflDtlDocTypeDtlBean;
import wenrgise.workflow.core.WflDocumentInfo;
import wenrgise.workflow.core.WflResource;
import wenrgise.workflow.core.WflStatus;
import wenrgise.workflow.core.WorkFlow;
import wenrgise.workflow.core.impl.WflStatusImpl;
import wenrgise.workflow.ejb.business.WflDocMstBO;
import wenrgise.workflow.ejb.business.WorkFlowCommonBO;
import wenrgise.workflow.exception.AtributesNotDefinedException;
import wenrgise.workflow.utility.AttributesHandler;
import wenrgise.workflow.utility.ConditionChecker;
import wenrgise.workflow.utility.Node;
import wenrgise.workflow.utility.RouteHandler;
import wenrgise.workflow.utility.WorkFlowUtil;
public class WorkFlowImpl implements WorkFlow {
public static final Logger log = Logger.getLogger("wenrgise.workflow.impl.LeaveWorkFlow");
public boolean canDo(WflDocumentInfo wflDocInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
if (EnrgiseUtil.checkString(wflDocInfo.getInitiatedFlag()))
if (!wflDocInfo.getInitiatedFlag().equalsIgnoreCase("Initiated"))
if (!EnrgiseUtil.checkString(wflDocInfo.getWorkListId()))
return false;
return true;
}
public WflStatus start(WflDocumentInfo wflDocInfo) {
try {
log.severe("Log Started");
log.severe(String.valueOf("Creator ").concat(String.valueOf(wflDocInfo.getCreator().getEmployeeId())));
log.severe(String.valueOf("Document Id ").concat(String.valueOf(wflDocInfo.getDocumentId())));
log.severe(String.valueOf("Document Number ").concat(String.valueOf(wflDocInfo.getDocumentNumber())));
log.severe(String.valueOf("Document Number ").concat(String.valueOf(wflDocInfo.getDocumentNumber())));
log.severe(String.valueOf(" Requester Id ").concat(String.valueOf(wflDocInfo.getRequester().getEmployeeId())));
log.severe("start1");
RouteHandler routeHandl = new RouteHandler();
log.severe("start2");
UserInfo oUserInfo = new UserInfo();
oUserInfo.setUserId(wflDocInfo.getRequester().getUserId());
oUserInfo.setSiteId(wflDocInfo.getRequester().getLoginSite().getSiteId());
oUserInfo.setUserSystemId(wflDocInfo.getRequester().getEmployeeId());
oUserInfo.setSiteName(wflDocInfo.getRequester().getLoginSite().getSiteName());
log.severe("start3");
String activityCode = WorkFlowUtil.getActivityCode(wflDocInfo.getRequesterAction());
log.severe("start4");
log.severe(String.valueOf("The WorkList Id Is:-").concat(String.valueOf(wflDocInfo.getWorkListId())));
log.severe(String.valueOf("The InitiatedFlag Is:-").concat(String.valueOf(wflDocInfo.getInitiatedFlag())));
if (EnrgiseUtil.checkString(wflDocInfo.getInitiatedFlag())) {
if (wflDocInfo.getInitiatedFlag().equalsIgnoreCase("Initiated")) {
log.severe("start5");
AttributesHandler attrChecker = new AttributesHandler();
if (!attrChecker.checkAttributes(wflDocInfo, oUserInfo))
throw new AtributesNotDefinedException();
log.severe("Checking Condition");
ConditionChecker cc = new ConditionChecker();
ArrayList oList = WorkFlowUtil.getDetailDocs(wflDocInfo.getDocumentTypeId(), oUserInfo);
WflDocMstBO oWflDocMstBO = new WflDocMstBO();
oWflDocMstBO.setOUserInfo(oUserInfo);
long oDocAttrCount = oWflDocMstBO.getWflDocTypeAttrDtlMetaInfo(wflDocInfo.getDocumentTypeId()).getRecordCount();
ArrayList arylstDocType = oWflDocMstBO.getWflDocTypeAttrDtlInfo(wflDocInfo.getDocumentTypeId(), 1L, oDocAttrCount);
Iterator oIt1 = arylstDocType.iterator();
HashMap oDocAttrTypeMap = new HashMap();
while (oIt1.hasNext()) {
WflDocMstAttrDtlBean oWflDocMstAttrDtlBean = oIt1.next();
oDocAttrTypeMap.put(oWflDocMstAttrDtlBean.getTxtAttrName(), oWflDocMstAttrDtlBean.getTxtType());
}
String dtlDocId = null;
Iterator iterator = oList.iterator();
while (iterator.hasNext()) {
WflDtlDocTypeDtlBean oWflDtlDocTypeDtlBean = iterator.next();
if (cc.checkCondition(oWflDtlDocTypeDtlBean.getTxtExp(), wflDocInfo.getDocumentAttributes(), oDocAttrTypeMap) > false) {
dtlDocId = oWflDtlDocTypeDtlBean.getDetailId();
break;
}
}
log.severe("Checking Condition Finished");
if (dtlDocId == null)
throw new EnrgiseApplicationException("wenrgise.PumMaintainPI.header.UniqueKeyConstraint", "E");
Node node = new Node(String.valueOf(1), String.valueOf(0));
routeHandl.setNodeInfo(node);
WorkFlowCommonBO oWorkFlowCommonBO = new WorkFlowCommonBO();
routeHandl.setActivityId(wflDocInfo.getRequesterAction());
routeHandl.setDtlDocId(dtlDocId);
routeHandl.populateData();
}
} else {
log.severe("Not Initiated");
routeHandl.setRouteDtlId(WorkFlowUtil.getRouteDtlId(wflDocInfo));
routeHandl.populateData();
}
wflDocInfo.getCreator().setRouteDtlId(routeHandl.getRouteDtlId());
if (!EnrgiseUtil.checkString(wflDocInfo.getInitiatedFlag()))
WorkFlowUtil.updateWorkList("U", wflDocInfo.getRequester(), wflDocInfo);
log.severe("start6");
WflStatusImpl wflStatusImpl = new WflStatusImpl();
ArrayList oNextApprover = routeHandl.findNextApprover(wflDocInfo);
log.severe("start7");
Iterator oIt = oNextApprover.iterator();
boolean notifFlagForFinalAppr = false;
if (oIt.hasNext()) {
while (oIt.hasNext()) {
WflResource wflResource = oIt.next();
log.severe(String.valueOf("Approver ").concat(String.valueOf(wflResource.getEmployeeId())));
if (null != wflResource) {
log.severe("start8");
WorkFlowUtil.updateWorkList("N", wflResource, wflDocInfo);
if (routeHandl.getNotifFlag().equalsIgnoreCase("Y")) {
wflStatusImpl.setStatus("Notification");
continue;
}
wflStatusImpl.assign(wflResource);
wflStatusImpl.setStatus("Pending");
log.severe("start9");
}
}
} else if (activityCode.equalsIgnoreCase("Reject")) {
wflStatusImpl.setStatus("Rejected");
} else {
wflStatusImpl.setStatus("FinallyApproved");
}
if (activityCode.equalsIgnoreCase("Reject"))
wflStatusImpl.setStatus("Rejected");
log.severe("start10");
System.out.println(String.valueOf("The Status is:").concat(String.valueOf(wflStatusImpl.getStatus())));
System.out.println(String.valueOf("The Error Code is:").concat(String.valueOf(wflStatusImpl.getErrCode())));
System.out.println(String.valueOf("The Error Message is:").concat(String.valueOf(wflStatusImpl.getErrMsg())));
return (WflStatus)wflStatusImpl;
} catch (EnrgiseSystemException oSx) {
log.severe(String.valueOf(String.valueOf(oSx.getClass().getName()).concat(String.valueOf(" "))).concat(String.valueOf(oSx.getMessage())));
return null;
} catch (EnrgiseApplicationException oAx) {
log.severe(String.valueOf(String.valueOf(oAx.getClass().getName()).concat(String.valueOf(" "))).concat(String.valueOf(oAx.getMessage())));
return null;
} catch (CreateException oCx) {
log.severe(String.valueOf(String.valueOf(oCx.getClass().getName()).concat(String.valueOf(" "))).concat(String.valueOf(oCx.getMessage())));
return null;
} catch (RemoteException oRx) {
log.severe(String.valueOf(String.valueOf(oRx.getClass().getName()).concat(String.valueOf(" "))).concat(String.valueOf(oRx.getMessage())));
return null;
} catch (Exception oEx) {
log.severe(String.valueOf(String.valueOf(oEx.getClass().getName()).concat(String.valueOf(" "))).concat(String.valueOf(oEx.getMessage())));
return null;
}
}
}

View File

@@ -0,0 +1,9 @@
package wenrgise.workflow.service;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.workflow.bean.WflWorkListInfoBean;
public interface WorkFlowService {
WflWorkListInfoBean getWorkListInfo(String paramString) throws EnrgiseApplicationException, EnrgiseSystemException;
}

View File

@@ -0,0 +1,11 @@
package wenrgise.workflow.service;
import wenrgise.hrms.helper.WorkFlowSimulator;
public class WorkFlowServiceFactory {
private static WorkFlowServiceFactory workFlowServiceFactory = new WorkFlowServiceFactory();
public static WorkFlowService getService() {
return (WorkFlowService)new WorkFlowSimulator();
}
}

View File

@@ -0,0 +1,34 @@
package wenrgise.workflow.utility;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Set;
import javax.ejb.CreateException;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.ServiceLocator;
import wenrgise.common.utility.UserInfo;
import wenrgise.workflow.bean.WflDocMstAttrDtlBean;
import wenrgise.workflow.core.WflDocumentInfo;
import wenrgise.workflow.ejb.facade.WorkFlowFacade;
import wenrgise.workflow.ejb.facade.WorkFlowFacadeHome;
public class AttributesHandler {
public boolean checkAttributes(WflDocumentInfo wflDocInfo, UserInfo oUserInfo) throws RemoteException, CreateException, EnrgiseSystemException, EnrgiseApplicationException {
WorkFlowFacadeHome oHome = (WorkFlowFacadeHome)ServiceLocator.getLocator().getService("WorkFlowFacade");
WorkFlowFacade oWorkFlowFacade = oHome.create();
long attrCount = oWorkFlowFacade.getWflDocTypeAttrDtlMetaInfo(wflDocInfo.getDocumentTypeId(), oUserInfo).getRecordCount();
if (attrCount > 0L) {
Set oSet = wflDocInfo.getDocumentAttributes().keySet();
ArrayList docAttributes = oWorkFlowFacade.getWflDocTypeAttrDtlInfo(wflDocInfo.getDocumentTypeId(), 1L, attrCount, oUserInfo);
Iterator oIt = docAttributes.iterator();
while (oIt.hasNext()) {
WflDocMstAttrDtlBean oWflDocMstAttrDtlBean = oIt.next();
if (!oSet.contains(oWflDocMstAttrDtlBean.getTxtAttrName()))
return false;
}
}
return true;
}
}

View File

@@ -0,0 +1,38 @@
package wenrgise.workflow.utility;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import org.nfunk.jep.JEP;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
public class ConditionChecker {
public double checkCondition(String ruleExpr, HashMap oVarMap, HashMap oVarType) throws EnrgiseSystemException, EnrgiseApplicationException {
JEP myParser = new JEP();
Set oVariableSet = oVarMap.keySet();
Iterator oIt = oVariableSet.iterator();
int count = 0;
Object obj = null;
while (oIt.hasNext()) {
String varName = oIt.next();
if (EnrgiseUtil.checkString((String)oVarType.get(varName))) {
String varType = (String)oVarType.get(varName);
if (varType.equalsIgnoreCase("S")) {
obj = new String((String)oVarMap.get(varName));
} else {
obj = new Double((String)oVarMap.get(varName));
}
System.out.println(varName);
System.out.println(oVarMap.get(varName));
myParser.addVariable(varName, obj);
}
}
myParser.parseExpression(ruleExpr);
System.out.println(String.valueOf("Val=").concat(String.valueOf(ruleExpr)));
double oVal = myParser.getValue();
System.out.println(String.valueOf("Val=").concat(String.valueOf(oVal)));
return oVal;
}
}

View File

@@ -0,0 +1,37 @@
package wenrgise.workflow.utility;
import java.io.Serializable;
public class Node implements Serializable {
private String lane;
private String level;
public Node(String lane, String level) {
this.lane = lane;
this.level = level;
}
public Node(Node oNodeInfo) {
this.lane = oNodeInfo.getLane();
this.level = oNodeInfo.getLevel();
}
public Node() {}
public String getLane() {
return this.lane;
}
public void setLane(String newLane) {
this.lane = newLane;
}
public String getLevel() {
return this.level;
}
public void setLevel(String newLevel) {
this.level = newLevel;
}
}

View File

@@ -0,0 +1,284 @@
package wenrgise.workflow.utility;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.logging.Logger;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.workflow.bean.WflDocMstAttrDtlBean;
import wenrgise.workflow.core.WflDepartment;
import wenrgise.workflow.core.WflDocumentInfo;
import wenrgise.workflow.core.impl.WflDepartmentImpl;
import wenrgise.workflow.core.impl.WflResourceImpl;
import wenrgise.workflow.ejb.business.WflDocMstBO;
public class RouteHandler {
public static final Logger log = Logger.getLogger("wenrgise.workflow.utility.RouteHandler");
private Node nodeInfo;
private String routeDtlId;
private String activityId;
private String dtlDocId;
private String notifFlag;
public Node getNodeInfo() {
return this.nodeInfo;
}
public void setNodeInfo(Node newNodeInfo) {
this.nodeInfo = newNodeInfo;
}
public String getRouteDtlId() {
return this.routeDtlId;
}
public void setRouteDtlId(String newRouteDtlId) {
this.routeDtlId = newRouteDtlId;
}
public String getActivityId() {
return this.activityId;
}
public void setActivityId(String newActivityId) {
this.activityId = newActivityId;
}
public String getDtlDocId() {
return this.dtlDocId;
}
public void setDtlDocId(String newDtlDocId) {
this.dtlDocId = newDtlDocId;
}
public String getNotifFlag() {
return this.notifFlag;
}
public void setNotifFlag(String newNotifFlag) {
this.notifFlag = newNotifFlag;
}
public ArrayList findNextApprover(WflDocumentInfo wflDocInfo) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
Timestamp oWhenPicked = null;
int count = 0;
BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO();
oParameters = new ArrayList();
log.severe(String.valueOf("Route Id ").concat(String.valueOf(getRouteDtlId())));
oParameters.add(new DBObject(1, 1, 12, getRouteDtlId()));
oParameters.add(new DBObject(2, 2, -10));
oParameters.add(new DBObject(3, 2, 12));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_GetNextLevelConditions(?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
ArrayList oList = (ArrayList)oOutObject.getObject();
String condtitionExpr = null;
String conditionValue = null;
String condtitionId = null;
QueryRow oRow = null;
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
WflDocMstBO oWflDocMstBO = new WflDocMstBO();
UserInfo oUserInfo = new UserInfo();
oUserInfo.setUserId(wflDocInfo.getRequester().getUserId());
oUserInfo.setSiteId(wflDocInfo.getRequester().getLoginSite().getSiteId());
oUserInfo.setUserSystemId(wflDocInfo.getRequester().getEmployeeId());
oUserInfo.setSiteName(wflDocInfo.getRequester().getLoginSite().getSiteName());
oWflDocMstBO.setOUserInfo(oUserInfo);
long oDocAttrCount = oWflDocMstBO.getWflDocTypeAttrDtlMetaInfo(wflDocInfo.getDocumentId()).getRecordCount();
ArrayList arylstDocType = oWflDocMstBO.getWflDocTypeAttrDtlInfo(wflDocInfo.getDocumentId(), 1L, oDocAttrCount);
Iterator oIt1 = arylstDocType.iterator();
HashMap oDocAttrTypeMap = new HashMap();
while (oIt1.hasNext()) {
WflDocMstAttrDtlBean oWflDocMstAttrDtlBean = oIt1.next();
oDocAttrTypeMap.put(oWflDocMstAttrDtlBean.getTxtAttrName(), oWflDocMstAttrDtlBean.getTxtType());
}
oRow = oIt.next();
condtitionId = oRow.get("conditionId").getString();
condtitionExpr = oRow.get("conditionExpr").getString();
ConditionChecker cc = new ConditionChecker();
conditionValue = String.valueOf(cc.checkCondition(condtitionExpr, wflDocInfo.getDocumentAttributes(), oDocAttrTypeMap));
}
ArrayList oResourceList = new ArrayList();
String activityCode = WorkFlowUtil.getActivityCode(wflDocInfo.getRequesterAction());
if (!activityCode.equalsIgnoreCase("Reject")) {
log.severe(String.valueOf("Approve ").concat(String.valueOf(getRouteDtlId())));
log.severe(String.valueOf("Approve Cond ").concat(String.valueOf(condtitionId)));
log.severe(String.valueOf("Approve Cond value ").concat(String.valueOf(conditionValue)));
oOutArray = new ArrayList();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, getRouteDtlId()));
oParameters.add(new DBObject(2, 1, 12, condtitionId));
oParameters.add(new DBObject(3, 1, 12, conditionValue));
oParameters.add(new DBObject(4, 2, -10));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_GetNextLevelRouteDtls(?,?,?,?,?,?,?)");
oList = new ArrayList();
oOutObject = new DBObject();
oOutObject = oOutArray.get(0);
oList = (ArrayList)oOutObject.getObject();
oRow = null;
Iterator oIt1 = oList.iterator();
while (oIt1.hasNext()) {
oRow = oIt1.next();
String sToRouteDtlId = oRow.get("routeDtlId").getString();
String splitJoinFlag = oRow.get("splitJoinFlag").getString();
getNextLevelApprovers(wflDocInfo, splitJoinFlag, sToRouteDtlId, oResourceList);
}
} else {
oOutArray = new ArrayList();
oParameters = new ArrayList();
log.severe(String.valueOf("Reject ").concat(String.valueOf(getRouteDtlId())));
log.severe(String.valueOf("Reject Cond ").concat(String.valueOf(condtitionId)));
log.severe(String.valueOf("Reject Cond value ").concat(String.valueOf(conditionValue)));
oParameters.add(new DBObject(1, 1, 12, getRouteDtlId()));
oParameters.add(new DBObject(2, 1, 12, condtitionId));
oParameters.add(new DBObject(3, 1, 12, conditionValue));
oParameters.add(new DBObject(4, 2, -10));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_NextLevelRouteDtlsReject(?,?,?,?,?,?,?)");
oList = new ArrayList();
oOutObject = new DBObject();
oOutObject = oOutArray.get(0);
oList = (ArrayList)oOutObject.getObject();
oRow = null;
Iterator oIt1 = oList.iterator();
while (oIt1.hasNext()) {
oRow = oIt1.next();
String sToRouteDtlId = oRow.get("routeDtlId").getString();
String splitJoinFlag = oRow.get("splitJoinFlag").getString();
getNextLevelApproversForReject(wflDocInfo, splitJoinFlag, sToRouteDtlId, oResourceList);
}
}
return oResourceList;
}
public ArrayList getNextLevelApproversForReject(WflDocumentInfo wflDocInfo, String splitJoinFlag, String sToRouteDtlId, ArrayList oResourceList) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oOutArray = new ArrayList();
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters.add(new DBObject(1, 1, 12, sToRouteDtlId));
oParameters.add(new DBObject(2, 1, 12, splitJoinFlag));
oParameters.add(new DBObject(3, 1, 12, wflDocInfo.getWorkListId()));
oParameters.add(new DBObject(4, 2, -10));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_NextLevelApproversReject(?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
ArrayList oList = (ArrayList)oOutObject.getObject();
if (oList != null) {
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
WflResourceImpl wflResourceImpl = new WflResourceImpl();
WflDepartmentImpl wflDepartmentImpl = new WflDepartmentImpl();
wflDepartmentImpl.setDepartmentId(oRow.get("departmentId").getString());
wflDepartmentImpl.setDepartmentName(oRow.get("departmentName").getString());
wflResourceImpl.setDepartment((WflDepartment)wflDepartmentImpl);
wflResourceImpl.setEmployeeId(oRow.get("empId").getString());
wflResourceImpl.setEmpNo(oRow.get("empNo").getString());
wflResourceImpl.setRouteDtlId(sToRouteDtlId);
oResourceList.add(wflResourceImpl);
}
}
return oResourceList;
}
public ArrayList getNextLevelApprovers(WflDocumentInfo wflDocInfo, String splitJoinFlag, String sToRouteDtlId, ArrayList oResourceList) throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oOutArray = new ArrayList();
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
log.severe(String.valueOf("Route Id ").concat(String.valueOf(sToRouteDtlId)));
log.severe(String.valueOf("Split Join Flag ").concat(String.valueOf(splitJoinFlag)));
log.severe(String.valueOf("Requester Emp Id ").concat(String.valueOf(wflDocInfo.getRequester().getEmployeeId())));
oParameters.add(new DBObject(1, 1, 12, sToRouteDtlId));
oParameters.add(new DBObject(2, 1, 12, splitJoinFlag));
oParameters.add(new DBObject(3, 1, 12, wflDocInfo.getRequester().getEmployeeId()));
oParameters.add(new DBObject(4, 2, -10));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_GetNextLevelApprovers(?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
ArrayList oList = (ArrayList)oOutObject.getObject();
if (oList != null) {
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
WflResourceImpl wflResourceImpl = new WflResourceImpl();
WflDepartmentImpl wflDepartmentImpl = new WflDepartmentImpl();
wflDepartmentImpl.setDepartmentId(oRow.get("departmentId").getString());
wflDepartmentImpl.setDepartmentName(oRow.get("departmentName").getString());
wflResourceImpl.setDepartment((WflDepartment)wflDepartmentImpl);
wflResourceImpl.setEmployeeId(oRow.get("empId").getString());
wflResourceImpl.setEmpNo(oRow.get("empNo").getString());
wflResourceImpl.setDelegatedBy(oRow.get("delegatedBy").getString());
wflResourceImpl.setRouteDtlId(sToRouteDtlId);
oResourceList.add(wflResourceImpl);
}
}
return oResourceList;
}
public void populateData() throws EnrgiseSystemException, EnrgiseApplicationException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
Timestamp oWhenPicked = null;
int count = 0;
BaseHeaderVO oBaseHeaderVO = new BaseHeaderVO();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, getRouteDtlId()));
oParameters.add(new DBObject(2, 1, 12, getDtlDocId()));
oParameters.add(new DBObject(3, 1, 12, getActivityId()));
Node nodeInfo = getNodeInfo();
if (nodeInfo != null) {
oParameters.add(new DBObject(4, 1, 12, nodeInfo.getLane()));
oParameters.add(new DBObject(5, 1, 12, nodeInfo.getLevel()));
} else {
oParameters.add(new DBObject(4, 1, 12, null));
oParameters.add(new DBObject(5, 1, 12, null));
}
oParameters.add(new DBObject(6, 2, -10));
oParameters.add(new DBObject(7, 2, 12));
oParameters.add(new DBObject(8, 2, 12));
oParameters.add(new DBObject(9, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "WFLWORKLIST.proc_GetRouteDtlInfo(?,?,?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
ArrayList oList = (ArrayList)oOutObject.getObject();
if (oList.size() <= 0)
throw new EnrgiseApplicationException("wenrgise.workflow.norecordfound", "M");
QueryRow oRow = null;
Iterator oIt = oList.iterator();
if (oIt.hasNext()) {
oRow = oIt.next();
setRouteDtlId(oRow.get("routeDtlId").getString());
setDtlDocId(oRow.get("dtlDocId").getString());
setActivityId(oRow.get("activityId").getString());
setNodeInfo(new Node(oRow.get("lane").getString(), oRow.get("level_number").getString()));
setNotifFlag(oRow.get("notification_flag").getString());
}
}
}

View File

@@ -0,0 +1,34 @@
package wenrgise.workflow.utility;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import wenrgise.workflow.xml.vo.WflDocParam;
import wenrgise.workflow.xml.vo.WflDocParams;
public class WflDocParamsManager {
private static WflDocParamsManager me = new WflDocParamsManager();
private HashMap oWflDocMap = new HashMap();
public Map getMap() {
return this.oWflDocMap;
}
public static WflDocParamsManager getInstance() {
return me;
}
public void init(WflDocParams wfls) {
ArrayList wflList = wfls.get_WflDocParam();
if (wflList == null)
return;
Iterator oIt = wflList.iterator();
while (oIt.hasNext()) {
WflDocParam wflDocParam = oIt.next();
System.out.println(String.valueOf("Document Type ").concat(String.valueOf(wflDocParam.get_DocType())));
this.oWflDocMap.put(wflDocParam.get_DocType(), wflDocParam);
}
}
}

View File

@@ -0,0 +1,16 @@
package wenrgise.workflow.utility;
import wenrgise.workflow.core.WflService;
import wenrgise.workflow.core.impl.WflServiceImpl;
public class WorkFlowServiceFactory {
private static WorkFlowServiceFactory me = new WorkFlowServiceFactory();
public static WorkFlowServiceFactory getInstance() {
return me;
}
public WflService getWorkFlowService() {
return (WflService)new WflServiceImpl();
}
}

View File

@@ -0,0 +1,142 @@
package wenrgise.workflow.utility;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Properties;
import java.util.logging.Logger;
import javax.ejb.CreateException;
import javax.ejb.RemoveException;
import javax.mail.Address;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.ServiceLocator;
import wenrgise.common.utility.UserInfo;
import wenrgise.workflow.core.WflDocumentInfo;
import wenrgise.workflow.core.WflResource;
import wenrgise.workflow.core.impl.WflResourceImpl;
import wenrgise.workflow.ejb.business.WorkFlowCommonBO;
import wenrgise.workflow.ejb.facade.WorkFlowFacade;
import wenrgise.workflow.ejb.facade.WorkFlowFacadeHome;
import wenrgise.workflow.exception.ApproverNotFoundException;
import wenrgise.workflow.exception.MailNotSentException;
public class WorkFlowUtil {
public static Logger log = Logger.getLogger("wenrgise.workflow.utility.WorkFlowUtil");
public static WflResource findNextApprover(WflDocumentInfo docInfo) throws ApproverNotFoundException {
WflResourceImpl wflResourceImpl = new WflResourceImpl();
if (docInfo.getDocumentType().equals("Leave"))
wflResourceImpl.setEmpNo("90074");
if (docInfo.getDocumentType().equals("Loan"))
wflResourceImpl.setEmpNo("90038");
return (WflResource)wflResourceImpl;
}
public static void sendMail(WflResource wflResource, WflDocumentInfo docInfo, String action) throws MailNotSentException {
try {
if (null != wflResource) {
Session session = getMailSession();
MimeMessage message = new MimeMessage(session);
String content = String.valueOf(String.valueOf(String.valueOf(String.valueOf("The document ").concat(String.valueOf(docInfo.getDocumentNumber()))).concat(String.valueOf(" of type "))).concat(String.valueOf(docInfo.getDocumentType()))).concat(String.valueOf(" is pending for your approval. Thanks."));
message.setText(content);
message.setSubject(String.valueOf(String.valueOf(String.valueOf(String.valueOf("Notification: ").concat(String.valueOf(docInfo.getDocumentType()))).concat(String.valueOf("("))).concat(String.valueOf(docInfo.getDocumentNumber()))).concat(String.valueOf(") pending")));
message.setFrom((Address)new InternetAddress("chayanika.das@tcs.com"));
InternetAddress internetAddress = new InternetAddress(getMailAddress(wflResource));
message.addRecipient(Message.RecipientType.TO, (Address)internetAddress);
message.saveChanges();
Transport.send((Message)message);
}
} catch (MessagingException oMsx) {
log.severe(String.valueOf(String.valueOf(oMsx.getClass().getName()).concat(String.valueOf(" "))).concat(String.valueOf(oMsx.getMessage())));
}
}
public static boolean canApprove(WflDocumentInfo docInfo) {
return true;
}
public static boolean canReject(WflDocumentInfo docInfo) {
return true;
}
public static void updateWorkList(String sUpsertFlag, WflResource wflResource, WflDocumentInfo docInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
log.severe(String.valueOf("Upsert Flag ").concat(String.valueOf(sUpsertFlag)));
log.severe(String.valueOf(" Employee Id ").concat(String.valueOf(wflResource.getEmployeeId())));
log.severe(String.valueOf(" Document Id ").concat(String.valueOf(docInfo.getDocumentId())));
log.severe(String.valueOf(" Document Number ").concat(String.valueOf(docInfo.getDocumentNumber())));
WorkFlowCommonBO oCommonBO = new WorkFlowCommonBO();
oCommonBO.updateWorkList(sUpsertFlag, wflResource, docInfo);
}
private static Session getMailSession() {
Properties props = System.getProperties();
props.put("mail.smtp.host", "172.17.9.119");
return Session.getDefaultInstance(props, null);
}
public static String getMailAddress(WflResource wflResource) {
WorkFlowCommonBO oCommonBO = new WorkFlowCommonBO();
if (null != wflResource) {
log.severe(String.valueOf("Employee Id is ").concat(String.valueOf(wflResource.getEmployeeId())));
return oCommonBO.getMailAddress(wflResource.getEmployeeId());
}
return oCommonBO.getMailAddress(null);
}
public static ArrayList getDetailDocs(String sDocumentId, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
try {
WorkFlowFacadeHome oHome = (WorkFlowFacadeHome)ServiceLocator.getLocator().getService("WorkFlowFacade");
WorkFlowFacade oWorkFlowFacade = oHome.create();
long recCount = oWorkFlowFacade.getDtlDocTypeMetaInfo(sDocumentId, oUserInfo).getRecordCount();
if (recCount > 0L)
return oWorkFlowFacade.getDtlDocTypeInfo(sDocumentId, 1L, recCount, oUserInfo);
return null;
} catch (RemoteException oRe) {
throw new EnrgiseSystemException(oRe);
} catch (CreateException oCrt) {
throw new EnrgiseSystemException(oCrt);
}
}
public static String getRouteDtlId(WflDocumentInfo wflDocInfo) throws EnrgiseApplicationException, EnrgiseSystemException {
try {
WorkFlowFacadeHome oHome = (WorkFlowFacadeHome)ServiceLocator.getLocator().getService("WorkFlowFacade");
WorkFlowFacade oWorkFlowFacade = oHome.create();
String routeDtlId = oWorkFlowFacade.getRouteDtlId(wflDocInfo);
oWorkFlowFacade.remove();
return routeDtlId;
} catch (RemoteException oRe) {
throw new EnrgiseSystemException(oRe);
} catch (RemoveException oRv) {
throw new EnrgiseSystemException(oRv);
} catch (CreateException oCrt) {
throw new EnrgiseSystemException(oCrt);
}
}
public static String getActivityCode(String activityId) throws EnrgiseApplicationException, EnrgiseSystemException {
try {
log.severe("ActivityStarted");
WorkFlowFacadeHome oHome = (WorkFlowFacadeHome)ServiceLocator.getLocator().getService("WorkFlowFacade");
WorkFlowFacade oWorkFlowFacade = oHome.create();
String activityCode = oWorkFlowFacade.getActivityCode(activityId);
oWorkFlowFacade.remove();
return activityCode;
} catch (RemoteException oRe) {
log.severe(String.valueOf(String.valueOf(oRe.getClass().getName()).concat(String.valueOf(" "))).concat(String.valueOf(oRe.getMessage())));
throw new EnrgiseSystemException(oRe);
} catch (RemoveException oRv) {
log.severe(String.valueOf(String.valueOf(oRv.getClass().getName()).concat(String.valueOf(" "))).concat(String.valueOf(oRv.getMessage())));
throw new EnrgiseSystemException(oRv);
} catch (CreateException oCrt) {
log.severe(String.valueOf(String.valueOf(oCrt.getClass().getName()).concat(String.valueOf(" "))).concat(String.valueOf(oCrt.getMessage())));
throw new EnrgiseSystemException(oCrt);
}
}
}

View File

@@ -0,0 +1,26 @@
package wenrgise.workflow.vo;
import java.io.Serializable;
import wenrgise.common.vo.BaseQueryVO;
public class WflDOPGrpQVO extends BaseQueryVO implements Serializable {
String grpCode;
String grpId;
public String getGrpCode() {
return this.grpCode;
}
public void setGrpCode(String newGrpCode) {
this.grpCode = newGrpCode;
}
public String getGrpId() {
return this.grpId;
}
public void setGrpId(String newGrpId) {
this.grpId = newGrpId;
}
}

View File

@@ -0,0 +1,36 @@
package wenrgise.workflow.vo;
import java.io.Serializable;
import wenrgise.common.vo.BaseQueryVO;
public class WflDelegationQVO extends BaseQueryVO implements Serializable {
String fromDate;
String toDate;
String empId;
public String getFromDate() {
return this.fromDate;
}
public void setFromDate(String newFromDate) {
this.fromDate = newFromDate;
}
public String getToDate() {
return this.toDate;
}
public void setToDate(String newToDate) {
this.toDate = newToDate;
}
public String getEmpId() {
return this.empId;
}
public void setEmpId(String newEmpId) {
this.empId = newEmpId;
}
}

View File

@@ -0,0 +1,6 @@
package wenrgise.workflow.vo;
import java.io.Serializable;
import wenrgise.common.vo.BaseQueryVO;
public class WflDocMstQVO extends BaseQueryVO implements Serializable {}

View File

@@ -0,0 +1,15 @@
package wenrgise.workflow.vo;
import wenrgise.common.vo.BaseQueryVO;
public class WflDtlDocActivityMapQVO extends BaseQueryVO {
private String dtlDocId;
public String getDtlDocId() {
return this.dtlDocId;
}
public void setDtlDocId(String newDtlDocId) {
this.dtlDocId = newDtlDocId;
}
}

View File

@@ -0,0 +1,3 @@
package wenrgise.workflow.vo;
public class WflDtlsQVO {}

View File

@@ -0,0 +1,26 @@
package wenrgise.workflow.vo;
import java.io.Serializable;
import wenrgise.common.vo.BaseQueryVO;
public class WflRouteDtlQVO extends BaseQueryVO implements Serializable {
String activityId;
String dtlDocId;
public String getActivityId() {
return this.activityId;
}
public void setActivityId(String newActivityId) {
this.activityId = newActivityId;
}
public String getDtlDocId() {
return this.dtlDocId;
}
public void setDtlDocId(String newDtlDocId) {
this.dtlDocId = newDtlDocId;
}
}

View File

@@ -0,0 +1,65 @@
package wenrgise.workflow.xml.vo;
import java.io.Serializable;
public class WflDocParam implements Serializable {
private String _DocType = null;
private String _FormName = null;
private String _FormBeanName = null;
private String _ForwardName = null;
private String _ScreenName = null;
private String _ParamNames = null;
public String get_DocType() {
return this._DocType;
}
public void set_DocType(String new_DocType) {
this._DocType = new_DocType;
}
public String get_FormName() {
return this._FormName;
}
public void set_FormName(String new_FormName) {
this._FormName = new_FormName;
}
public String get_FormBeanName() {
return this._FormBeanName;
}
public void set_FormBeanName(String new_FormBeanName) {
this._FormBeanName = new_FormBeanName;
}
public String get_ForwardName() {
return this._ForwardName;
}
public void set_ForwardName(String new_ForwardName) {
this._ForwardName = new_ForwardName;
}
public String get_ScreenName() {
return this._ScreenName;
}
public void set_ScreenName(String new_ScreenName) {
this._ScreenName = new_ScreenName;
}
public String get_ParamNames() {
return this._ParamNames;
}
public void set_ParamNames(String new_ParamNames) {
this._ParamNames = new_ParamNames;
}
}

View File

@@ -0,0 +1,16 @@
package wenrgise.workflow.xml.vo;
import java.io.Serializable;
import java.util.ArrayList;
public class WflDocParams implements Serializable {
private ArrayList _WflDocParam;
public ArrayList get_WflDocParam() {
return this._WflDocParam;
}
public void set_WflDocParam(ArrayList new_WflDocParam) {
this._WflDocParam = new_WflDocParam;
}
}