Final report - DCM Server - University of Houston

advertisement
University of Houston - Clear Lake
RoboComm: Rule Based Scheduling for
Communication Systems
Final Report
Version 1.3
Faculty Advisor
Dr. Kwok-Bun Yue
Mentor
Mr. Dilhar De Silva
[
Team Members
Thanh Doan
Dung Nguyen
Tuan Le
Hung Tran
Spring 2007
May 01, 2007
 Copyright 2007 University of Houston Clear Lake
Page 1 of 19
Abstract
AtLinks Communications, a software company focused on provided automated business
communications solution, has developed a rule-based scheduler prototype for scheduling
virtual conferences with mobile participants through the Internet. Conference conveners
use a Web-based interface to define conference and participant properties. Based on the
availability feedback from the participants, the Java Boss Rule scheduler can then attempt
to schedule acceptable meeting times. Although successful in demonstrating feasibility,
the current prototype is limited in many respects. For examples, the current Web user
interface is rudimentary and ineffective to use and the rules are not realistic enough for
deployment.
The goal of this project is to refine the prototype to enhance its functionality and
usability. Our team has used AJAX to develop a modern Web user interface similar to
Outlook. We have also refined the rules to include more realistic parameters…
 Copyright 2007 University of Houston Clear Lake
Page 2 of 19
Table of Contents
1.
Introduction ................................................................................................................. 4
a. Scope ....................................................................................................................... 4
b. Definitions, Acronyms and Abbreviations ............................................................. 4
c. Business Case for the Product................................................................................. 4
2. Design and Implementation ........................................................................................ 5
2.1.
What Zimbra is? And why we used Zimbra? ..................................................... 5
2.2.
System Architecture ............................................................................................ 5
Rule Component ......................................................................................................... 6
Database Component .................................................................................................. 6
UI component and client/server architecture .............................................................. 6
2.3.
Technologies Used .............................................................................................. 8
2.4.
Implementation Issues ........................................................................................ 9
3. Evaluation of Solution ................................................................................................ 9
3.1.
Solution to the problem....................................................................................... 9
3.2.
Design of solution and future enhancement........................................................ 9
3.3.
Lessons learned ................................................................................................. 10
4. Conclusions ............................................................................................................... 10
5. References ................................................................................................................. 11
6. Appendices ................................................................................................................ 11
6.1.
Appendix A – Major tasks and Team members’ contributions ........................ 11
6.2
Appendix B – User Interface ............................................................................ 12
6.2.1. Login page ...................................................................................................... 12
6.2.2. Appointment detail.......................................................................................... 12
6.2.3. Calendar page (work week view) ................................................................... 13
6.2.4. Calendar page (month view) ........................................................................... 13
6.2.5. Contact list page .............................................................................................. 14
6.2.6. Option page ..................................................................................................... 14
6.2.7. Response a meeting request page ................................................................... 14
6.2.8. Schedule page ................................................................................................. 15
6.2.9. Mail page ........................................................................................................ 15
6.2.10. Find attendees page ....................................................................................... 15
6.2.
Appendix C – Rule files.................................................................................... 16
6.3.
Appendix D – Database Relation Schema Diagram ......................................... 18
 Copyright 2007 University of Houston Clear Lake
Page 3 of 19
1.
Introduction
a. Scope
The scope of this project applies to developing from a prototype for Rule Based
Scheduling Communications System. This is developed by Capstone Project
Group #7 – spring 2007 of the University of Houston, Clear Lake. The
functionality that the system will deliver is provide a modern, innovative,
interactive user interface and add more rules to the existing set of rules that are
time and business driven.
b. Definitions, Acronyms and Abbreviations
Convener: A convener is an employee/individual who initiates the meeting or
conference call and is responsible for providing the specifics of the conference
call.
Participant: A participant is a person who is basically an invitee, or is invited to
attend a particular conference. He may specify his own preferences, in terms of
date or time, in attending the meeting.
EVI (Enterprise Voice Integration): EVI is a voice oriented Process
Management Environment that captures the operational details of any
communication process and automates all of its steps and logic.
JBoss Rules: This is the Rule Based Inference engine that we will be employing
in order to manage the communication process rules.
c. Business Case for the Product
The RoboComm product is currently being developed for Atlink Communications
Inc. in order to demonstrate the usefulness of a Rule Based Inference engine in
solving a schedule based problem. Upon successful completion of the Scheduling
System, Atlink will utilize this utilize this prototype in order to develop a full
fledged product for use by the company in its local office. The next step would
involve integrating it with their existing EVI system.
 Copyright 2007 University of Houston Clear Lake
Page 4 of 19
2.
2.1.
Design and Implementation
What Zimbra is? And why we used Zimbra?
What Zimbra is. Zimbra is open source server and client software for messaging and
collaboration - email, group calendaring, contacts, and web document management and
authoring. The Zimbra server is available for Linux, Mac OS X, appliances, and
virtualization platforms. The Zimbra Web 2.0 Ajax client runs on Firefox, Safari, and IE,
and features easy integration/mash-ups of web portals, business applications, and VoIP
using web services.
In this project we tried to install Zimbra in Microsoft Windows XP, SP 2. Since Zimbra
did not provide enough information for installation in Windows environment, it took us a
lot of time to install Zimbra in Windows environment. For more information about how
to install Zimbra in Windows environment, please reference to our website:
http://dcm.cl.uh.edu/caps7g7/install.htm
For more details about Zimbra, reference to Zimbra website at www.zimbra.com
AJAX Sine using AJAX is a must for our project; we have to do a lot of research about
AJAX to figure out which is the best AJAX library for us to develop the system. AJAX
increases the web page’s interactivity, speed and usability. AJAX, shorthand for
“Asynchronous JavaScript and XML”, is a web development technique for creating
interactive web applications. The intent is to make web pages feel more responsive by
exchanging small amounts of data with the server behind the scenes, so that the entire
web page does not have to be reloaded each time the user requests a change.
Why Zimbra? We tried a lot of AJAX component from Google, Yahoo… However, we
finally choose Zimbra as main AJAX Library to develop our system. Besides the basic
AJAX components compared to Google, Yahoos’ components, Zimbra provides some
more advanced components such as Calendar component. Based on these components,
we successfully developed the Rules Based Scheduling System with a friendly UI like
Microsoft Outlook.
2.2.
System Architecture
 Copyright 2007 University of Houston Clear Lake
Page 5 of 19
Our system is a three tier web application based on Zimbra open source system.
RoboComm has four main components: Rules component, Database component, UI
component and EVI component (optional requirement).
Rule Component
RoboRules is the basic application that loads in all the rules required from the Rules DRL
File. This application loads the rules that have been specified by the RoboApp program.
The inputs are the conference id and the list of rules. It then fetches information with
regards to that particular conference and creates facts out of them. These facts are then
asserted to the Rules Engine and are processed using the loaded rules. Rules Engine
comes out with a solution set.
In our system, besides rules implemented by last semester team, we will implement two
more complex rules below
• Rule 1: Initiator may define the how many percents of attendance for the meeting to be
held even though the initiator defines mandatory or optional attendance or not.
• Rule 2: Check if the time of the conference falls during a week end or after 8 PM of the
local time of the conference participant. This rule should be checked before the rule
meeting is submitted to the system and provide feedback to the conference initiator
immediately.
Database Component
We use MySQL and OpenLDAP as database server; it captures and stores information
about the conveners, participants and the conference. It also stores the information about
the resultant probable schedules which are facts generated by the rule based inference
engine.
UI component and client/server architecture
Most of UI components which we used are AJAX components. We use Zimbra’s Ajax
library so called Kabuki to develop GUI.
 Copyright 2007 University of Houston Clear Lake
Page 6 of 19
Disk Layout
The mailbox server includes the following volumes:
-Message Store. Mail message files are in opt/zimbra/store
-Data Store. The MySQL Database files are in opt/zimbra/db
-Index Store. Index files are in opt/zimbra/index
-Backup Area. Full and incremental backups are in opt/zimbra/backup
Message Store
The Zimbra Message Store is where all email messages reside; including the message
body and any file attachments. Messages are stored in MIME format.
Data Store
The Zimbra Data Store is a MySQL database that contains all the metadata regarding the
messages including tags, conversations, and pointers to where the messages are stored in
the file system.
Each account (mailbox) resides only on one server. Each Zimbra server has its own
standalone data store containing data for the mailboxes on that server.
 Copyright 2007 University of Houston Clear Lake
Page 7 of 19
The Data Store contains:
Mailbox-account mapping. The primary identifier within the Zimbra database is the
mailbox ID, rather than a user name or account name. The mailbox ID is only unique
within a single mailbox server. The Data Store maps the Zimbra mailbox IDs to the
users’ OpenLDAP accounts.
Each user’s set of tag definitions, folders, and contacts, calendar appointments, filter
rules.
Information about each mail message, including whether it is read or unread, and which
tags are associated.
Index Store
The index and search technology is provided through Apache Lucene. Each message is
automatically indexed as it enters the system. Each mailbox has an index file associated
with it.
Backup
For the Network Edition, Zimbra includes a configurable backup manager that resides on
every Zimbra server and performs both backup and restore functions. You do not have to
stop the Zimbra server in order to run the backup process. The backup manager can be
used to restore a single user, rather than having to restore the entire system in the event
that one user’s mailbox becomes corrupted.
2.3.
Technologies Used
In this project, we use Java to develop three tier web applications, MySQL and
OpenLDAP as database server, JBoss Rules 3.0 as rule engines and AJAX components to
create the UI.
 Copyright 2007 University of Houston Clear Lake
Page 8 of 19
2.4.
Implementation Issues
We faced many difficulties when starting to develop the RoboComm system based on the
Zimbra open source. First, since Zimbra is a huge project, we must spend much time to
totally understand the system before building a new system upon the Zimbra open source.
Second, since Zimbra provided document is not clear enough and sometimes confused its
readers, it is very hard for us to choose a right way to build our application based on
Zimbra framework. Third, because Zimbra primarily develop for UNIX environment, it is
very hard to install Zimbra in Windows environment. Actually, it took us a few weeks
just to install it in Windows environment. Last but not least, JBoss Rules is new to us; we
must spend much time to do research, to apply JBoss Rules to our system.
3.
3.1.
Evaluation of Solution
Solution to the problem
Friendly UI: users will be interested and feel friendly at the first time using our
application! Most of our components based on Zimbra framework are AJAX components
which increase the web page's interactivity, speed, and usability.
JBoss Rules: since we use Rules to separate business policy or rules logic from process,
infrastructure and presentation logic, developer will develop, deploy, modify and manage
a business process’s rules with much greater ease and speed. In this application, we have
to write a lot of rules that check for a date of the conference on which there is a convener
and key participants whose percentage must reach a required minimum for the schedule
to successfully be scheduled for that date.
3.2.
Design of solution and future enhancement
We have divided our entire architecture into three different components namely: Rules
Component, Database Component and User Interface Component. This division makes it
very easy to maintain and enhance the code. It also enhances the flexibility in usage of
the system, enabling the developer to modify either of the components without affecting
the other.
 Copyright 2007 University of Houston Clear Lake
Page 9 of 19
Since the most advantage of our application is UI that is very friendly, I do not think we
need to change UI any more. The only thing we need to enhance our application is
applying more rules.
3.3.
Lessons learned
Importance of Research
Since AJAX, JBoss Rules and Zimbra framework are new to us; we must do a lot of
research to totally understand before starting to build our system. Although we do a lot of
research for the other subjects, after this course we know how to do a research effectively
against time constraint.
Time Management
Time management is another important lesson while working this project; we have to
manage how to complete a task in a limited time. We tried our best to make our
application better with more functions that are easy for users to use in a given time.
Team Work
We also understood the importance of team work. Working together as a team with
different people is very challenging and reaching a consensus might be tough in certain
situations.
Gained Valuable Experienced
After doing this project we have gained valuable knowledge and experience, we learnt a
lot of new technologies such as AJAX, JBoss Rules, etc. We also learnt how to manage
time constraint, how to effectively work with the other teammates.
4.
Conclusions
After developing this application we concluded that using a rule based approach to
solving the problem of scheduling a conference call is one of the best approaches. By
using a rule based approach, it is very easy to mange, change and access to business
policies. Although JBoss Rules is still transitioning and many features are still being
added, we are confident that in the future it will provide a complete set of features
necessary to make rule writing easier, more understandable and flexible. Zimbra
framework, open source software, provides a lot of useful components that we reused for
our application. And we developed a friendly UI, a useful application for users to
 Copyright 2007 University of Houston Clear Lake
Page 10 of 19
manage, schedule meetings. In conclusion we have successfully developed the prototype
that meets the requirements. We have captured most of the business logic in rules and
successfully developed the user interface using AJAX.
5.
References
The following references have been used in order to understand the underlying
technologies used in developing this prototype. These have not been used for our
documentation purposes.
[1] Dr. Yue, Guidelines for Final Reports,
http://dcm.cl.uh.edu/yue/courses/csci6838/Spring2007/FinalReport.html
[2] Zimbra open-source system, http://zimbra.com
[3] JBoss Rules 3.0, http://www.jboss.org
[4] Business Rules Engines, http://docs.codehaus.org/
[5] Google Web Toolkit, http://code.google.com/webtoolkit/
[6] Java, http://java.sun.com/j2se/1.5.0/docs/api
6.
Appendices
6.1.
Appendix A – Major tasks and Team members’ contributions
Task Assignments
Following are the major tasks of the project

Totally understanding the whole Zimbra system

Building Rules in JBoss

Developing User Interface based on Zimbra framework and the other Ajax
library.

Creating Database in MySQL

Integrating all the above three

Report and other Documentation which include UML Diagrams
Since the project is very difficult and complex, all the team members had to devote equal
time in learning all the new technologies that were used and have contributed equally to
all aspects of the project.
 Copyright 2007 University of Houston Clear Lake
Page 11 of 19
Show below are the various tasks performed in respective time limits. Finally it can be
seen that the project deadline has been attained successfully.
Team members’ contribution
Team Member
Thanh Doan – Team Leader
Task
JBoss Rules, Research Zimbra framework, System
analysis & design, Task Assignation
Dung Nguyen
JBoss Rules, Research Zimbra framework, System
analysis & design
Tuan Le
GUI design, Research Zimbra framework, System analysis
& design
Hung Tran
Database design, Documentation, Research Zimbra
framework
6.2
Appendix B – User Interface
6.2.1. Login page
6.2.2. Appointment detail
 Copyright 2007 University of Houston Clear Lake
Page 12 of 19
6.2.3. Calendar page (work week view)
Meeting is created at this page
6.2.4. Calendar page (month view)
 Copyright 2007 University of Houston Clear Lake
Page 13 of 19
6.2.5. Contact list page
6.2.6. Option page
6.2.7. Response a meeting request page
 Copyright 2007 University of Houston Clear Lake
Page 14 of 19
6.2.8. Schedule page
6.2.9. Mail page
6.2.10. Find attendees page
 Copyright 2007 University of Houston Clear Lake
Page 15 of 19
6.2.
Appendix C – Rule files
We just introduce several rule codes here (for more rules, please view rule files)
rule "If start meeting time is later than 8pm "
when
meetTime:ProposedMeetingTime(startTime:proposedStartTime, isvalid:valid)
eval( startTime.get(Calendar.HOUR_OF_DAY) > 21 )
then
System.out.println("===================================");
System.out.println("Fire Time Zone Rules " );
OutOfWorkHoursException ex = new OutOfWorkHoursException("propsed
meeting time is not OK");
System.out.println("===================================");
meetTime.setValid(0);
System.out.println("====set valid ==== 000000 =========");
System.out.println("===================================");
end
rule "If the number of accepted people is over percentage threadhold "
when
conf:Meeting(id:meetingID, acceptedNo:numOfAccepted,
invitedNo:numOfInvited, pctNo:pct)
eval( (acceptedNo.doubleValue() * 100)/invitedNo.doubleValue() >=
pctNo.doubleValue() )
then
System.out.println("===================================");
System.out.println("This meeting " + id + "is confirmed " );
System.out.println("===================================");
end
rule "If the number of accepted people is under percentage threadhold "
when
conf:Meeting(id:meetingID, acceptedNo:numOfAccepted,
invitedNo:numOfInvited, pctNo:pct)
eval( (acceptedNo.doubleValue() * 100)/invitedNo.doubleValue() <
pctNo.doubleValue() )
appt:Appointment()
mbox:Mailbox()
eval(appt!=null)
eval(mbox!=null)
then
appt.doCancel();
for (i=0;i<appt.getNumInvites();i++)
appt.sendCancelMsg(mbox,appt,appt.getInvites().getAttendess(i));
System.out.println("===================================");
System.out.println("This meeting " + id + "is cancelled " );
System.out.println("===================================");
End
 Copyright 2007 University of Houston Clear Lake
Page 16 of 19
// the class is used for inserting object into Working Memory and fire the Rules
public class DroolJob implements Job {
public DroolJob() {}
public void execute(JobExecutionContext context)
throws JobExecutionException {
String appt_id = context.getJobDetail().getJobDataMap().getString("appt_id");
try {
System.out.println("===================================");
System.out.println("DroolJob is executing " + appt_id);
System.out.println("===================================");
Connection conn = DbPool.getConnection();
PreparedStatement stmt = conn
.prepareStatement("SELECT * FROM Zimbra.meetings where appt_id = ? ");
stmt.setString(1, appt_id);
ResultSet rs = stmt.executeQuery();
Meeting conf = new Meeting();
if (rs.next()) {
conf.setMeetingID(appt_id);
conf.setDeadline(rs.getTimestamp("deadline"));
conf.setNumOfAccepted(new Double(rs.getInt("accepted")));
conf.setNumOfDeclined(new Double(rs.getInt("declined")));
conf.setNumOfInvited(new Double(rs.getInt("invited")));
conf.setPct(rs.getDouble("pct"));
conf.getPct().doubleValue();
}
conn.close();
PackageBuilderConfiguration pkgBuilderCfg = new
PackageBuilderConfiguration();
pkgBuilderCfg.setCompiler(PackageBuilderConfiguration.JANINO);
PackageBuilder builder = new PackageBuilder(pkgBuilderCfg);
builder.addPackageFromDrl(new InputStreamReader(DroolJob.class
.getResourceAsStream("/ScheduleRules.drl")));
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(builder.getPackage());
WorkingMemory workingMemory = ruleBase.newWorkingMemory();
workingMemory.assertObject(conf);
workingMemory.fireAllRules();
}
catch (Exception e1) {
e1.printStackTrace();
}
}
}
 Copyright 2007 University of Houston Clear Lake
Page 17 of 19
6.3.
Appendix D – Database Relation Schema Diagram
 Copyright 2007 University of Houston Clear Lake
Page 18 of 19
 Copyright 2007 University of Houston Clear Lake
Page 19 of 19
Download