Commit fae0497c249fd6993773505328727bceaf99ac4a

Authored by mfcb
1 parent 05449498

Neue Rasa-Entities eingebaut.

BeuthBot.ipr
... ... @@ -691,7 +691,6 @@
691 691 <option value="$PROJECT_DIR$/services/Common" />
692 692 <option value="$PROJECT_DIR$/services/FaceBook" />
693 693 <option value="$PROJECT_DIR$/services/Global" />
694   - <option value="$PROJECT_DIR$/services/JSONRequester" />
695 694 <option value="$PROJECT_DIR$/services/LoggingStatistics" />
696 695 <option value="$PROJECT_DIR$/services/MainBot" />
697 696 <option value="$PROJECT_DIR$/services/Rasa" />
... ... @@ -856,9 +855,6 @@
856 855 <module fileurl="file://$PROJECT_DIR$/services/Global/Global.iml" filepath="$PROJECT_DIR$/services/Global/Global.iml" group="services/Global" />
857 856 <module fileurl="file://$PROJECT_DIR$/services/Global/Global_main.iml" filepath="$PROJECT_DIR$/services/Global/Global_main.iml" group="services/Global" />
858 857 <module fileurl="file://$PROJECT_DIR$/services/Global/Global_test.iml" filepath="$PROJECT_DIR$/services/Global/Global_test.iml" group="services/Global" />
859   - <module fileurl="file://$PROJECT_DIR$/services/JSONRequester/JSONRequester.iml" filepath="$PROJECT_DIR$/services/JSONRequester/JSONRequester.iml" group="services/JSONRequester" />
860   - <module fileurl="file://$PROJECT_DIR$/services/JSONRequester/JSONRequester_main.iml" filepath="$PROJECT_DIR$/services/JSONRequester/JSONRequester_main.iml" group="services/JSONRequester" />
861   - <module fileurl="file://$PROJECT_DIR$/services/JSONRequester/JSONRequester_test.iml" filepath="$PROJECT_DIR$/services/JSONRequester/JSONRequester_test.iml" group="services/JSONRequester" />
862 858 <module fileurl="file://$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics.iml" filepath="$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics.iml" group="services/LoggingStatistics" />
863 859 <module fileurl="file://$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics_main.iml" filepath="$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics_main.iml" group="services/LoggingStatistics" />
864 860 <module fileurl="file://$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics_test.iml" filepath="$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics_test.iml" group="services/LoggingStatistics" />
... ...
services/Global/Global_test.iml
... ... @@ -66,8 +66,8 @@
66 66 <orderEntry type="library" name="Gradle: org.jboss.shrinkwrap:shrinkwrap-api:1.2.6" level="project" />
67 67 <orderEntry type="library" scope="RUNTIME" name="Gradle: org.wildfly.arquillian:wildfly-arquillian-common:2.0.2.Final" level="project" />
68 68 <orderEntry type="library" name="Gradle: org.jboss.arquillian.container:arquillian-container-spi:1.1.13.Final" level="project" />
69   - <orderEntry type="library" scope="RUNTIME" name="Gradle: org.wildfly.arquillian:wildfly-arquillian-protocol-jmx:2.0.2.Final" level="project" />
70 69 <orderEntry type="library" name="Gradle: org.jboss.arquillian.config:arquillian-config-api:1.1.13.Final" level="project" />
  70 + <orderEntry type="library" scope="RUNTIME" name="Gradle: org.wildfly.arquillian:wildfly-arquillian-protocol-jmx:2.0.2.Final" level="project" />
