PreparedStatement pstmt = null;
String pathId = null;
try
{
SpiCaseIdGenerator caseIdGenerator=gCaseDatabaseImpl.getCaseIdGenerator();
SchemaContext schemaContext=gCaseDatabaseImpl.getSchemaContext();
Store storeConfig= gCaseDatabaseImpl.getStore();
String pkgId = workflowProcess.getWorkflowPackage().getUUID();
String processId = workflowProcess.getUUID();
String caseId = workflowCase.getUUID();
String transitionId=null;
String owner_processId=null;
WorkflowActivity fromActivity=(fromWork!=null)?fromWork.getWorkflowActivity():null;
WorkflowActivity toActivity=(toWork!=null)?toWork.getWorkflowActivity():null;
if(fromActivity!=null && toActivity!=null)
{
WorkflowProcess owner_process=fromActivity.getWorkflowProcess();
owner_processId=owner_process.getUUID();
transitionId=owner_process.findWorkflowTransition(fromActivity,toActivity).getUUID();
}
pathId = caseIdGenerator.genWorkflowPathID(pkgId, processId, caseId);
String strSQL =
"INSERT INTO "
+ schemaContext.getTableName(SchemaContext.SCHEMA_PATH)
+ "(vc_packageid,vc_processid,vc_caseId,vc_uuid,vc_from,vc_to,vc_batchNo,int_eventType,vc_owner_processid,vc_transitionId) "
+ "VALUES(?,?,?,?,?,?,?,?,?,?)";
pstmt = conn.prepareStatement(strSQL);
pstmt.setString(1, pkgId);
pstmt.setString(2, processId);