📄 processmanager.java
字号:
// Source File Name: ProcessManager.java
package core.framework;
import java.io.FileInputStream;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import common.*;
import core.framework.GemplanetConnection;
import core.framework.PgFrameworkEx;
import common.dlayer.*;
import common.param.*;
import core.flayer.*;
import prego.PgFrameworkBaseAbstract;
import common.*;
import framework.PgFrameworkBase;
import prego.util.PgLogger;
// Referenced classes of packagecore.framework:
// OthSysConn, InfoTransaction, AdmitTransaction, TransactionBase
public class ProcessManager extends PgFrameworkEx
{
public ProcessManager(String company_cd, String process_type, String process_id, BigDecimal process_no, BigDecimal process_sub_no, HashMap xmlMap, SystemInfoIn systemInfoIn)
{
connflag = false;
ReturnValue returnValue = new ReturnValue();
setLogInfo(systemInfoIn, returnValue.getSystemInfoOut(), "ProcessManager", "ProcessManager");
super.log.info("[START]");
try
{
companyCd = company_cd;
processId = process_id;
processType = process_type;
this.xmlMap = xmlMap;
boolean isRight = true;
if(systemInfoIn.getConnection() == null)
{
systemInfoIn.setTransactCtrl(true);
systemInfoIn.setLockCtrl(true);
}
if(systemInfoIn.isTransactCtrl())
{
if(!super.connectDB())
throw new Exception("Because of DBERROR ProcessManaer is not created!");
} else
if(systemInfoIn.getConnection() == null)
{
super.log.fatal("no connection handle.");
throw new Exception("Because of DBERROR ProcessManaer is not created!");
}
if(systemInfoIn.isTransactCtrl() && systemInfoIn.getConnection() != null)
{
systemInfoIn.setConnection(new GemplanetConnection(systemInfoIn.getConnection()));
connflag = true;
}
if(process_no == null || process_no.equals(new BigDecimal(0.0D)))
{
ProcessTblD_selectMaxNoByIdIn maxIn = new ProcessTblD_selectMaxNoByIdIn();
maxIn.setCompanyCd(company_cd);
maxIn.setProcessType(process_type);
maxIn.setProcessId(process_id);
returnValue = s_ProcessTblD_selectMaxNoById(systemInfoIn, maxIn);
if(returnValue.getSystemInfoOut().getErrorCode() != null)
throw new Exception("Because of DBERROR ProcessManaer is not created!");
ProcessTblD_selectMaxNoByIdOut maxOut = (ProcessTblD_selectMaxNoByIdOut)returnValue.getData();
processNo = maxOut.getMaxProcessNo();
if(processNo == null)
processNo = new BigDecimal(1.0D);
else
processNo = processNo.add(new BigDecimal(1.0D));
processVer = (String)xmlMap.get("process_ver");
processStatus = "1";
entryStf = ((UserInfo)systemInfoIn.getExtend1()).getStfNo();
secCd = ((UserInfo)systemInfoIn.getExtend1()).getSecCd();
entryDate = getSystemDate();
attachFlg = new BigDecimal(0.0D);
processSubNo = new BigDecimal(0.0D);
nodeId = (String)((HashMap)xmlMap.get("start-node")).get("node_id");
nodeType = "start";
nodeStatus = "";
nodeKind = "1";
targetCompanyCd = ((UserInfo)systemInfoIn.getExtend1()).getCompanyCd();
targetStfNo = ((UserInfo)systemInfoIn.getExtend1()).getStfNo();
cpNode = null;
roleId = null;
targetSecCd = null;
levelTop = null;
levelBottom = null;
infoSecCd = null;
replaceTarget = null;
beforeNode = "\u306A\u3057";
reason = null;
makeReason = null;
actionStfCompanyCd = ((UserInfo)systemInfoIn.getExtend1()).getCompanyCd();
actionStf = ((UserInfo)systemInfoIn.getExtend1()).getStfNo();
actionDate = getSystemDate();
readFlg = new BigDecimal(0.0D);
delFlg = new BigDecimal(0.0D);
ProcessTblD_insertIn insertIn = new ProcessTblD_insertIn();
ProcessTbl_st insetSt = new ProcessTbl_st();
insetSt.setCompanyCd(companyCd);
insetSt.setProcessType(processType);
insetSt.setProcessId(processId);
insetSt.setProcessNo(processNo);
insetSt.setProcessVer(processVer);
insetSt.setProcessStatus(processStatus);
insetSt.setEntryStf(entryStf);
insetSt.setEntryDate(entryDate);
insetSt.setSecCd(secCd);
insetSt.setAttachFlg(attachFlg);
insetSt.setDelFlg(delFlg);
insertIn.setProcessTbl(insetSt);
returnValue = s_ProcessTblD_insert(systemInfoIn, insertIn);
if(returnValue.getSystemInfoOut().getErrorCode() != null)
throw new Exception("Because of DBERROR ProcessManaer is not created!");
} else
if(process_sub_no.equals(new BigDecimal(0.0D)))
{
processNo = process_no;
ProcessTblD_selectByPKIn dIn = new ProcessTblD_selectByPKIn();
dIn.setCompanyCd(companyCd);
dIn.setProcessType(processType);
dIn.setProcessId(processId);
dIn.setProcessNo(processNo);
returnValue = s_ProcessTblD_selectByPK(systemInfoIn, dIn);
if(returnValue.getSystemInfoOut().getErrorCode() != null)
throw new Exception("Because of DBERROR ProcessManaer is not created!");
if(returnValue.getSystemInfoOut().getHitCount() == 0)
throw new Exception("Because of no data ProcessManaer is not created!");
ProcessTblD_selectByPKOut dOut = (ProcessTblD_selectByPKOut)returnValue.getData();
ProcessTbl_st process_St = dOut.getProcessTbl();
processVer = process_St.getProcessVer();
processStatus = process_St.getProcessStatus();
entryStf = process_St.getEntryStf();
secCd = process_St.getSecCd();
entryDate = process_St.getEntryDate();
attachFlg = process_St.getAttachFlg();
exclusiveKeyPro = process_St.getExclusiveKey();
processSubNo = new BigDecimal(0.0D);
nodeId = (String)((HashMap)xmlMap.get("start-node")).get("node_id");
nodeType = "start";
nodeStatus = "";
nodeKind = "1";
targetCompanyCd = ((UserInfo)systemInfoIn.getExtend1()).getCompanyCd();
targetStfNo = ((UserInfo)systemInfoIn.getExtend1()).getStfNo();
cpNode = null;
roleId = null;
targetSecCd = null;
levelTop = null;
levelBottom = null;
infoSecCd = null;
replaceTarget = null;
beforeNode = "\u306A\u3057";
reason = null;
makeReason = null;
actionStfCompanyCd = ((UserInfo)systemInfoIn.getExtend1()).getCompanyCd();
actionStf = ((UserInfo)systemInfoIn.getExtend1()).getStfNo();
actionDate = getSystemDate();
readFlg = new BigDecimal(0.0D);
delFlg = new BigDecimal(0.0D);
} else
{
processNo = process_no;
processSubNo = process_sub_no;
ProcessTblD_selectByPKIn dIn = new ProcessTblD_selectByPKIn();
dIn.setCompanyCd(companyCd);
dIn.setProcessType(processType);
dIn.setProcessId(processId);
dIn.setProcessNo(processNo);
returnValue = s_ProcessTblD_selectByPK(systemInfoIn, dIn);
if(returnValue.getSystemInfoOut().getErrorCode() != null)
throw new Exception("Because of DBERROR ProcessManaer is not created!");
if(returnValue.getSystemInfoOut().getHitCount() == 0)
throw new Exception("Because of no data ProcessManaer is not created!");
ProcessTblD_selectByPKOut dOut = (ProcessTblD_selectByPKOut)returnValue.getData();
ProcessTbl_st process_St = dOut.getProcessTbl();
processVer = process_St.getProcessVer();
processStatus = process_St.getProcessStatus();
entryStf = process_St.getEntryStf();
secCd = process_St.getSecCd();
entryDate = process_St.getEntryDate();
attachFlg = process_St.getAttachFlg();
exclusiveKeyPro = process_St.getExclusiveKey();
NodeTblD_selectByPKIn sIn = new NodeTblD_selectByPKIn();
sIn.setCompanyCd(companyCd);
sIn.setProcessType(processType);
sIn.setProcessId(processId);
sIn.setProcessNo(processNo);
sIn.setProcessSubNo(processSubNo);
returnValue = s_NodeTblD_selectByPK(systemInfoIn, sIn);
if(returnValue.getSystemInfoOut().getErrorCode() != null)
throw new Exception("Because of DBERROR ProcessManaer is not created!");
if(returnValue.getSystemInfoOut().getHitCount() == 0)
throw new Exception("Because of no data ProcessManaer is not created!");
NodeTblD_selectByPKOut sOut = (NodeTblD_selectByPKOut)returnValue.getData();
NodeTbl_st nodeSt = sOut.getNodeTbl();
nodeId = nodeSt.getNodeId();
nodeType = nodeSt.getNodeType();
nodeStatus = nodeSt.getNodeStatus();
nodeKind = nodeSt.getNodeKind();
targetCompanyCd = nodeSt.getTargetCompanyCd();
targetStfNo = nodeSt.getTargetStfNo();
cpNode = nodeSt.getCpNode();
roleId = nodeSt.getRoleId();
targetSecCd = nodeSt.getSecCd();
levelTop = nodeSt.getLevelTop();
levelBottom = nodeSt.getLevelBottom();
infoSecCd = nodeSt.getInfoSecCd();
replaceTarget = nodeSt.getReplaceTarget();
beforeNode = nodeSt.getBeforeNode();
reason = nodeSt.getReason();
makeReason = nodeSt.getMakeReason();
actionStfCompanyCd = nodeSt.getActionStfCompanyCd();
actionStf = nodeSt.getActionStf();
actionDate = nodeSt.getActionDate();
readFlg = nodeSt.getReadFlg();
delFlg = nodeSt.getDelFlg();
exclusiveKeyNode = nodeSt.getExclusiveKey();
}
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
if(connflag)
closeTransaction();
super.log.info("[END]");
}
}
protected ReturnValue forward(SystemInfoIn systemInfoIn)
{
ReturnValue returnValue = new ReturnValue();
setLogInfo(systemInfoIn, returnValue.getSystemInfoOut(), "ProcessManager", "forward");
super.systemInfoOut.setErrorCode(null);
MessageList messageList = new MessageList();
super.log.info("[START]");
try
{
if(systemInfoIn.isTransactCtrl())
{
if(!super.connectDB())
returnCheck(returnValue);
} else
{
backupConnection();
if(systemInfoIn.getConnection() == null)
{
super.systemInfoOut.setErrorCode("EF0101");
super.systemInfoOut.setErrorMessage("no connection handle.");
super.log.fatal("no connection handle.");
returnCheck(returnValue);
}
}
if(systemInfoIn.isTransactCtrl() && systemInfoIn.getConnection() != null)
systemInfoIn.setConnection(new GemplanetConnection(systemInfoIn.getConnection()));
BigDecimal iCount = null;
boolean isRight = true;
boolean transactionCtrlValue = systemInfoIn.isTransactCtrl();
systemInfoIn.setTransactCtrl(false);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -