return caseId;
}
WorkflowCase findCase_impl(SpiCaseDatabaseImpl gCaseDatabaseImpl,WorkflowProcess workflowProcess,WorkflowParticipant operator,Connection conn,boolean canRelease,String caseId, boolean isPK) throws WorkflowException
{
WorkflowCaseImpl workflowCase = null;
ResultSet jrs = null;
PreparedStatement pstmt = null;
try
{
SpiCaseIdGenerator caseIdGenerator=gCaseDatabaseImpl.getCaseIdGenerator();
SchemaContext schemaContext=gCaseDatabaseImpl.getSchemaContext();
Store storeConfig= gCaseDatabaseImpl.getStore();
String packageId = workflowProcess.getWorkflowPackage().getUUID();
String processId = workflowProcess.getUUID();
String strSQL = null;
if (isPK)
{
strSQL =
"SELECT * FROM "
+ schemaContext.getTableName(SchemaContext.SCHEMA_CASE)
+ " "
+ "WHERE vc_packageId=? AND vc_processid=? AND vc_primaryKey=?";
}
else
{
strSQL =
"SELECT * FROM "
+ schemaContext.getTableName(SchemaContext.SCHEMA_CASE)
+ " "
+ "WHERE vc_packageId=? AND vc_processid=? AND vc_uuid=?";
}
pstmt = conn.prepareStatement(strSQL);
pstmt.setString(1, packageId);
pstmt.setString(2, processId);
pstmt.setString(3, caseId);
jrs = pstmt.executeQuery();
if (jrs.next())
{
workflowCase = new WorkflowCaseImpl();
workflowCase.setWorkflowProcess(workflowProcess);
workflowCase.setName(jrs.getString("vc_name"));
workflowCase.setUUID(jrs.getString("vc_uuid"));
workflowCase.setCreationTime(DateTools.toJavaDate(jrs.getTimestamp("dat_creationTime")));
workflowCase.setStatus(jrs.getInt("int_status"));
workflowCase.setCreator(
gCaseDatabaseImpl.getWorkflowService().getUserDatabase().findParticipant(
jrs.getString("vc_creator")));
workflowCase.setPrimaryKey(new PrimaryKeyImpl(jrs.getString("vc_primaryKey")));
WorkflowCaseContext caseContext =
ContexManager.fetchContext(storeConfig, schemaContext, workflowCase);
workflowCase.setCaseContext(caseContext);
}
}
catch (SQLException sqlex)
{
throw new WorkflowException(sqlex);