[rules-users] Rule Flow Creation
I am trying to create a rule flow. I have installed the JBoss Drools 6.0 Core IDE component installed. When I try to create a rule flow, it gives the option of a “Flow File” but what is created is a .bpmn file, not a .rf file. Also the options are totally different from the screen shots in the Drools reference manual. Any tips are appreciated. Ray P.S. - I am also wondering whether Intellij has better support. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Using both Drop Down(Enumeration) and Text Field for a field in guvnor
Michael, It looks promising. The question is whether I can have something like a select that has a text and a value that returned. For example the value RxNorm=617314 is actually “Atorvastain or Lipitor”. If this was a typically select box, we could populate both the text (e.g., "Atorvastain or Lipitor”) and the value to be returned (e.g., 617314). The resulting rule would only have the code. Ray On Jan 11, 2014, at 3:54 PM, Michael Anstis wrote: > 1) No, you can't have ab enumeration defined and expect to have a text box to > enter a value. > > 2) You can define an enumeration that look up their values from elsewhere. > Please see the Advanced Enum Concepts section in the user guide. > > Sent on the move > > On 11 Jan 2014 15:22, "Ray Hooker" wrote: > This ties into a question, I had as well. I am trying to setup an > environment to author rules that have codes associates within them. This is > in the medical field where it would be nice to do a look-up. If it possible > to extend the interface, possibly in the guided rule development to allow the > user to select from a popup list?? It would be nice to use Guvnor rather > than having to write a custom set of screens. > > > Ray > On Jan 11, 2014, at 9:04 AM, abhinay_agarwal > wrote: > > > Heya, > > > > Is it possible to use both drop downs and text field for the same field in > > guvnor. For what I see now, is once I have made an enumeration for a field > > of a fact, I am bound to choose values from the drop down, which makes it > > difficult to use functionality of matches and using *. in guvnor. > > > > Regards, > > Abhinay > > > > > > > > -- > > View this message in context: > > http://drools.46999.n3.nabble.com/Using-both-Drop-Down-Enumeration-and-Text-Field-for-a-field-in-guvnor-tp4027656.html > > Sent from the Drools: User forum mailing list archive at Nabble.com. > > ___ > > rules-users mailing list > > rules-users@lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/rules-users > > > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Using both Drop Down(Enumeration) and Text Field for a field in guvnor
This ties into a question, I had as well. I am trying to setup an environment to author rules that have codes associates within them. This is in the medical field where it would be nice to do a look-up. If it possible to extend the interface, possibly in the guided rule development to allow the user to select from a popup list?? It would be nice to use Guvnor rather than having to write a custom set of screens. Ray On Jan 11, 2014, at 9:04 AM, abhinay_agarwal wrote: > Heya, > > Is it possible to use both drop downs and text field for the same field in > guvnor. For what I see now, is once I have made an enumeration for a field > of a fact, I am bound to choose values from the drop down, which makes it > difficult to use functionality of matches and using *. in guvnor. > > Regards, > Abhinay > > > > -- > View this message in context: > http://drools.46999.n3.nabble.com/Using-both-Drop-Down-Enumeration-and-Text-Field-for-a-field-in-guvnor-tp4027656.html > Sent from the Drools: User forum mailing list archive at Nabble.com. > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Facts - One to Many
Wolfgang, Thanks. That works nicely. I do have a followup question. I wrote the following query: rule "Find patient taking Atorvastin (Lipitor)" dialect "mvel" when $p: PatientRecord($meds: medications) MedicationRecord(getCode("RxNorm").contains("617314")) from $meds then System.out.println("Found a patient taking Lipitor: "+$p.medical_record_number); results.addResult(new Result("test",$p.medical_record_number,"Found Patient Taking Lipitor","now")); end The problem is that a patient record may have multiple times where this was prescribed. How would I change the query so that it does not repeat the find so that it is logically: “If the patient ever took Lipitor… or if there is any record of the patient taking Lipitor then flag then…” instead of flagging for each hit?? So it only flags a patient with at least one medication record indicating Lipitor… Thanks, Ray On Jan 2, 2014, at 12:36 PM, Wolfgang Laun wrote: > As you describe it, here's the way to refer to a particular medication: > > Patient( $meds: medications ) > Medication( drugCode == "55749-003-01" ) from $meds > > This rule determines whether the patient has this particular > medication. There are other operators that might be useful: > > Medication( drugCode str[startsWith] "55749-003" ) from $meds > > Inserting the Medication objects with a backlink to the Patient can > simplify rule evaluation, which may depend on the number and > complexity of the rules. Compare: > > Patient( $meds: medications ) > Medication( drugCode == "55749-003-01" ) from $meds > Medication( drugCode == "55799-565-01" ) from $meds > > with > > $p: Patient() > Medication( drugCode == "55749-003-01", patient == $p ) > Medication( drugCode == "55799-565-01", patient == $p ) > > Much depends on the number of facts you'll need to process. > > To answer your question, "Takes" was a class name I invented to refer > to the relation as an object, and "this" is Java's "this", referring > to the matching object. > > -W > > > On 02/01/2014, Ray Hooker wrote: >> Wolfgang, So in your case you were envisioning the possibility of a Takes >> object that matched between a particular medication and the patient. >> Actually we are fairly close in the case of medications. >> >> As you probably know MongoDB allows for documents. In this case, the >> patient’s document contains subdocuments. In the case of medications, this >> semantically means “as of the date of this patient document, the patient is >> taking the following medicine listed by the applicable code and text >> description”. >> >> When read from the DB, you actually have a Java object Patient (or “Record”) >> that has a method “medications” that returns a set of “Medication” objects. >> The parent knows about the medication through the set “medications”. I >> certainly could assert each patient/ record and for each of those assert >> each subdocument, inserting a key back to the parent. >> >> So the rule would need to identify, for example, any case where a particular >> had a medication object where the drug code matched a particular code or set >> of codes. >> >> Any suggestions are appreciated. Also in the example below, is “Takes” a >> function and what does “this” refer to? >> >> Thanks, >> >> Ray >> On Jan 2, 2014, at 2:01 AM, Wolfgang Laun wrote: >> >>> Ideally, a relation is represented by separate objects. Then you might >>> have >>> a rule >>> >>> $p: Patient() >>> $p: Takes( patient == $p, $m: medication ) >>> Medication( this == $m ) >>> >>> and this rule will fire for each medication of the patient. >>> >>> Answering such questions without details about the actual data model >>> is impossible. >>> >>> -W >>> >>> On 02/01/2014, Ray Hooker wrote: >>>> I am trying to figure out how to work with an existing model. The data >>>> is >>>> in >>>> MongoDB with embedded documents. It is about patients would have >>>> sub-documents. For example. An individual patient may have multiple >>>> allergies. Also a patient has multiple medications. So it is as >>>> follows: >>>> >>>> - Patient.medications ---> multi
Re: [rules-users] Kie and Guvnor 6.0
Mark, That makes sense. I added java.util.ArrayList and even saved it. I had to shutdown and restart though to get it to pop up in the Data Modeler as an option for field type. Is there a better way to refresh the list? Ray On Jan 7, 2014, at 9:40 PM, Mark Proctor wrote: > If you configure the imports, for the project, then those types become > available. > > Mark > On 8 Jan 2014, at 01:32, Ray Hooker wrote: > >> Thanks for the pointer on the docs. BTW have you seen a way to utilize >> more than primitive types in the Data modeler? I see where I can specify >> models I have already created but what about other classes such as >> ArrayList, etc? This is needed for one-to-many relationships between >> facts. For example, I have an existing model where patients have multiple >> medication records. I can write rules to deal with this manually (e.g., >> using the “from” keyword), but can I use Guvnor to specify the model as it >> really exists?.. which is an ArrayList type Medication? >> >> Ray >> On Jan 7, 2014, at 5:42 AM, Alexandre Porcelli wrote: >> >>> Hi, >>> >>> Here are the docs available for new Workbench: >>> http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/wb.Workbench.html >>> >>> Regards, >>> --- >>> Alexandre Porcelli >>> Principal Software Engineer >>> Red Hat Business Systems and Intelligence Group >>> >>> On Jan 7, 2014, at 3:02 AM, Ray Hooker wrote: >>> >>>> I have installed and worked with the new Guvnor interface. I am not sure >>>> how to interface with it. >>>> >>>> This may be a basic question, but I have not seen documentation of how >>>> Guvnor works exactly in version 6.0. I see that it uses a git repository >>>> and maven server, but I do not see where it actually resides or how I can >>>> access it? I need info like port, protocol, file location or something >>>> specific. I have tried to example the installation but am not sure the >>>> details. Certainly there is not a configuration panel that might indicate >>>> configured port for the maven repository, etc. A network diagram would be >>>> helpful. >>>> >>>> It is possible that I need to access the git repository or the Maven >>>> repository using Kie specific classes and functionality but then I would >>>> assume I need to give it the url/ web address of the Guvnor and way to >>>> configure that. >>>> >>>> >>>> Ray >>>> ___ >>>> rules-users mailing list >>>> rules-users@lists.jboss.org >>>> https://lists.jboss.org/mailman/listinfo/rules-users >>> >>> >>> ___ >>> rules-users mailing list >>> rules-users@lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/rules-users >> >> >> ___ >> rules-users mailing list >> rules-users@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/rules-users > > > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Kie and Guvnor 6.0
Thanks for the pointer on the docs. BTW have you seen a way to utilize more than primitive types in the Data modeler? I see where I can specify models I have already created but what about other classes such as ArrayList, etc? This is needed for one-to-many relationships between facts. For example, I have an existing model where patients have multiple medication records. I can write rules to deal with this manually (e.g., using the “from” keyword), but can I use Guvnor to specify the model as it really exists?.. which is an ArrayList type Medication? Ray On Jan 7, 2014, at 5:42 AM, Alexandre Porcelli wrote: > Hi, > > Here are the docs available for new Workbench: > http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/wb.Workbench.html > > Regards, > --- > Alexandre Porcelli > Principal Software Engineer > Red Hat Business Systems and Intelligence Group > > On Jan 7, 2014, at 3:02 AM, Ray Hooker wrote: > >> I have installed and worked with the new Guvnor interface. I am not sure >> how to interface with it. >> >> This may be a basic question, but I have not seen documentation of how >> Guvnor works exactly in version 6.0. I see that it uses a git repository >> and maven server, but I do not see where it actually resides or how I can >> access it? I need info like port, protocol, file location or something >> specific. I have tried to example the installation but am not sure the >> details. Certainly there is not a configuration panel that might indicate >> configured port for the maven repository, etc. A network diagram would be >> helpful. >> >> It is possible that I need to access the git repository or the Maven >> repository using Kie specific classes and functionality but then I would >> assume I need to give it the url/ web address of the Guvnor and way to >> configure that. >> >> >> Ray >> ___ >> rules-users mailing list >> rules-users@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/rules-users > > > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Kie and Guvnor 6.0
I have installed and worked with the new Guvnor interface. I am not sure how to interface with it. This may be a basic question, but I have not seen documentation of how Guvnor works exactly in version 6.0. I see that it uses a git repository and maven server, but I do not see where it actually resides or how I can access it? I need info like port, protocol, file location or something specific. I have tried to example the installation but am not sure the details. Certainly there is not a configuration panel that might indicate configured port for the maven repository, etc. A network diagram would be helpful. It is possible that I need to access the git repository or the Maven repository using Kie specific classes and functionality but then I would assume I need to give it the url/ web address of the Guvnor and way to configure that. Ray___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Facts - One to Many
Wolfgang, So in your case you were envisioning the possibility of a Takes object that matched between a particular medication and the patient. Actually we are fairly close in the case of medications. As you probably know MongoDB allows for documents. In this case, the patient’s document contains subdocuments. In the case of medications, this semantically means “as of the date of this patient document, the patient is taking the following medicine listed by the applicable code and text description”. When read from the DB, you actually have a Java object Patient (or “Record”) that has a method “medications” that returns a set of “Medication” objects. The parent knows about the medication through the set “medications”. I certainly could assert each patient/ record and for each of those assert each subdocument, inserting a key back to the parent. So the rule would need to identify, for example, any case where a particular had a medication object where the drug code matched a particular code or set of codes. Any suggestions are appreciated. Also in the example below, is “Takes” a function and what does “this” refer to? Thanks, Ray On Jan 2, 2014, at 2:01 AM, Wolfgang Laun wrote: > Ideally, a relation is represented by separate objects. Then you might have > a rule > > $p: Patient() > $p: Takes( patient == $p, $m: medication ) > Medication( this == $m ) > > and this rule will fire for each medication of the patient. > > Answering such questions without details about the actual data model > is impossible. > > -W > > On 02/01/2014, Ray Hooker wrote: >> I am trying to figure out how to work with an existing model. The data is >> in >> MongoDB with embedded documents. It is about patients would have >> sub-documents. For example. An individual patient may have multiple >> allergies. Also a patient has multiple medications. So it is as follows: >> >> - Patient.medications ---> multiple Medication objects >> >> So I see where you have a simple one to one. Typically perhaps you might >> have the medication record know that it is associated with the patient, but >> that is not how it is currently organized. So the question is can I write >> rules when patients.medications returns a set/ collection of medications >> associated with the patient. I want to write a rule such as "if a patient >> is >> taking medication=xxx" >> >> Thanks for your help. >> >> Ray Hooker > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Facts - One to Many
I am trying to figure out how to work with an existing model. The data is in MongoDB with embedded documents. It is about patients would have sub-documents. For example. An individual patient may have multiple allergies. Also a patient has multiple medications. So it is as follows: - Patient.medications ---> multiple Medication objects So I see where you have a simple one to one. Typically perhaps you might have the medication record know that it is associated with the patient, but that is not how it is currently organized. So the question is can I write rules when patients.medications returns a set/ collection of medications associated with the patient. I want to write a rule such as "if a patient is taking medication=xxx" Thanks for your help. Ray Hooker___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] What Class is the Fact that was inserted? - How to dump working memory?
I am trying to determine precisely what class the rules engine (kie version 6) thinks the class is that was inserted. The situation is that I am inserting objects from JRuby. 1. If I pass the object to a Java program and do reflection, the class is shown to be RubyObject (i.e., "getClass().getName". 2. I did create a rule that fires on any RubyObject that is inserted but it never fires: import org.jruby.RubyObject; rule "Find any RubyObject" dialect "mvel" when RubyObject() then System.out.println("We found a RubyObject!"); end 3. When I insert an object from JRuby that is called "Message", there is what I see: [ObjectInsertedEventImpl: getFactHandle()=[fact 0:1:529888082:529888082:1:DEFAULT:NON_TRAIT:#], getObject()=#, getKnowledgeRuntime()=org.drools.core.impl.StatefulKnowledgeSessionImpl@5719510f, getPropagationContext()=PhreakPropagationContext [entryPoint=EntryPoint::DEFAULT, factHandle=[fact 0:1:529888082:529888082:1:DEFAULT:NON_TRAIT:#], leftTuple=null, originOffset=-1, propagationNumber=2, rule=null, type=0]] How can find out exactly what are the facts in working memory and determine the precise nature of the fact I inserted? Ray Hooker -- View this message in context: http://drools.46999.n3.nabble.com/What-Class-is-the-Fact-that-was-inserted-How-to-dump-working-memory-tp4027110.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] JRuby Objects as Drools Facts
I have seen where one group in India claimed to be able to inserts JRuby objects as facts to Drools. I am very open to suggestions. The JRuby objects appear to Java to be class RubyObject. When I insert say a JRuby class named "Message", here is the message: [ObjectInsertedEventImpl: getFactHandle()=[fact 0:1:341074620:341074620:1:DEFAULT:NON_TRAIT:#], getObject()=#, getKnowledgeRuntime()=org.drools.core.impl.StatefulKnowledgeSessionImpl@4cb91eff, getPropagationContext()=PhreakPropagationContext [entryPoint=EntryPoint::DEFAULT, factHandle=[fact 0:1:341074620:341074620:1:DEFAULT:NON_TRAIT:#], leftTuple=null, originOffset=-1, propagationNumber=2, rule=null, type=0]] On the other hand if I insert a Java class in the same way, it is seen as: ==>[ObjectInsertedEventImpl: getFactHandle()=[fact 0:1:1319007734:1319007734:1:DEFAULT:NON_TRAIT:com.antelopesoftware.drools.Message@4e9e75f6], getObject()=com.antelopesoftware.drools.Message@4e9e75f6, getKnowledgeRuntime()=org.drools.core.impl.StatefulKnowledgeSessionImpl@139ba1d8, getPropagationContext()=PhreakPropagationContext [entryPoint=EntryPoint::DEFAULT, factHandle=[fact 0:1:1319007734:1319007734:1:DEFAULT:NON_TRAIT:com.antelopesoftware.drools.Message@4e9e75f6], leftTuple=null, originOffset=-1, propagationNumber=2, rule=null, type=0]] So how can I get the Drools engine to recognize the fact. BTW my real application is read from a MongoDB database using Mongoid and insert the data into Drools. I wrote wrapper Java classes to make it easier. Thanks in advance, Ray -- View this message in context: http://drools.46999.n3.nabble.com/JRuby-Objects-as-Drools-Facts-tp4027079.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users