Re: [rules-users] Changing PackageIsSource from false to true
ramram8 wrote: Thnx Jervis for explaining the issue yes you are correct I dont have any .drl file in the package I have a model Jar file and .rf file and the error that i am getting is the following: ERROR [STDERR] Could not find work item handler for Log i dont know why?? any ideas I thought it was related to PackageIsSource! Looks like its not related to PackageIsSource. Will you be able to create a test case that can be used to reproduce the error or at least some detailed step by step instructions on you ran into this problem so that we can look into this further? Thanks, Jervis ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Multiple Excel decisiontables - a bug
Thomas Thanks for the reply. It makes sense to specify the rule names explicitly. If I have several hundreds of rows ( several spreadsheets), giving a unique name for each rule is time consuming. I guess I can use some Excel functionality to generate the unique names. Excel is fairly clever so if you have cell whose content ends with a number when you drag the black box to copy the contents into the cells below it will automatically increment the value. If you have just a single rules table then this won't take long at all, I do agree however that if you have lots of rules tables this could get tedious. What do you think about the feature of auto generating the names? Let us say, if the the name of spreadsheet is appended with 11, 12 etc I can have the rule name generated automatically (of course, presuming I give an unique name for each spreadsheet... which is far less effort). Sounds sensible to me, and from what I have seen shouldn't be that hard to change the code to do this. I've got a whole list of features that I'd like to do to improve the spreadsheet support, the project I'm working on is using them and I'm hoping to get some time to work on it but as it is currently running behind I'm not sure if that is going to happen or not. Thomas Swindells, Thomas wrote: My advice is always to include a rulename (NAME) column and explicitly specify all the rule names. That way the name of the rule is deterministic and doesn't suddenly change if someone happens to insert a rule in the row above - this is particularly useful if you log or audit the rules that have fired. Thomas -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of satjo Sent: 18 November 2009 16:50 To: rules-users@lists.jboss.org Subject: [rules-users] Multiple Excel decisiontables - a bug I think following is a bug and I would like to how different users think Issue: If there are multiple Excel decisiontables files, i.e, NOT multiple decision tables in a single spreadsheet, then the 'fireall' does not necessarily give right results as the rule names get repeated in the resolved drl file. How to produce?: One can produce this issue adding multiple Excel files in Knowledbuilder and also one can see the same problem in Guvnor when one uploads multiple Excel decision tables. Reason for the behavior: The rule name (with row number post fix) gets repeated if all the spreadsheets for the given model. Let us say if I have a model 'com.sample.Test' and two spreadsheet decision tables use this model, then the final resolved drl file would have two rules with the same name, e.g. Test_11 etc. I looked into the code 'org.drools.template.model' and name is not unique between different spreadsheets. If this name is unique, e.g. name of the spreadsheet (presuming each spreadsheet is having unique name), then I do get correct results. I want to know if any one has similar experience or comments. -- View this message in context: http://old.nabble.com/Multiple-Excel- decisiontables---a-bug-tp26408909p26408909.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users *** *** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 *** *** ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- View this message in context: http://old.nabble.com/Multiple-Excel- decisiontables---a-bug-tp26408909p26415670.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ** This message is confidential and intended only for the addressee. If you have received this message in error, please
[rules-users] from clause in decision table.
I've got a fact which contains a collection (a set of strings to be precise). I want to write a rule which fires if there are any invalid values (where the valid values are defined as a list). What I'm trying to do is express this within a decision table. Expressed as a drl rule the following works: rule ValidateList when Fact(col : collection != null) String(this not in ($param)) from col Then #generate error End Where $param = '1, 3, valid' The decision tables seem to assume that the fact type is the last element in the line and then appends ( conditions... ) this means there is no way to then insert a from ... after it. Does anybody know either a different way to structure the rule so that I don't need a from or a way to get the decision table to use it? (unfortunately adding the collection directly as a fact isn't an option). Thanks, Thomas ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Changing PackageIsSource from false to true
Thnx Jervis for explaining the issue yes you are correct I dont have any .drl file in the package I have a model Jar file and .rf file and the error that i am getting is the following: ERROR [STDERR] Could not find work item handler for Log i dont know why?? any ideas I thought it was related to PackageIsSource! Looks like its not related to PackageIsSource. Will you be able to create a test case that can be used to reproduce the error or at least some detailed step by step instructions on you ran into this problem so that we can look into this further? Yes sure Jervis: Look what I am trying to do is that I have a .rf process that contains the following: START USERTASK LOG END How I am uploading the process into guvnor as the follow: 1- upload the Model Jar file that contains registering the handler to the human task and to the Log 2- upload the.rf process 3- build the package with name default 4- create a snapshot 5- restart the server and I am getting this error on the web console after a finish processing the USERTASK ERROR [STDERR] Could not find work item handler for Log really i am confused because in the jar file i having the following ksession.getWorkItemManager().registerWorkItemHandler(Log, new SystemOutWorkItemHandler()); it seems that the Model jar file uploaded into guvnor is not being processed?? any ideas how to resolve the issue -- View this message in context: http://old.nabble.com/HELP-Changing-PackageIsSource-from-false-to-true-tp26408394p26421271.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Problems with change-set xsd
Thanks, I tried that, now I have the following error: schema_reference.4: Failed to read schema document 'null', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. My xml: ?xml version=1.0 encoding=UTF-8? change-set xmlns=http://drools.org/drools-5.0/change-set; xmlns:xs=http://www.w3.org/2001/XMLSchema-instance; xs:schemaLocation=http://drools.org/drools-5.0/change-set http://drools.org/drools-5.0/change-set.xsd; add resource source='file://rules/com/test/' type='DRL'/ /add /change-set From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of David Sinclair Sent: 19 November 2009 16:27 To: Rules Users List Subject: Re: [rules-users] Problems with change-set xsd Your xs:schemaLocation is missing the namespace for the XSD should be xs:schemaLocation=http://drools.org/drools-5.0/change-set http://drools.org/drools-5.0/change-set.xsd; On Thu, Nov 19, 2009 at 11:20 AM, Asif Iqbal asif.iq...@infor.commailto:asif.iq...@infor.com wrote: Hi all, I have the following change set xml: ?xml version=1.0 encoding=UTF-8? change-set xmlns=http://drools.org/drools-5.0/change-set; xmlns:xs=http://www.w3.org/2001/XMLSchema-instance; xs:schemaLocation=http://drools.org/drools-5.0/change-set.xsd; add resource source='file://rules/com/test/' type='DRL'/ /add /change-set All the rule files exist under the package rules/com/test. Every time I run it gives me the following errors 'http://drools.org/drools-5.0/change-set.xsd' must have even number of URI's. Cannot find the declaration of element 'change-set' Anyone have any ideas? thanks ___ rules-users mailing list rules-users@lists.jboss.orgmailto: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] How do I resume a paused process?
I have a process that pauses after a few nodes are executed because it reaches a Human Task node. I retrieve the persisted session with the following code: JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, null, getEnvironment()); Once I have this session object I'm not sure how to resume the paused process? I want to signal the Human Task work item as complete and have the process resume at that point. I've tried this code: WorkItemManager wm = session.getWorkItemManager(); wm.registerWorkItemHandler(Approve, new WSHumanTaskHandler()); WorkflowProcessInstance pi = (WorkflowProcessInstance) session.startProcess(processName); Object[] nodes = pi.getNodeInstances().toArray(); WorkItem wi = ((HumanTaskNodeInstance) nodes[0]).getWorkItem(); wm.completeWorkItem(wi.getId(), null); session.dispose(); The result of this is that the workflow restarts from the first node and completes to the end. I expected that the workflow would start at the persisted location. What am I missing here? Scott Stevenson ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] How do I resume a paused process?
You need to have at least the process instance id or the work item id to get your things done. session.startProcess(processName); This will always starts a new process You have to get hold of your process instance or you can directly complete the work item if you have the work item id. StatefulKnowledgeSession ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, null, getEnvironment()); WorkflowProcessInstance inst = (WorkflowProcessInstance)ksession.getProcessInstance(process instance id); get hold of the work item and complete it OR If you have the work item id already you can do this directly ksession.getWorkItemManager().completeWorkItem(workitemid, null); -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Scott Stevenson Sent: Thursday, November 19, 2009 11:00 AM To: Rules Users List Subject: [rules-users] How do I resume a paused process? I have a process that pauses after a few nodes are executed because it reaches a Human Task node. I retrieve the persisted session with the following code: JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, null, getEnvironment()); Once I have this session object I'm not sure how to resume the paused process? I want to signal the Human Task work item as complete and have the process resume at that point. I've tried this code: WorkItemManager wm = session.getWorkItemManager(); wm.registerWorkItemHandler(Approve, new WSHumanTaskHandler()); WorkflowProcessInstance pi = (WorkflowProcessInstance) session.startProcess(processName); Object[] nodes = pi.getNodeInstances().toArray(); WorkItem wi = ((HumanTaskNodeInstance) nodes[0]).getWorkItem(); wm.completeWorkItem(wi.getId(), null); session.dispose(); The result of this is that the workflow restarts from the first node and completes to the end. I expected that the workflow would start at the persisted location. What am I missing here? Scott Stevenson ___ 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] test scenario in Guvnor
All, I followed an example and created test scenario in Guvnor. However, I always got 'no rule was fired ' even then I specified rule(s) in the test scenario. Am I missing something? Btw, how to set java as default dialect in rules? Appreciate your help. Tony HR font size=1 face=ArialBCONFIDENTIALITY NOTICE: /BThe information in this electronic transmission and any documents accompanying it may contain confidential and privileged information intended for use by the individual or entity that is the intended recipient. If you have received this message in error or due to an unauthorized transmission or interception, please delete all copies from your system without disclosing, copying, or transmitting this message and notify us by telephone 877TELLUS9 or by electronic mail a href = servicecomme...@progressive-medical.comservicecomme...@progressive-medical.com/a./font ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Unknownhost exception
Hi all, Has anyone ever come across the following error: Error in running rules: java.net.UnknownHostException: rules I believe its something to do with my changeset xml ?xml version=1.0 encoding=UTF-8? change-set xmlns='http://drools.org/drools-5.0/change-set' xmlns:xs='http://www.w3.org/2001/XMLSchema-instance' xs:schemaLocation='http://drools.org/drools-5.0/change-set change-set.xsd' add resource source='file://rules/com/test/os/' type='DRL'/ /add /change-set My rules are located under src/main/rules/com/test/os, but im not sure if its picking them up and hence the knowledge builder is throwing this error. Any ideas? CONFIDENTIALITY NOTICE: The information in this electronic transmission and any documents accompanying it may contain confidential and privileged information intended for use by the individual or entity that is the intended recipient. If you have received this message in error or due to an unauthorized transmission or interception, please delete all copies from your system without disclosing, copying, or transmitting this message and notify us by telephone 877TELLUS9 or by electronic mail servicecomme...@progressive-medical.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Drools Flow 5.1 - How to get hold of WorkingMemory inside the WorkItemHandler
Hi, In Drools Flow (5.1) is there any way of getting hold of the org.drools.WorkingMemory inside the WorkItemHandler? Thanks Vijay ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] drools flow package issue
Drools version: 5.0.1 I defined two flows, one is main flow and the other is sub flow. These two flows have same package name, and are built and added into one knowledge base. When I start the main flow process, the NoSuchMethod error is thrown out. I also test with two unrelated flows, and I can't get correct result. So my question is that whether there is the constraint which two flows must not have same package name? main.rf ?xml version=1.0 encoding=UTF-8? process xmlns=http://drools.org/drools-5.0/process; xmlns:xs=http://www.w3.org/2001/XMLSchema-instance; xs:schemaLocation=http://drools.org/drools-5.0/process drools-processes-5.0.xsd type=RuleFlow name=flow id=process_plan package-name=sample version= header variables variable name=v1 type name=org.drools.process.core.datatype.impl.type.BooleanDataType / valuefalse/value /variable /variables /header nodes start id=1 name=Start x=195 y=15 width=30 height=30 / split id=2 name=Split x=185 y=70 width=40 height=40 type=2 constraints constraint toNodeId=10 toType=DROOLS_DEFAULT name=a priority=1 type=code dialect=java return v1;/constraint constraint toNodeId=11 toType=DROOLS_DEFAULT name=b priority=1 type=code dialect=java return !v1;/constraint /constraints /split join id=5 name=Join x=185 y=260 width=40 height=40 type=2 / actionNode id=7 name=test x=155 y=320 width=100 height=80 action type=expression dialect=java System.out.println(Action Test);/action /actionNode end id=8 name=End x=191 y=436 width=28 height=28 / subProcess id=9 name=SubProcess x=312 y=292 width=96 height=76 processId=com.sample.subflow independent=false /subProcess actionNode id=10 name=a x=75 y=151 width=80 height=40 action type=expression dialect=java System.out.println(a);/action /actionNode actionNode id=11 name=b x=287 y=153 width=80 height=40 action type=expression dialect=java System.out.println(b);/action /actionNode /nodes connections connection from=1 to=2 / connection from=10 to=5 / connection from=11 to=5 / connection from=9 to=7 / connection from=7 to=8 / connection from=5 to=9 / connection from=2 to=10 / connection from=2 to=11 / /connections /process sub.rf ?xml version=1.0 encoding=UTF-8? process xmlns=http://drools.org/drools-5.0/process; xmlns:xs=http://www.w3.org/2001/XMLSchema-instance; xs:schemaLocation=http://drools.org/drools-5.0/process drools-processes-5.0.xsd type=RuleFlow name=subflow id=com.sample.subflow package-name=sample version= header /header nodes start id=1 name=Start x=29 y=76 width=30 height=30 / actionNode id=2 name=Action x=134 y=51 width=100 height=80 action type=expression dialect=java System.out.println(This is test subflow);/action /actionNode end id=3 name=End x=309 y=77 width=28 height=28 / actionNode id=4 name=Action x=240 y=210 width=100 height=80 action type=expression dialect=java System.out.println(This is test );/action /actionNode /nodes connections connection from=1 to=2 / connection from=4 to=3 / connection from=2 to=4 / /connections /process Test codes: public class XiaYuSubflowTest { public static void main(String[] args) { KnowledgeBuilder builder = KnowledgeBuilderFactory.newKnowledgeBuilder(); builder.add(ResourceFactory.newClassPathResource(main.rf), ResourceType.DRF); builder.add(ResourceFactory.newClassPathResource(sub.rf), ResourceType.DRF); if (builder.hasErrors()) { System.out.println(builder.getErrors()); } KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(builder.getKnowledgePackages()); StatefulKnowledgeSession sks = kbase.newStatefulKnowledgeSession(); sks.startProcess(process_plan); sks.dispose(); } } ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Using DateFormat and getting today's date in drools5.0
Can somebody help me please? i am not able to find answers to this question yet. thanks ABRA2 -- View this message in context: http://old.nabble.com/Using-DateFormat-and-getting-today%27s-date-in-drools5.0-tp26402736p26424219.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users