PreparedStatement pstmt6 = null;
PreparedStatement pstmt7 = null;
try
{
SpiCaseIdGenerator caseIdGenerator=gCaseDatabaseImpl.getCaseIdGenerator();
SchemaContext schemaContext=gCaseDatabaseImpl.getSchemaContext();
Store storeConfig= gCaseDatabaseImpl.getStore();
String packageId = workflowProcess.getWorkflowPackage().getUUID();
String processId = workflowProcess.getUUID();
if (canRelease)
{
conn.setAutoCommit(false);
}
String strSQL =
"DELETE FROM "
+ schemaContext.getTableName(SchemaContext.SCHEMA_CASE)
+ " "
+ "WHERE vc_packageId=? "
+ "AND vc_processid=? "
+ "AND vc_uuid=?";
pstmt1 = conn.prepareStatement(strSQL);
pstmt1.setString(1, packageId);
pstmt1.setString(2, processId);
pstmt1.setString(3, workflowCase.getUUID());
pstmt1.executeUpdate();
strSQL =
"DELETE FROM "
+ schemaContext.getTableName(SchemaContext.SCHEMA_CASE_DATAFIELD)
+ " "
+ "WHERE vc_packageId=? "
+ "AND vc_processid=? "
+ "AND vc_caseid=?";
pstmt2 = conn.prepareStatement(strSQL);
pstmt2.setString(1, packageId);
pstmt2.setString(2, processId);
pstmt2.setString(3, workflowCase.getUUID());
pstmt2.executeUpdate();
strSQL =
"DELETE FROM "
+ schemaContext.getTableName(SchemaContext.SCHEMA_WORK)
+ " "
+ "WHERE vc_packageId=? "
+ "AND vc_processid=? "
+ "AND vc_caseid=?";
pstmt3 = conn.prepareStatement(strSQL);
pstmt3.setString(1, packageId);
pstmt3.setString(2, processId);
pstmt3.setString(3, workflowCase.getUUID());
pstmt3.executeUpdate();
strSQL =
"DELETE FROM "
+ schemaContext.getTableName(SchemaContext.SCHEMA_PATH)
+ " "
+ "WHERE vc_packageId=? "
+ "AND vc_processid=? "
+ "AND vc_caseid=?";
pstmt4 = conn.prepareStatement(strSQL);
pstmt4.setString(1, packageId);
pstmt4.setString(2, processId);
pstmt4.setString(3, workflowCase.getUUID());
pstmt4.executeUpdate();
strSQL =
"DELETE FROM "
+ schemaContext.getTableName(SchemaContext.SCHEMA_CASE_EVENT)
+ " "
+ "WHERE vc_packageId=? "
+ "AND vc_processid=? "
+ "AND vc_caseid=?";
pstmt5 = conn.prepareStatement(strSQL);
pstmt5.setString(1, packageId);
pstmt5.setString(2, processId);
pstmt5.setString(3, workflowCase.getUUID());
pstmt5.executeUpdate();
strSQL =
"DELETE FROM "
+ schemaContext.getTableName(SchemaContext.SCHEMA_WORK_EVENT)
+ " "
+ "WHERE vc_packageId=? "
+ "AND vc_processid=? "
+ "AND vc_caseid=?";
pstmt6 = conn.prepareStatement(strSQL);
pstmt6.setString(1, packageId);
pstmt6.setString(2, processId);
pstmt6.setString(3, workflowCase.getUUID());
pstmt6.executeUpdate();
strSQL =
"DELETE FROM "
+ schemaContext.getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)
+ " "
+ "WHERE vc_packageId=? "
+ "AND vc_processid=? "
+ "AND vc_caseid=?";