Package org.huihoo.workflow.store

Examples of org.huihoo.workflow.store.CaseDatabase


{
  private static Log log =LogFactory.getLog(LitterCleaner.class);
 
  public static void clear(WorkflowService workflowService)
  {
    CaseDatabase caseDatabase = workflowService.getCaseDatabase();
    Connection conn = null;
    String strSQL = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
   
    PreparedStatement pstmt1 = null;
    PreparedStatement pstmt2 = null;
   
    if(caseDatabase!=null && caseDatabase.getStore()==null)
    {
      return;
    }   
   
    try
    {
      conn = ConnUtils.getConnection(caseDatabase.getStore());

      strSQL =
        "SELECT vc_packageid,vc_processid,vc_uuid FROM "
          + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_CASE)
          + " "
          + "WHERE int_status=? OR int_status=?";
      pstmt=conn.prepareStatement(strSQL);
      pstmt.setInt(1,Constants.CASE_STATUS_CLOSED);
      pstmt.setInt(2,Constants.CASE_STATUS_CANCELED);
      rs=pstmt.executeQuery();
     
     
      String strSQL1 =
        "DELETE FROM "
          + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_CASE_DATAFIELD)
          + " "
          + "WHERE    vc_packageId=? "
          + "AND      vc_processid=? "
          + "AND      vc_caseid=?";

      String strSQL2 =
        "DELETE FROM "
          + caseDatabase.getSchemaContext().getTableName(SchemaContext.SCHEMA_ACTIVITY_DISPATCH)
          + " "
          + "WHERE    vc_packageId=? "
          + "AND      vc_processid=? "
          + "AND      vc_caseid=?";
      pstmt1 = conn.prepareStatement(strSQL1);
View Full Code Here


          configDigester.push(servletContext.getScriptConfig());
          configDigester.parse(is);
        }
        //--------------------create database
        UserDatabase userDatabase = null;
        CaseDatabase caseDatabase = null;
        String schemaConextBase = context.findInitParameter(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_SCHEMA_CONTEXT);
        if (schemaConextBase == null)
        {
          schemaConextBase = WorkflowProperties.getSchemaContextFile();
        }
        Hashtable env = new Hashtable();
        String storeFactoryClass = context.findFactoryClass(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_FACTORY_STORE);
        if (storeFactoryClass != null)
        {
          env.put(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_FACTORY_STORE, storeFactoryClass);
        }
        DatabaseFactory dbFactory = DatabaseFactory.newInstance(env);
        env.clear();
       
        Store userStore = context.findStore(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_STORE_USER);
        if (userStore == null)
        {
          userStore = WorkflowProperties.getUserStore();
        }
        env.put(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_STORE_USER, userStore);
        userDatabase = dbFactory.newUserDatabase(env);
        env.clear();
        userDatabase.setWorkflowService(context);
        Store caseStore = context.findStore(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_STORE_CASE);
        if (caseStore == null)
        {
          caseStore = WorkflowProperties.getCaseStore();
        }
        env.put(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_STORE_CASE, caseStore);
        caseDatabase = dbFactory.newCaseDatabase(env);
        caseDatabase.setWorkflowService(context);
        SchemaContext schemaContext = new SchemaContext(schemaConextBase);
        if (userDatabase.getSchemaContext() == null)
        {
          userDatabase.setSchemaContext(schemaContext);
        }
        if (caseDatabase.getSchemaContext() == null)
        {
          caseDatabase.setSchemaContext(schemaContext);
        }
        ScriptInterpretor scriptInterpretor = new JavaInterpretor();
        scriptInterpretor.initialize(context.getScriptContext());
        context.setCaseDatabase(caseDatabase);
        context.setUserDatabase(userDatabase);
View Full Code Here

    {
      Context cotext=(Context)this.workflowService;
      SessionManager manager=cotext.getEngine().getSessionManager();
      WorkflowSession session=manager.findSession(sessionID);
      WorkflowProcess workflowProcess=workflowService.findWorkflowPackage(liveProcess.getPackageID()).findWorkflowProcess(liveProcess.getUUID());
      CaseDatabase caseDatabase=workflowService.getCaseDatabase();
      UserDatabase userDatabase=workflowService.getUserDatabase();
      return caseDatabase.createWorkflowCase(session,workflowProcess,userDatabase.findParticipant(creator.getUUID()),creationTime,primaryKey,name,description);
    }
