salaboy / emergency-service-drools-app Goto Github PK
View Code? Open in Web Editor NEWEmergency Service Drools Application
Home Page: http://salaboy.wordpress.com
Emergency Service Drools Application
Home Page: http://salaboy.wordpress.com
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/
for testing and distribution we need to use H2
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:
And this is the second test (result, no vital signs graph)
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).
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
Currently, only one emergency is supported.
We need to add support for multiple and concurrent emergencies.
Rename org.salaboy.wordpress to org.plugtree.drools.demo or something like that
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.
Decouple the Live Dashboard in a separate component
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]
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 !
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] ------------------------------------------------------------------------
parent pom is missing. please add one!
Volunteers?
Classes matching *EventNotifier should be renamed to *EventListener and the method notify() should be execute()
Please correct the snakeyaml version in the ruleML branch :
1.9
instead of 1.9-SNAPSHOT
thks
Current configuration is 1.5 and it only compiles using 1.6
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!
Branch: master
Please, remove line 273 in pom.xml (run), otherwise it won't start.
Thanks.
Search into the code for 'Medic' and replace it with 'Doctor'
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:
And this is the first test (result, no patient at hospital)
And when the vehicle reachs the hospital...
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.
Split the app in two modules one for the User Task Lists and the other for the city Map
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 administration project for entering and configure the Application Entities like:
Hospital, Doctors, Vehicles, Emergency Types, Medical Kits, Repository Management (Guvnor), etc
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 ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.