Permalink
Browse files

DialogueHelper:

	- Implemented invokeQueryRef()
  • Loading branch information...
1 parent 837b3af commit 9f149f69f6eafb1c1b6fd125a88b80b34e50a46e @esteban-aliverti esteban-aliverti committed Aug 20, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 drools-mas-generic-client/src/main/java/org/drools/mas/helpers/DialogueHelper.java
View
17 drools-mas-generic-client/src/main/java/org/drools/mas/helpers/DialogueHelper.java
@@ -21,6 +21,7 @@
import org.drools.mas.body.acts.Inform;
import org.drools.mas.body.acts.InformIf;
import org.drools.mas.body.content.Action;
+import org.drools.mas.body.content.Query;
import org.drools.mas.util.ACLMessageFactory;
import org.drools.mas.util.MessageContentEncoder;
import org.drools.mas.util.MessageContentFactory;
@@ -215,6 +216,22 @@ protected String doQueryIf(String sender, String receiver, Object proposition, D
return qryif.getId();
}
+
+
+ public String invokeQueryRef(String sender, String receiver, Query query, DialogueHelperCallback callback) {
+ return this.doQueryRef(sender, receiver, query, callback);
+ }
+
+ protected String doQueryRef(String sender, String receiver, Query query, DialogueHelperCallback callback) {
+
+ ACLMessageFactory factory = new ACLMessageFactory(Encodings.XML);
+ ACLMessage qryRef = factory.newQueryRefMessage(sender, receiver, query);
+
+ this.tell(qryRef, callback, callback != null);
+
+ return qryRef.getId();
+
+ }
public String invokeInform(String sender, String receiver, Object proposition, DialogueHelperCallback callback) {
return this.doInform(sender, receiver, proposition, callback);

0 comments on commit 9f149f6

Please sign in to comment.