Commit fae0497c249fd6993773505328727bceaf99ac4a
1 parent
05449498
Neue Rasa-Entities eingebaut.
Showing
10 changed files
with
21 additions
and
12 deletions
BeuthBot.ipr
@@ -691,7 +691,6 @@ | @@ -691,7 +691,6 @@ | ||
691 | <option value="$PROJECT_DIR$/services/Common" /> | 691 | <option value="$PROJECT_DIR$/services/Common" /> |
692 | <option value="$PROJECT_DIR$/services/FaceBook" /> | 692 | <option value="$PROJECT_DIR$/services/FaceBook" /> |
693 | <option value="$PROJECT_DIR$/services/Global" /> | 693 | <option value="$PROJECT_DIR$/services/Global" /> |
694 | - <option value="$PROJECT_DIR$/services/JSONRequester" /> | ||
695 | <option value="$PROJECT_DIR$/services/LoggingStatistics" /> | 694 | <option value="$PROJECT_DIR$/services/LoggingStatistics" /> |
696 | <option value="$PROJECT_DIR$/services/MainBot" /> | 695 | <option value="$PROJECT_DIR$/services/MainBot" /> |
697 | <option value="$PROJECT_DIR$/services/Rasa" /> | 696 | <option value="$PROJECT_DIR$/services/Rasa" /> |
@@ -856,9 +855,6 @@ | @@ -856,9 +855,6 @@ | ||
856 | <module fileurl="file://$PROJECT_DIR$/services/Global/Global.iml" filepath="$PROJECT_DIR$/services/Global/Global.iml" group="services/Global" /> | 855 | <module fileurl="file://$PROJECT_DIR$/services/Global/Global.iml" filepath="$PROJECT_DIR$/services/Global/Global.iml" group="services/Global" /> |
857 | <module fileurl="file://$PROJECT_DIR$/services/Global/Global_main.iml" filepath="$PROJECT_DIR$/services/Global/Global_main.iml" group="services/Global" /> | 856 | <module fileurl="file://$PROJECT_DIR$/services/Global/Global_main.iml" filepath="$PROJECT_DIR$/services/Global/Global_main.iml" group="services/Global" /> |
858 | <module fileurl="file://$PROJECT_DIR$/services/Global/Global_test.iml" filepath="$PROJECT_DIR$/services/Global/Global_test.iml" group="services/Global" /> | 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 | <module fileurl="file://$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics.iml" filepath="$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics.iml" group="services/LoggingStatistics" /> | 858 | <module fileurl="file://$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics.iml" filepath="$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics.iml" group="services/LoggingStatistics" /> |
863 | <module fileurl="file://$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics_main.iml" filepath="$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics_main.iml" group="services/LoggingStatistics" /> | 859 | <module fileurl="file://$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics_main.iml" filepath="$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics_main.iml" group="services/LoggingStatistics" /> |
864 | <module fileurl="file://$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics_test.iml" filepath="$PROJECT_DIR$/services/LoggingStatistics/LoggingStatistics_test.iml" group="services/LoggingStatistics" /> | 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,8 +66,8 @@ | ||
66 | <orderEntry type="library" name="Gradle: org.jboss.shrinkwrap:shrinkwrap-api:1.2.6" level="project" /> | 66 | <orderEntry type="library" name="Gradle: org.jboss.shrinkwrap:shrinkwrap-api:1.2.6" level="project" /> |
67 | <orderEntry type="library" scope="RUNTIME" name="Gradle: org.wildfly.arquillian:wildfly-arquillian-common:2.0.2.Final" level="project" /> | 67 | <orderEntry type="library" scope="RUNTIME" name="Gradle: org.wildfly.arquillian:wildfly-arquillian-common:2.0.2.Final" level="project" /> |
68 | <orderEntry type="library" name="Gradle: org.jboss.arquillian.container:arquillian-container-spi:1.1.13.Final" level="project" /> | 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 | <orderEntry type="library" name="Gradle: org.jboss.arquillian.config:arquillian-config-api:1.1.13.Final" level="project" /> | 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 | <orderEntry type="library" scope="RUNTIME" name="Gradle: org.jboss.marshalling:jboss-marshalling-river:1.4.10.Final" level="project" /> | 71 | <orderEntry type="library" scope="RUNTIME" name="Gradle: org.jboss.marshalling:jboss-marshalling-river:1.4.10.Final" level="project" /> |
72 | <orderEntry type="library" name="Gradle: org.jboss.arquillian.config:arquillian-config-impl-base:1.1.13.Final" level="project" /> | 72 | <orderEntry type="library" name="Gradle: org.jboss.arquillian.config:arquillian-config-impl-base:1.1.13.Final" level="project" /> |
73 | <orderEntry type="library" name="Gradle: org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-spi:2.0.0-alpha-10" level="project" /> | 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,6 +72,7 @@ public class DroolsService implements MessageListener { | ||
72 | @Override | 72 | @Override |
73 | public void onMessage(Message message) { | 73 | public void onMessage(Message message) { |
74 | try { | 74 | try { |
75 | + logger.debug("Drools has received message"); | ||
75 | ProcessQueueMessageProtocol botMessage = message.getBody(TaskMessage.class); | 76 | ProcessQueueMessageProtocol botMessage = message.getBody(TaskMessage.class); |
76 | 77 | ||
77 | DroolsMessage droolsMessage = doRules(botMessage); | 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,6 +50,10 @@ public class SchedulerBean { | ||
50 | 50 | ||
51 | boolean isActive = false; | 51 | boolean isActive = false; |
52 | 52 | ||
53 | + public SchedulerBean() { | ||
54 | + | ||
55 | + } | ||
56 | + | ||
53 | //CONSTRUCTOR | 57 | //CONSTRUCTOR |
54 | @PostConstruct | 58 | @PostConstruct |
55 | public void init(){ | 59 | public void init(){ |
@@ -82,10 +86,12 @@ public class SchedulerBean { | @@ -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 | //TODO: Insert the new Reminder into Database | 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,10 +25,14 @@ import java.time.LocalDate; | ||
25 | 25 | ||
26 | import de.bht.beuthbot.canteen.model.Dish | 26 | import de.bht.beuthbot.canteen.model.Dish |
27 | import de.bht.beuthbot.canteen.model.DishType; | 27 | import de.bht.beuthbot.canteen.model.DishType; |
28 | +import de.bht.beuthbot.canteen.model.CanteenData; | ||
28 | import de.bht.beuthbot.model.Intent; | 29 | import de.bht.beuthbot.model.Intent; |
29 | import de.bht.beuthbot.model.EntityName; | 30 | import de.bht.beuthbot.model.EntityName; |
30 | import de.bht.beuthbot.drools.model.DroolsMessage; | 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 | global de.bht.beuthbot.canteen.model.CanteenData canteenData; | 36 | global de.bht.beuthbot.canteen.model.CanteenData canteenData; |
33 | 37 | ||
34 | // ---------------------- GREETING ------------------------------------ | 38 | // ---------------------- GREETING ------------------------------------ |
@@ -106,17 +110,19 @@ rule "Show price" | @@ -106,17 +110,19 @@ rule "Show price" | ||
106 | end | 110 | end |
107 | 111 | ||
108 | // ---------------------------- CREATE REMINDER ----------------------------- | 112 | // ---------------------------- CREATE REMINDER ----------------------------- |
109 | -/* | 113 | + |
110 | rule "Create reminder" | 114 | rule "Create reminder" |
111 | dialect "java" | 115 | dialect "java" |
112 | when | 116 | when |
113 | m : DroolsMessage(getIntent().equals(Intent.CREATE_REMINDER.getText())) | 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 | end | 123 | end |
118 | 124 | ||
119 | -*/ | 125 | + |
120 | // --------------------------- Fallback ------------------------- | 126 | // --------------------------- Fallback ------------------------- |
121 | rule "Fallback" | 127 | rule "Fallback" |
122 | dialect "java" | 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,6 +69,7 @@ public class RasaConnector implements MessageListener { | ||
69 | public void onMessage(final Message message) { | 69 | public void onMessage(final Message message) { |
70 | 70 | ||
71 | try { | 71 | try { |
72 | + logger.debug("Rasa has received message"); | ||
72 | ProcessQueueMessageProtocol incomingChatMessage = message.getBody(TaskMessage.class); | 73 | ProcessQueueMessageProtocol incomingChatMessage = message.getBody(TaskMessage.class); |
73 | String messageText = incomingChatMessage.getText(); | 74 | String messageText = incomingChatMessage.getText(); |
74 | 75 |
settings.gradle
@@ -8,7 +8,6 @@ include ( | @@ -8,7 +8,6 @@ include ( | ||
8 | 'services:MainBot', | 8 | 'services:MainBot', |
9 | 'services:LoggingStatistics', | 9 | 'services:LoggingStatistics', |
10 | 'services:Telegram', | 10 | 'services:Telegram', |
11 | - 'services:Scheduler', | ||
12 | - 'services:JSONRequestService' | 11 | + 'services:Scheduler' |
13 | ) | 12 | ) |
14 | 13 |