View Full Code Here

    {
      Context cotext=(Context)this.workflowService;
      SessionManager manager=cotext.getEngine().getSessionManager();
      WorkflowSession session=manager.findSession(sessionID);
      WorkflowProcess workflowProcess=workflowService.findWorkflowPackage(liveProcess.getPackageID()).findWorkflowProcess(liveProcess.getUUID());
      CaseDatabase caseDatabase=workflowService.getCaseDatabase();
      WorkflowCase liveCase=caseDatabase.findWorkflowCase(session,workflowProcess,caseId);
      if(liveCase!=null)
      {
        return new SerialCase(liveCase);
      }
      return null;
View Full Code Here

    {
      Context cotext=(Context)this.workflowService;
      SessionManager manager=cotext.getEngine().getSessionManager();
      WorkflowSession session=manager.findSession(sessionID);
      WorkflowProcess workflowProcess=workflowService.findWorkflowPackage(liveProcess.getPackageID()).findWorkflowProcess(liveProcess.getUUID());
      CaseDatabase caseDatabase=workflowService.getCaseDatabase();
      WorkflowCase liveCase=caseDatabase.findWorkflowCase(session,workflowProcess,primaryKey);
      if(liveCase!=null)
      {
        return new SerialCase(liveCase);
      }
      return null;
View Full Code Here

  {
    Context cotext=(Context)this.workflowService;
    SessionManager manager=cotext.getEngine().getSessionManager();
    WorkflowSession session=manager.findSession(sessionID);
    WorkflowProcess workflowProcess=workflowService.findWorkflowPackage(liveProcess.getPackageID()).findWorkflowProcess(liveProcess.getUUID());
    CaseDatabase caseDatabase=workflowService.getCaseDatabase();
    UserDatabase userDatabase=workflowService.getUserDatabase();
    List caseList=caseDatabase.getWorkflowCaseList(session,workflowProcess,userDatabase.findParticipant(creator.getUUID()))
    List result=new ArrayList();
   
    for(int i=0;i<caseList.size();++i)
    {
      result.add(new SerialCase((WorkflowCase)caseList.get(i)));
View Full Code Here

    {
      Context cotext=(Context)this.workflowService;
      SessionManager manager=cotext.getEngine().getSessionManager();
      WorkflowSession session=manager.findSession(sessionID);
      WorkflowProcess workflowProcess=workflowService.findWorkflowPackage(liveProcess.getPackageID()).findWorkflowProcess(liveProcess.getUUID());
      CaseDatabase caseDatabase=workflowService.getCaseDatabase();
      WorkflowCase localCase=caseDatabase.findWorkflowCase(session,workflowProcess,liveCase.getUUID());
      String packageID=localCase.getWorkflowProcess().getWorkflowPackage().getUUID();
      if(!liveCase.getPackageID().equals(packageID))
      {
        throw new WorkflowException("crossWorkflow not supported");
      }
     
      caseDatabase.deleteWorkflowCase(session,workflowProcess,localCase);
    }
View Full Code Here

    {
      Context cotext=(Context)this.workflowService;
      SessionManager manager=cotext.getEngine().getSessionManager();
      WorkflowSession session=manager.findSession(sessionID);
      WorkflowProcess workflowProcess=workflowService.findWorkflowPackage(liveProcess.getPackageID()).findWorkflowProcess(liveProcess.getUUID());
      CaseDatabase caseDatabase=workflowService.getCaseDatabase();
      WorkflowCase localCase=caseDatabase.findWorkflowCase(session,workflowProcess,liveCase.getUUID());
      String packageID=localCase.getWorkflowProcess().getWorkflowPackage().getUUID();
      if(!liveCase.getPackageID().equals(packageID))
      {
        throw new WorkflowException("crossWorkflow not supported");
      }
     
      caseDatabase.cancelWorkflowCase(session,workflowProcess,localCase);     
    }
View Full Code Here

    {
      Context cotext=(Context)this.workflowService;
      SessionManager manager=cotext.getEngine().getSessionManager();
      WorkflowSession session=manager.findSession(sessionID);
      WorkflowProcess workflowProcess=workflowService.findWorkflowPackage(liveProcess.getPackageID()).findWorkflowProcess(liveProcess.getUUID());
      CaseDatabase caseDatabase=workflowService.getCaseDatabase();

      WorkflowCase localCase=caseDatabase.findWorkflowCase(session,workflowProcess,liveCase.getUUID());
      String packageID=localCase.getWorkflowProcess().getWorkflowPackage().getUUID();
      if(!liveCase.getPackageID().equals(packageID))
      {
        throw new WorkflowException("crossWorkflow not supported");
      }
     
      caseDatabase.suspendWorkflowCase(session,workflowProcess,localCase);   
    }
View Full Code Here

    {
      Context cotext=(Context)this.workflowService;
      SessionManager manager=cotext.getEngine().getSessionManager();
      WorkflowSession session=manager.findSession(sessionID);
      WorkflowProcess workflowProcess=workflowService.findWorkflowPackage(liveProcess.getPackageID()).findWorkflowProcess(liveProcess.getUUID());
      CaseDatabase caseDatabase=workflowService.getCaseDatabase();

      WorkflowCase localCase=caseDatabase.findWorkflowCase(session,workflowProcess,liveCase.getUUID());
      String packageID=localCase.getWorkflowProcess().getWorkflowPackage().getUUID();
      if(!liveCase.getPackageID().equals(packageID))
      {
        throw new WorkflowException("crossWorkflow not supported");
      }
     
      caseDatabase.resumeWorkflowCase(session,workflowProcess,localCase);   
    }
View Full Code Here

TOP

Related Classes of org.huihoo.workflow.store.CaseDatabase

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.