Package org.huihoo.workflow.impl.runtime

Examples of org.huihoo.workflow.impl.runtime.WorkflowCaseImpl


    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);
View Full Code Here


    }
  }

  public List getCaseList_impl(SpiCaseDatabaseImpl gCaseDatabaseImpl,WorkflowProcess workflowProcess,WorkflowParticipant operator,Connection conn,boolean canRelease,WorkflowParticipant creator) throws WorkflowException
  {
    WorkflowCaseImpl workflowCase = null;

    ResultSet jrs = null;
    PreparedStatement pstmt = null;

    ArrayList caseList = new ArrayList();
    try
    {
      SpiCaseIdGenerator caseIdGenerator=gCaseDatabaseImpl.getCaseIdGenerator();
      SchemaContext      schemaContext=gCaseDatabaseImpl.getSchemaContext()
      Store         storeConfig=  gCaseDatabaseImpl.getStore();
     
      String packageId = workflowProcess.getWorkflowPackage().getUUID();
      String processId = workflowProcess.getUUID();
      String strSQL =
        "SELECT * FROM "
          + schemaContext.getTableName(SchemaContext.SCHEMA_CASE)
          + " "
          + "WHERE  vc_packageId=? AND    vc_processid=? AND    vc_creator=?";;

      pstmt = conn.prepareStatement(strSQL);
      pstmt.setString(1, packageId);
      pstmt.setString(2, processId);
      pstmt.setString(3, creator.getUUID());

      jrs = pstmt.executeQuery();
      while (jrs.next())
      {
        workflowCase = new WorkflowCaseImpl();
        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);
        caseList.add(workflowCase);
      }
    }
    catch (SQLException sqlex)
    {
View Full Code Here

TOP

Related Classes of org.huihoo.workflow.impl.runtime.WorkflowCaseImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.