Package org.huihoo.workflow.impl.runtime

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


  }

  public List getWorkList_impl(SpiCaseDatabaseImpl gCaseDatabaseImpl,WorkflowProcess workflowProcess,WorkflowParticipant operator,Connection conn,boolean canRelease,WorkflowParticipant performer, int itemStatus) throws WorkflowException
  {
    ArrayList workList = new ArrayList();
    WorkflowWorkImpl workflowWork = null;

    PreparedStatement pstmt = null;
    ResultSet jrs = null;

    try
    {
      SpiCaseIdGenerator caseIdGenerator=gCaseDatabaseImpl.getCaseIdGenerator();
      SchemaContext      schemaContext=gCaseDatabaseImpl.getSchemaContext()
      Store         storeConfig=  gCaseDatabaseImpl.getStore();
     
      WorkflowPackage workflowPackage = workflowProcess.getWorkflowPackage();
      String packageId = workflowPackage.getUUID();
      String processId = workflowProcess.getUUID();

      String strSQL =
        "SELECT * FROM "
          + schemaContext.getTableName(SchemaContext.SCHEMA_WORK)
          + " "
          + "WHERE  vc_packageId=?"
          + " "
          + "AND    vc_processid=?"
          + " "
          + "AND    vc_performer=?";
      switch (itemStatus)
      {
        case Constants.WORK_STATUS_ARRIVED :
          strSQL += " AND (dat_arriveTime IS NOT NULL) AND (dat_acceptTime IS NULL) ";
          break;
        case Constants.WORK_STATUS_ACCEPTED :
          strSQL += " AND (dat_acceptTime IS NOT NULL) AND (dat_dispatchTime IS NULL) ";
          break;
        case Constants.WORK_STATUS_DISPATCHED :
          strSQL += " AND (dat_dispatchTime IS NOT NULL)";
          break;
        default :
          throw new WorkflowException("Unkown workflowWork status : " + itemStatus);
          //break;
      }

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

      jrs = pstmt.executeQuery();

      String parent_workId = null;
      String vc_performer = null;
      String vc_caseId = null;
      String vc_activityId = null;
      String vc_owner_processId = null;
      WorkflowProcess ownerProcess = null;

      while (jrs.next())
      {
        parent_workId = jrs.getString("vc_parent_workId");
        vc_performer = jrs.getString("vc_performer");
        vc_activityId = jrs.getString("vc_activityId");
        vc_owner_processId = jrs.getString("vc_owner_processId");
        vc_caseId = jrs.getString("vc_caseId");
        if (parent_workId == null)
        {
          workflowWork = new WorkflowWorkImpl();
          workflowWork.setWorkflowCase(findCase_impl(gCaseDatabaseImpl,workflowProcess,operator,conn,false,vc_caseId, false));
          workflowWork.setUUID(jrs.getString("vc_uuid"));
          ownerProcess = workflowPackage.findWorkflowProcess(vc_owner_processId);
          workflowWork.setWorkflowActivity(ownerProcess.findWorkflowActivity(vc_activityId));
          workflowWork.setArriveTime(DateTools.toJavaDate(jrs.getTimestamp("dat_arriveTime")));
          workflowWork.setAcceptTime(DateTools.toJavaDate(jrs.getTimestamp("dat_acceptTime")));
          workflowWork.setDispatchTime(DateTools.toJavaDate(jrs.getTimestamp("dat_dispatchTime")));
          workflowWork.setPerformer(
          gCaseDatabaseImpl.getWorkflowService().getUserDatabase().findParticipant(
              vc_performer));
        }
        else
        {
          SubWorkImpl workflowSubWork = new SubWorkImpl();
          workflowSubWork.setWorkflowCase(findCase_impl(gCaseDatabaseImpl,workflowProcess,operator,conn,false,vc_caseId, false));
          workflowSubWork.setUUID(jrs.getString("vc_uuid"));
          ownerProcess = workflowPackage.findWorkflowProcess(vc_owner_processId);
          workflowSubWork.setWorkflowActivity(ownerProcess.findWorkflowActivity(vc_activityId));
          workflowSubWork.setArriveTime(DateTools.toJavaDate(jrs.getTimestamp("dat_arriveTime")));
          workflowSubWork.setAcceptTime(DateTools.toJavaDate(jrs.getTimestamp("dat_acceptTime")));
          workflowSubWork.setDispatchTime(
            DateTools.toJavaDate(jrs.getTimestamp("dat_dispatchTime")));

          workflowWork.setPerformer(
          gCaseDatabaseImpl.getWorkflowService().getUserDatabase().findParticipant(
              vc_performer));

          workflowSubWork.setParentWorkflowWork(
            findWork_impl(gCaseDatabaseImpl,workflowProcess,operator,conn,false,workflowSubWork.getWorkflowCase(), parent_workId));
View Full Code Here


  }
  public List getWorkList_impl(SpiCaseDatabaseImpl gCaseDatabaseImpl,WorkflowProcess workflowProcess,WorkflowParticipant operator,Connection conn,boolean canRelease,WorkflowCase workflowCase, WorkflowParticipant performer, int itemStatus)
    throws WorkflowException
  {
    ArrayList workList = new ArrayList();
    WorkflowWorkImpl workflowWork = null;
    PreparedStatement pstmt = null;
    ResultSet jrs = null;

    try
    {
      SpiCaseIdGenerator caseIdGenerator=gCaseDatabaseImpl.getCaseIdGenerator();
      SchemaContext      schemaContext=gCaseDatabaseImpl.getSchemaContext()
      Store         storeConfig=  gCaseDatabaseImpl.getStore();
     
     
      WorkflowPackage workflowPackage = workflowProcess.getWorkflowPackage();
      String packageId = workflowPackage.getUUID();
      String processId = workflowProcess.getUUID();
      String caseId = workflowCase.getUUID();
      String strSQL =
        "SELECT * FROM "
          + schemaContext.getTableName(SchemaContext.SCHEMA_WORK)
          + " "
          + "WHERE  vc_packageId=?"
          + " "
          + "AND    vc_processid=?"
          + " "
          + "AND    vc_caseid=?"
          + " "
          + "AND    vc_performer=?";
      switch (itemStatus)
      {
        case Constants.WORK_STATUS_ARRIVED :
          strSQL += " AND (dat_arriveTime IS NOT NULL) AND (dat_acceptTime IS NULL) ";
          break;
        case Constants.WORK_STATUS_ACCEPTED :
          strSQL += " AND (dat_acceptTime IS NOT NULL) AND (dat_dispatchTime IS NULL) ";
          break;
        case Constants.WORK_STATUS_DISPATCHED :
          strSQL += " AND (dat_dispatchTime IS NOT NULL)";
          break;
        default :
          throw new WorkflowException("Unkown workflowWork status : " + itemStatus);
          //break;
      }

      pstmt = conn.prepareStatement(strSQL);
      pstmt.setString(1, packageId);
      pstmt.setString(2, processId);
      pstmt.setString(3, caseId);
      pstmt.setString(4, notNullPerformer(performer).getUUID());

      jrs = pstmt.executeQuery();

      String parent_processId = null;
      String parent_workId = null;
      String vc_performer = null;
      String vc_activityId = null;
      String vc_owner_processId = null;
      WorkflowProcess ownerProcess = null;

      while (jrs.next())
      {
        parent_workId = jrs.getString("vc_parent_workId");
        vc_performer = jrs.getString("vc_performer");
        vc_activityId = jrs.getString("vc_activityId");
        vc_owner_processId = jrs.getString("vc_owner_processId");
        if (parent_workId == null)
        {
          workflowWork = new WorkflowWorkImpl();
          workflowWork.setWorkflowCase(workflowCase);
          workflowWork.setUUID(jrs.getString("vc_uuid"));
          ownerProcess = workflowPackage.findWorkflowProcess(vc_owner_processId);
          workflowWork.setWorkflowActivity(ownerProcess.findWorkflowActivity(vc_activityId));
          workflowWork.setArriveTime(DateTools.toJavaDate(jrs.getTimestamp("dat_arriveTime")));
          workflowWork.setAcceptTime(DateTools.toJavaDate(jrs.getTimestamp("dat_acceptTime")));
          workflowWork.setDispatchTime(DateTools.toJavaDate(jrs.getTimestamp("dat_dispatchTime")));
          workflowWork.setPerformer(
          gCaseDatabaseImpl.getWorkflowService().getUserDatabase().findParticipant(vc_performer));
        }
        else
        {
          SubWorkImpl workflowSubWork = new SubWorkImpl();
          workflowSubWork.setWorkflowCase(workflowCase);
          workflowSubWork.setUUID(jrs.getString("vc_uuid"));
          ownerProcess = workflowPackage.findWorkflowProcess(vc_owner_processId);
          workflowSubWork.setWorkflowActivity(ownerProcess.findWorkflowActivity(vc_activityId));
          workflowSubWork.setArriveTime(DateTools.toJavaDate(jrs.getTimestamp("dat_arriveTime")));
          workflowSubWork.setAcceptTime(DateTools.toJavaDate(jrs.getTimestamp("dat_acceptTime")));
          workflowSubWork.setDispatchTime(
            DateTools.toJavaDate(jrs.getTimestamp("dat_dispatchTime")));
          workflowWork.setPerformer(gCaseDatabaseImpl.getWorkflowService().getUserDatabase().findParticipant(vc_performer));

          workflowSubWork.setParentWorkflowWork(findWork_impl(gCaseDatabaseImpl,workflowProcess,operator,conn,false,workflowCase, parent_workId));
          workflowWork = workflowSubWork;
        }
        workList.add(workflowWork);
View Full Code Here

    }
  }

  WorkflowWork findWork_impl(SpiCaseDatabaseImpl gCaseDatabaseImpl,WorkflowProcess workflowProcess,WorkflowParticipant operator,Connection conn,boolean canRelease,WorkflowCase workflowCase, String workId) throws WorkflowException
  {
    WorkflowWorkImpl workflowWork = null;

    PreparedStatement pstmt = null;
    ResultSet jrs = null;

    try
    {
      SpiCaseIdGenerator caseIdGenerator=gCaseDatabaseImpl.getCaseIdGenerator();
      SchemaContext      schemaContext=gCaseDatabaseImpl.getSchemaContext()
      Store         storeConfig=  gCaseDatabaseImpl.getStore();
     
      WorkflowPackage workflowPackage = workflowProcess.getWorkflowPackage();
      String packageId = workflowPackage.getUUID();
      String processId = workflowProcess.getUUID();
      String caseId = workflowCase.getUUID();
      String strSQL =
        "SELECT * FROM "
          + schemaContext.getTableName(SchemaContext.SCHEMA_WORK)
          + " "
          + "WHERE  vc_packageId=?"
          + " "
          + "AND    vc_processid=?"
          + " "
          + "AND    vc_caseId=?"
          + " "
          + "AND    vc_uuId=?";
     
      pstmt = conn.prepareStatement(strSQL);
      pstmt.setString(1, packageId);
      pstmt.setString(2, processId);
      pstmt.setString(3, caseId);
      pstmt.setString(4, workId);

      jrs = pstmt.executeQuery();

      String parent_workId = null;
      String vc_performer = null;
      String vc_activityId = null;
      String vc_owner_processId = null;
      WorkflowProcess ownerProcess = null;

      if (jrs.next())
      {
        parent_workId = jrs.getString("vc_parent_workId");
        vc_performer = jrs.getString("vc_performer");
        vc_activityId = jrs.getString("vc_activityId");
        vc_owner_processId=jrs.getString("vc_owner_processId");
       
        if (parent_workId == null)
        {
          workflowWork = new WorkflowWorkImpl();
          workflowWork.setWorkflowCase(workflowCase);
          workflowWork.setUUID(jrs.getString("vc_uuid"));         
       
          ownerProcess = workflowPackage.findWorkflowProcess(vc_owner_processId);
          workflowWork.setWorkflowActivity(ownerProcess.findWorkflowActivity(vc_activityId));
          workflowWork.setArriveTime(DateTools.toJavaDate(jrs.getTimestamp("dat_arriveTime")));
          workflowWork.setAcceptTime(DateTools.toJavaDate(jrs.getTimestamp("dat_acceptTime")));
          workflowWork.setDispatchTime(DateTools.toJavaDate(jrs.getTimestamp("dat_dispatchTime")));
        }
        else
        {
          SubWorkImpl workflowSubWork = new SubWorkImpl();
          workflowSubWork.setWorkflowCase(workflowCase);
View Full Code Here

TOP

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

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.