Giter Club home page Giter Club logo

emergency-service-drools-app's Introduction

This application was built to show how to architect applications using BPM, a Rule Engine and Complex Event Processing. The aim of the application is to provide a generic architecture to implement flexible solution t hat uses the previous mentioned topics as basic principles.

The application is right now decoupled in 7 logical modules that are responsible for different activities. We tried to maintain as decoupled as possible each module to provide a flexible and pluggeable architecture. If you don't like the implementation of one of these modules, you can easily replace it for one that cover all your needs.

Each module is a functional block that allow the overall application to run and interact with different services. This allows you to customize each module configuration to run smoothly on your specific environment.
Main Modules Introduction

The following sections describe each module responsibility:

Project Modules


Model

This module contains your domain objects that represent the information that your application is interested to handle. This module now contains some extra utility classes and some WorkItemHandlers that will be used by the core module. I'm planning to create a separate module with these technical assets, but for now they can live there for practical reasons.
Core

The core module contains all the Domain Specific Services interfaces and implementations. This project can be expanded as a multi module pom project in the future for storing one single service per project, allowing more flexibility for deployments.

World UI

This module allows us to see what is happening in the real world. You need to think about this module as a view of our world that allows to generate interactions. For real implementations this module can be seen as external sources of events that will be directly plugged to the core module with external connectors

Task Lists UI

We currently have two different implementations of this module. This module represent the software that is being used inside the Emergency Services company. You will find in the project source code that a Standalone implementation and a Web Application provide the same functionality. Two more implementations are being created for demonstrating best practices and for mobile phones.
Running the Application

We first need to download the source code using git from: https://github.com/Salaboy/emergency-service-drools-app

Once you get the source code in your machine go inside the project structure and run:

mvn clean install

This will build all the modules and allow you to start playing with the application. If you get problems with maven dependencies you need to add a new certificate to your JDK to allow maven download snapshots from Plug Tree (org) repositories hosted in cloudbees.com. I strongly recommend you doing this to get always the latest version of our projects.

"Make sure that java trusts the PlugTree repository by adding it's public key to the cacerts file. To do that, follow these steps:

    Browse to https://repository-plugtree.forge.cloudbees.com/snapshot/
    Select "Tools->Page Info" from the menu.
    Select the "Security" icon and then click the "View Certificate" button.
    Select the "Details" tab.
    In the "Certificate Hierarchy" pane, select "*.forge.cloudbees.com" and then click the "Export..." button at the bottom of the dialog.
    Save the certificate in a file (I used "publickey.forge.cloudbees.com") and select the "X.509 Certificate (PEM)" format.
    Execute the following command (you may need to adjust the arguments for alias, keystore, and file based on your installation and where you saved the public key):

sudo keytool -import -alias mail.redhat.com -keystore /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/security/cacerts -file ~/publickey.forge.cloudbees.com

When prompted, the default keystore password is "changeit". " -> copied from the project wiki: https://github.com/Salaboy/emergency-service-drools-app/wiki/Fedora-14-install


The Run Module

We have developed a special module that facilitates running all the application modules. we are planing to create a graphical interface to start up all the modules but it is still work in progress. Right now you can start the application using maven and one terminal per module that you want to start up.

To start up the application there are are some dependency restrictions. We obviously need to start the application core before starting the UIs.
If we are planing to use an external event generator (sensor) we need to bind it before generating emergencies in the world UI application. If we are not planning to use external sensors we can go ahead without running the sensors module.

Let's run the following modules:
emergency-service-core, emergency-service-world-ui, emergency-service-tasklist-ui-web
For starting the application you should open three different terminals/consoles in your computer and have maven installed.

From the first terminal, standing inside the run/ module you need to run:
mvn -Pcore

Once core is started you can start world ui and task lists web ui.

From a different terminal you need to run: mvn -Pcitymap
From a different terminal you need to run: mvn -Ptasklists
From a different terminal you need to run: mvn -Pdashboard
From a different terminal you need to run: mvn -Psensors
Interacting with the application

Now that we have the main three modules running we can start interacting with the application. Let's create and emergency and let's try to solve it. The following video guides you through the Heart Attack Scenario.

Take a look at the following video that explains how to setup the application in your machine and run a simple use case:


Useful URLs

Git: http://git-scm.com/

Maven: http://maven.apache.org/download.html

Emergency Services Source Code: https://github.com/Salaboy/emergency-service-drools-app

To clone the source code (for having a local copy of the source code) run in your terminal: 

git clone git://github.com/Salaboy/emergency-service-drools-app.git

Task Lists UI - Web Implementation: http://localhost:8081/emergency-services/

emergency-service-drools-app's People

Contributors

esteban-aliverti avatar salaboy avatar technospino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emergency-service-drools-app's Issues

Heart Attack Issues (two)

Hi there again,

We are trying to complete the heart attack use case but it appears to be some issues here. (ruleML branch, first of all)

We are running:

  1. core, 2) world-ui, 3) tasks-list (swing) 4) dashboard-ui.

And this is the second test (result, no vital signs graph)

  1. Hit space in world ui
  2. Complete the operator task: heart attack, 1 person.
  3. Complete the control task: DefaultHeartAttackProcedure
  4. Complete the garage task: strokes vehicle
  5. Drive car to the emergency
  6. Complete doctor task: Severity 1
  7. Press q and w keys in the world ui.

Well, we can see the HeartBeat Messages in the live report, and also we can see the alerts (heart attack if you press fast and no signal if you stop).

But, we don't see any graph at dashboard-ui.

There is no errors in consoles (none of them).

Clean dependencies

The project is using Drools Flow and jBPM modules. The same modules but in different projects, e.g: drools-process-task and jbpm-human-task

Rename packages

