+ 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();
}