Package org.huihoo.workflow.usermodel

Examples of org.huihoo.workflow.usermodel.WorkflowParticipant


   */
  public WorkflowParticipant findParticipant(String userid)
  {
    Connection conn = null;
    PreparedStatement pstmt = null;
    WorkflowParticipant participant = null;

    String strSQL =
      "SELECT vc_uuid,vc_name,vc_password,vc_fullname,vc_description,vc_rankid "
        + " "
        + " FROM "
View Full Code Here


      {
        jrs.absolute(i);
        String groupid = jrs.getString("vc_groupid");
        String userid = jrs.getString("vc_userid");
        WorkflowGroup workflowGroup = findGroup(groupid);
        WorkflowParticipant workflowUser = findParticipant(userid);
        workflowGroup.addPaticipant(workflowUser);
      }
      jrs.release();

      //---------------------------------------------create user department relation
      strSQL =
        "SELECT vc_userid,vc_departmenetid FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER_DEPARTMENT);

      jrs = jStatement.executeQuery(getStore(), strSQL);
      int sizeUserDept = jrs.getRowCount();
      for (int i = 1; i <= sizeUserDept; ++i)
      {
        jrs.absolute(i);
        String deptid = jrs.getString("vc_departmenetid");
        String userid = jrs.getString("vc_userid");
        WorkflowDepartment workflowDept = findDepartment(deptid);
        WorkflowParticipant workflowUser = findParticipant(userid);
        workflowDept.addPaticipant(workflowUser);
      }
      jrs.release();

      //---------------------------------------------create user role relation
      strSQL =
        "SELECT vc_userid,vc_roleid FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER_ROLE);

      jrs = jStatement.executeQuery(getStore(), strSQL);
      int sizeUserRole = jrs.getRowCount();
      for (int i = 1; i <= sizeUserRole; ++i)
      {
        jrs.absolute(i);
        String roleid = jrs.getString("vc_roleid");
        String userid = jrs.getString("vc_userid");
        WorkflowRole workflowRole = findRole(roleid);
        WorkflowParticipant workflowUser = findParticipant(userid);
        workflowRole.addPaticipant(workflowUser);
      }
      jrs.release();

    }
View Full Code Here

    try
    {
      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeUser = jrs.getRowCount();
      WorkflowParticipant participant = null;
      for (int i = 1; i <= sizeUser; ++i)
      {
        jrs.absolute(i);
        participant =
          createParticipant_impl(
            jrs.getString("vc_uuid"),
            jrs.getString("vc_name"),
            jrs.getString("vc_password"),
            jrs.getString("vc_fullname"),
            jrs.getString("vc_description"));

        participant.setRank(findRank(jrs.getString("vc_rankid")));
        participants.put(jrs.getString("vc_uuid"), participant);
      }

      jrs.release();
    }
View Full Code Here

    synchronized (groups)
    {
      Iterator users = getParticipants();
      while (users.hasNext())
      {
        WorkflowParticipant user = (WorkflowParticipant) users.next();
        user.removeGroup(group);
      }

      Iterator depts = getDepartments();
      while (depts.hasNext())
      {
View Full Code Here

   synchronized (departments)
   {
     Iterator users = getParticipants();
     while (users.hasNext())
     {
       WorkflowParticipant user = (WorkflowParticipant) users.next();
       user.removeDepartment(dept);
     }
   
    Iterator groups = getGroups();
    while (groups.hasNext())
    {
View Full Code Here

    synchronized (roles)
    {
      Iterator users = getParticipants();
      while (users.hasNext())
      {
        WorkflowParticipant user = (WorkflowParticipant) users.next();
        user.removeRole(role);
      }
     roles.remove(role.getUUID());
    }
  }
View Full Code Here

          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER);

      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeUser = jrs.getRowCount();
      WorkflowParticipant participant = null;
      for (int i = 1; i <= sizeUser; ++i)
      {
        jrs.absolute(i);
        participant =
          createParticipant(
            jrs.getString("vc_uuid"),
            jrs.getString("vc_name"),
            jrs.getString("vc_password"),
            jrs.getString("vc_fullname"),
            jrs.getString("vc_description"));

        participant.setRank((WorkflowRank) ranks.get(jrs.getString("vc_rankid")));
      }

      jrs.release();

      //---------------------------------------------set user administrator
      strSQL =
        "SELECT vc_userid,vc_packageId "
          + " "
          + " FROM "+ getSchemaContext().getTableName(SchemaContext.SCHEMA_ADMIN);

      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeAdmin = jrs.getRowCount();
      for (int i = 1; i <= sizeAdmin; ++i)
      {
        jrs.absolute(i);
        WorkflowParticipantImpl participantImpl=(WorkflowParticipantImpl)this.findParticipant(jrs.getString("vc_userid"));     
       
        if("all".equalsIgnoreCase(jrs.getString("vc_packageId")))
        {
          participantImpl.setSuperAdministrator(true);
        }
        else
        {
          participantImpl.addPackage(jrs.getString("vc_packageId"));
        }
      }

      jrs.release();
     
      //---------------------------------------------create departments
      genDepartmentTree(null);     

      //---------------------------------------------create groups
      genGroupTree(null);
     
      //---------------------------------------------create user group relation
      strSQL =
        "SELECT vc_userid,vc_groupid FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER_GROUP);

      jrs = jStatement.executeQuery(getStore(), strSQL);
      int sizeUserGroup = jrs.getRowCount();
      for (int i = 1; i <= sizeUserGroup; ++i)
      {
        jrs.absolute(i);
        String groupid = jrs.getString("vc_groupid");
        String userid = jrs.getString("vc_userid");
        WorkflowGroup workflowGroup = findGroup(groupid);
        WorkflowParticipant workflowUser = findParticipant(userid);
        workflowGroup.addPaticipant(workflowUser);
      }
      jrs.release();

      //---------------------------------------------create user department relation
      strSQL =
        "SELECT vc_userid,vc_departmenetid FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER_DEPARTMENT);

      jrs = jStatement.executeQuery(getStore(), strSQL);
      int sizeUserDept = jrs.getRowCount();
      for (int i = 1; i <= sizeUserDept; ++i)
      {
        jrs.absolute(i);
        String deptid = jrs.getString("vc_departmenetid");
        String userid = jrs.getString("vc_userid");
        WorkflowDepartment workflowDept = findDepartment(deptid);
        WorkflowParticipant workflowUser = findParticipant(userid);
        workflowDept.addPaticipant(workflowUser);
      }
      jrs.release();

      //---------------------------------------------create user role relation
      strSQL =
        "SELECT vc_userid,vc_roleid FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER_ROLE);

      jrs = jStatement.executeQuery(getStore(), strSQL);
      int sizeUserRole = jrs.getRowCount();
      for (int i = 1; i <= sizeUserRole; ++i)
      {
        jrs.absolute(i);
        String roleid = jrs.getString("vc_roleid");
        String userid = jrs.getString("vc_userid");
        WorkflowRole workflowRole = findRole(roleid);
        WorkflowParticipant workflowUser = findParticipant(userid);
        workflowRole.addPaticipant(workflowUser);
      }
      jrs.release();
     
    }
View Full Code Here

TOP

Related Classes of org.huihoo.workflow.usermodel.WorkflowParticipant

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.