Rename org.salaboy.wordpress to org.plugtree.drools.demo or something like that

Domain Entities Advanced Handling

Create a blue print to handle Domain entities transparently.
This will probably include Hibernate Shards, Hibernate Envers, and a new service that will be in charge of handling the mappings of the Domain entities and the view from these entities inside the processes and rules.

Error in Control Form

Testing Heart Attack in master branch:

When i try to access the control form, in web-ui, it returns an error.

HTTP ERROR 500

Problem accessing /emergency-services/task/co/control/Default/cf2fe2db-60e0-488d-ac74-833280cef9b8-@-2/SuggestedProcess-%3E0. Reason:

[Error: unresolvable property or identifier: patient]

[Near : {... patient.age ....}]
^
[Line: 1, Column: 1]

lwjgl-native not found

Hi,
When i run
mvn -Pword-ui in the run directory of the master branch,
i get this error :

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:
2.1:unpack (default-cli) on project emergency-service-run: Unable to find artifa
ct. Failure to find org.lwjgl:lwjgl-native:jar:win:2.6 in http://b2s-repo.google
code.com/svn/trunk/mvn-repo/ was cached in the local repository, resolution will
not be reattempted until the update interval of b2s-repo has elapsed or updates
are forced

HELP !

mvn install gives nullpointerexception

Exception in thread "Thread-0" java.lang.NullPointerException
at com.wordpress.salaboy.TaskServerDaemon.stopServer(TaskServerDaemon.java:72)
at com.wordpress.salaboy.MyDroolsUtilities$1.run(MyDroolsUtilities.java:90)

[INFO] ------------------------------------------------------------------------

create simulation button

A simple and random simulation module that create a new emergency, sends an ambulance, pick up the patient and put him in the hospital will be nice to show multi-emergency working!

Heart Attack Issues (one)

Hi there,

We are trying to complete the heart attack use case but it appears to be some issues here. (ruleML branch, first of all)

We are running:

  1. core, 2) world-ui, 3) tasks-list (swing) 4) dashboard-ui.

And this is the first test (result, no patient at hospital)

  1. Hit space in world ui
  2. Complete the operator task: heart attack, 1 person.
  3. Complete the control task: DefaultHeartAttackProcedure
  4. Complete the garage task: strokes vehicle
  5. Drive car to the emergency
  6. Complete doctor task: Severity 1
  7. Drive to the selected hospital

And when the vehicle reachs the hospital...

  1. The core shows a report in console. No errors
  2. The hospital in the world-UI stops lighting
  3. There is no tasks in the taskslist-ui
  4. In the dashboard. We see the message (hospital reached) in the live report. But we don't see the hospital status.

In the dashboard console there are some errors:

Exception in thread "Thread-6" java.lang.NullPointerException
at com.wordpress.salaboy.messaging.MessageConsumer.receiveMessage(MessageConsumer.java:61)
at com.wordpress.salaboy.messaging.MessageConsumerWorker.run(MessageConsumerWorker.java:39)

And so on (different threads).

The same result If you try with taskslist-ui-web instead of the swing app.

World-UI Error

The worl-ui app needs alert-ROBBERY.png or it crashes

Thu Sep 22 16:08:38 CEST 2011 ERROR:Resource not found: data/sprites/alert-ROBBERY.png
java.lang.RuntimeException: Resource not found: data/sprites/alert-ROBBERY.png
at org.newdawn.slick.util.ResourceLoader.getResourceAsStream(ResourceLoader.java:69)
at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:169)
at org.newdawn.slick.Image.(Image.java:196)
at org.newdawn.slick.SpriteSheet.(SpriteSheet.java:129)
at org.newdawn.slick.SpriteSheet.(SpriteSheet.java:115)
at com.wordpress.salaboy.emergencyservice.worldui.slick.graphicable.AnimationFactory.getEmergencySpriteSheet(AnimationFa
at com.wordpress.salaboy.emergencyservice.worldui.slick.graphicable.AnimationFactory.getEmergencyAnimation(AnimationFact
at com.wordpress.salaboy.emergencyservice.worldui.slick.WorldUI$1$1.execute(WorldUI.java:150)
at com.wordpress.salaboy.emergencyservice.worldui.slick.WorldUI.render(WorldUI.java:100)
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:681)
at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:408)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:318)
at com.wordpress.salaboy.emergencyservice.worldui.slick.WorldUI.main(WorldUI.java:124)
Thu Sep 22 16:08:38 CEST 2011 ERROR:Game.render() failure - check the game code.
org.newdawn.slick.SlickException: Game.render() failure - check the game code.
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:684)
at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:408)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:318)
at com.wordpress.salaboy.emergencyservice.worldui.slick.WorldUI.main(WorldUI.java:124)

Create Admin Project for Entities

Create administration project for entering and configure the Application Entities like:
Hospital, Doctors, Vehicles, Emergency Types, Medical Kits, Repository Management (Guvnor), etc

build failed on IncomingCallsMGMTServiceTest.doGarageTask

mvn clean install on emergency-service-drools-app under windows/java 1.6.0_27 :

genericEmergencyProcedureTest(com.wordpress.salaboy.grid.IncomingCallsMGMTServiceTest) Time elapsed: 20.234 sec <<< FAILURE!
java.lang.AssertionError: expected:<1> but was:<0>
at org.junit.Assert.fail(Assert.java:91)
at org.junit.Assert.failNotEquals(Assert.java:645)
at org.junit.Assert.assertEquals(Assert.java:126)
at org.junit.Assert.assertEquals(Assert.java:470)
at org.junit.Assert.assertEquals(Assert.java:454)
at com.wordpress.salaboy.grid.IncomingCallsMGMTServiceTest.doGarageTask(IncomingCallsMGMTServiceTest.java:280)

Any idea to resolve ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.