71 71 <orderEntry type="library" scope="RUNTIME" name="Gradle: org.jboss.marshalling:jboss-marshalling-river:1.4.10.Final" level="project" />
72 72 <orderEntry type="library" name="Gradle: org.jboss.arquillian.config:arquillian-config-impl-base:1.1.13.Final" level="project" />
73 73 <orderEntry type="library" name="Gradle: org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-spi:2.0.0-alpha-10" level="project" />
... ...
services/MainBot/src/main/java/de/bht/beuthbot/drools/DroolsService.java
... ... @@ -72,6 +72,7 @@ public class DroolsService implements MessageListener {
72 72 @Override
73 73 public void onMessage(Message message) {
74 74 try {
  75 + logger.debug("Drools has received message");
75 76 ProcessQueueMessageProtocol botMessage = message.getBody(TaskMessage.class);
76 77  
77 78 DroolsMessage droolsMessage = doRules(botMessage);
... ...
services/Scheduler/src/main/java/de/bht/beuthbot/scheduler/JAXActivator.java renamed to services/MainBot/src/main/java/de/bht/beuthbot/scheduler/JAXActivator.java
services/Scheduler/src/main/java/de/bht/beuthbot/scheduler/SchedulerBean.java renamed to services/MainBot/src/main/java/de/bht/beuthbot/scheduler/SchedulerBean.java
... ... @@ -50,6 +50,10 @@ public class SchedulerBean {
50 50  
51 51 boolean isActive = false;
52 52  
  53 + public SchedulerBean() {
  54 +
  55 + }
  56 +
53 57 //CONSTRUCTOR
54 58 @PostConstruct
55 59 public void init(){
... ... @@ -82,10 +86,12 @@ public class SchedulerBean {
82 86  
83 87 }
84 88  
85   - public void createReminder(Long userID, ReminderCycle reminderCycle, Date cycleDate) {
86   - Reminder newReminder = new Reminder(userID, reminderCycle, cycleDate);
  89 + public boolean createReminder(TaskMessage message) {
  90 + //Reminder newReminder = new Reminder(message.getSenderID()); //, reminderCycle, cycleDate);
87 91 //TODO: Insert the new Reminder into Database
88 92  
  93 + return true;
  94 +
89 95 }
90 96  
91 97 }
... ...
services/Scheduler/src/main/java/de/bht/beuthbot/scheduler/model/Reminder.java renamed to services/MainBot/src/main/java/de/bht/beuthbot/scheduler/model/Reminder.java
services/Scheduler/src/main/java/de/bht/beuthbot/scheduler/model/ReminderCycle.java renamed to services/MainBot/src/main/java/de/bht/beuthbot/scheduler/model/ReminderCycle.java
services/MainBot/src/main/resources/de/bht/beuthbot/drools/Canteen.drl
... ... @@ -25,10 +25,14 @@ import java.time.LocalDate;
25 25  
26 26 import de.bht.beuthbot.canteen.model.Dish
27 27 import de.bht.beuthbot.canteen.model.DishType;
  28 +import de.bht.beuthbot.canteen.model.CanteenData;
28 29 import de.bht.beuthbot.model.Intent;
29 30 import de.bht.beuthbot.model.EntityName;
30 31 import de.bht.beuthbot.drools.model.DroolsMessage;
31 32  
  33 +import de.bht.beuthbot.scheduler.SchedulerBean
  34 +import de.bht.beuthbot.jms.TaskMessage;
  35 +
32 36 global de.bht.beuthbot.canteen.model.CanteenData canteenData;
33 37  
34 38 // ---------------------- GREETING ------------------------------------
... ... @@ -106,17 +110,19 @@ rule &quot;Show price&quot;
106 110 end
107 111  
108 112 // ---------------------------- CREATE REMINDER -----------------------------
109   -/*
  113 +
110 114 rule "Create reminder"
111 115 dialect "java"
112 116 when
113 117 m : DroolsMessage(getIntent().equals(Intent.CREATE_REMINDER.getText()))
114   - then
115 118  
  119 + then
  120 + SchedulerBean s = new SchedulerBean();
  121 + if (s.createReminder(new TaskMessage(m)) == true) { m.setText("Ich werde dich erinnern!"); }
116 122  
117 123 end
118 124  
119   -*/
  125 +
120 126 // --------------------------- Fallback -------------------------
121 127 rule "Fallback"
122 128 dialect "java"
... ...
services/Rasa/src/main/java/de/bht/beuthbot/nlp/rasa/RasaConnector.java
... ... @@ -69,6 +69,7 @@ public class RasaConnector implements MessageListener {
69 69 public void onMessage(final Message message) {
70 70  
71 71 try {
  72 + logger.debug("Rasa has received message");
72 73 ProcessQueueMessageProtocol incomingChatMessage = message.getBody(TaskMessage.class);
73 74 String messageText = incomingChatMessage.getText();
74 75  
... ...
settings.gradle
... ... @@ -8,7 +8,6 @@ include (
8 8 'services:MainBot',
9 9 'services:LoggingStatistics',
10 10 'services:Telegram',
11   - 'services:Scheduler',
12   - 'services:JSONRequestService'
  11 + 'services:Scheduler'
13 12 )
14 13  
... ...