[rules-users] setting conditional operators in Excel RuleSet
All, I am using excel for writing the rules. is it possible to have conditional operators like OR AND specified in the excel? I also need to support negation (NOT) operator. Is it possible to do this in excel, if yes can someone give me an example on how to do this. -- View this message in context: http://n3.nabble.com/setting-conditional-operators-in-Excel-RuleSet-tp692588p692588.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] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
So, is there something similar: processInstance.findWorkItemsInWaitState() that the framework provides? -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p692996.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] Error When changing persistence from H2 to Oracle for TaskService
@ramram, As I already said in Drools-Dev: http://n3.nabble.com/Persistence-issue-using-Oracle-td417229.html#a417229 As of Drools 5.1 M1, Drools Flow will not work with Oracle via property name=hibernate.hbm2ddl.auto value=create / due to the fact that some of Drools Flow Entity Names are longer than 30 characters (Oracle does not eat that), some of Drools Flow Entity properties use Oracle keywords (e.g. USER, etc..), ... You would have to remap them manually, and manually create your schema. /Anatoly -- View this message in context: http://n3.nabble.com/Error-When-changing-persistence-from-H2-to-Oracle-for-TaskService-tp685431p693007.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] How to do Exception Handling???
+1 Documentation on this is unclear. Unit tests in drools-src handle exceptions using Fault nodes, but not real exceptions that are thrown by WorkItemHandlers. 1. Can I have Process or Composite node exception handlers catch my own (or any other) exception other than just Faults? and if so, how can accomplish that? How I register my custom exception handler? 2. If the above is possible... How can I pass the exception to the custom exception handler so I can work with it (log the stack trace, etc)? /Anatoly -- View this message in context: http://n3.nabble.com/How-to-do-Exception-Handling-tp689387p693018.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] Drools Flow: WORK_ITEM_ID as a flow variable
Any updates on what I should copy from WSHT? Thank you, /Anatoly -- View this message in context: http://n3.nabble.com/Drools-Flow-WORK-ITEM-ID-as-a-flow-variable-tp680939p693020.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] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
No, that method, or something similar is not provided by the process APIs. We think that the process must continue the execution and when it's at a wait state you must have a mechanism to continue. Remember that you can also use signals for that. By the way, I think that the only thing that you need is: ((RuleFlowProcessInstance)processInstance).getNodeInstances(). That method will return all the nodes that are in a wait states for that process instance. On Fri, Apr 2, 2010 at 10:34 AM, tolitius webaka...@gmail.com wrote: So, is there something similar: processInstance.findWorkItemsInWaitState() that the framework provides? -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p692996.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 -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools Flow: Find a Session ID to reload the JPA Stateful session
still unsure what the best approach would be to find an ID of the Session that was suspended to reload. Appreciate ideas real life examples. Thank you, /Anatoly -- View this message in context: http://n3.nabble.com/Drools-Flow-Find-a-Session-ID-to-reload-the-JPA-Stateful-session-tp686250p693021.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] Drools Flow: Getting to the right Process from the re-loaded Session
How do other people solve this? The business entity should have NO knowledge about workflow (SESSION_ID, PROCESS_ID, WORK_ITEM_ID, etc..). Knowing that the framework does not help me to get the _current_ process instance from the session object, I am thinking on either to use Variable Persistence to save Business_ID and Process_Instance_ID as two variables, and handcraft the query to find the latest Process_Instance_ID from the VariableInstanceInfo by the Business_ID provided OR Create Business_ID | Process_Instance_ID reference table, and here I will have to pass a BusinessProcess entity to every flow. Still needs a separate DB call OR [fill in your approach, let's have a discussion] Thank you, /Anatoly -- View this message in context: http://n3.nabble.com/Drools-Flow-Getting-to-the-right-Process-from-the-re-loaded-Session-tp686219p693048.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] Drools Flow: Find a Session ID to reload the JPA Stateful session
not sure why it is a generic way to present a problem. I am just looking for an approach to find a Session_ID of the session that was suspended. Best approaches, approaches that other people use, suggested approach, etc.. For example why would not the framework (Drools Flow) have something like: UNIT_OF_WORK_ID | SESSION_ID | PROCESS_INSTANCE_ID that can be used to know exactly what the SESSION_ID ( .. PROCESS_INSTANCE_ID, etc ) by the business key. So I would be interested in hearing any approaches that are used out there in the real world. Thank you, /Anatoly -- View this message in context: http://n3.nabble.com/Drools-Flow-Find-a-Session-ID-to-reload-the-JPA-Stateful-session-tp686250p693090.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
[rules-users] Drools objects' methods
Hello, In the documentation, it is written (4.8.2.1.1): A Field constraint specifies a restriction to be used on a named field A bit further: A field is derived from an accessible method of the object. If your model objects follow the Java Bean pattern, then fields are exposed using getXXX or isXXX methods, where these methods take no arguments, and return something. Within patterns, fields can be accessed using the bean naming convention... Is this mean that we have no access to our Objects' method ? (excepting get or is) Is there a way to get around this ? Thank you in advance. Regards, Benoît _ Consultez vos emails Orange, Gmail, Yahoo!, Free ... directement depuis HOTMAIL ! http://www.windowslive.fr/hotmail/agregation/___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools Flow: Find a Session ID to reload the JPA Stateful session
Exaclty.. Unit of work can be anything that you want. And that kind of things are outside of the scope of the framework. You can implement it in the way that you want. Looks like you already resolve the problem. Create a table containing all that information and then query it in the way that you like it. We do it in that way, but it always depend of the applications that you are trying to develop. For example how you decide if the Unit Of Work ID is a Long, String, an Embedded object, a JCR NODE ID, etc. That's why it's out side the scope of drools flow. On Fri, Apr 2, 2010 at 11:28 AM, tolitius webaka...@gmail.com wrote: not sure why it is a generic way to present a problem. I am just looking for an approach to find a Session_ID of the session that was suspended. Best approaches, approaches that other people use, suggested approach, etc.. For example why would not the framework (Drools Flow) have something like: UNIT_OF_WORK_ID | SESSION_ID | PROCESS_INSTANCE_ID that can be used to know exactly what the SESSION_ID ( .. PROCESS_INSTANCE_ID, etc ) by the business key. So I would be interested in hearing any approaches that are used out there in the real world. Thank you, /Anatoly -- View this message in context: http://n3.nabble.com/Drools-Flow-Find-a-Session-ID-to-reload-the-JPA-Stateful-session-tp686250p693090.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 -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools objects' methods
you can use the eval() CE for execute methods and functions. eval(myObject.myMethod()); This requiere that myMethod() returns a boolean value. If not you can always compare things inside eval and return a boolean value eval( myObject.myMethod() 5) 2010/4/2 Bertrand Grottier b_grott...@hotmail.com Hello, In the documentation, it is written (4.8.2.1.1): A Field constraint specifies a restriction to be used on a named field A bit further: A field is derived from an accessible method of the object. If your model objects follow the Java Bean pattern, then fields are exposed using getXXX or isXXX methods, where these methods take no arguments, and return something. Within patterns, fields can be accessed using the bean naming convention... Is this mean that we have no access to our Objects' method ? (excepting get or is) Is there a way to get around this ? Thank you in advance. Regards, Benoît -- Hotmail débarque sur votre téléphone ! Paramétrez Hotmail sur votre téléphone! Gratuit ! http://www.messengersurvotremobile.com/?d=Hotmail ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
Yes, but even without WS-HT, framework has WORKITEMINFO, with WORKITEMID... It just seems so natural for a workflow (or how many buzzzy people call it a BPM solution) to KNOW which elements of the flow are in the wait state, without any custom built components. Don't you think? -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p693226.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] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
Yes nodeinstances is for that - Ing. Mauricio Salatino - On Apr 2, 2010, at 13:24, tolitius webaka...@gmail.com wrote: Yes, but even without WS-HT, framework has WORKITEMINFO, with WORKITEMID... It just seems so natural for a workflow (or how many buzzzy people call it a BPM solution) to KNOW which elements of the flow are in the wait state, without any custom built components. Don't you think? -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p693226.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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools objects' methods
Use an eval() statement. --- On Fri, 4/2/10, Bertrand Grottier b_grott...@hotmail.com wrote: From: Bertrand Grottier b_grott...@hotmail.com Subject: [rules-users] Drools objects' methods To: rules-users@lists.jboss.org Date: Friday, April 2, 2010, 10:34 AM Hello, In the documentation, it is written (4.8.2.1.1): A Field constraint specifies a restriction to be used on a named field A bit further: A field is derived from an accessible method of the object. If your model objects follow the Java Bean pattern, then fields are exposed using getXXX or isXXX methods, where these methods take no arguments, and return something. Within patterns, fields can be accessed using the bean naming convention... Is this mean that we have no access to our Objects' method ? (excepting get or is) Is there a way to get around this ? Thank you in advance. Regards, Benoît Hotmail débarque sur votre téléphone ! Paramétrez Hotmail sur votre téléphone! Gratuit ! -Inline Attachment Follows- ___ 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] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
yes, but: 1. It is too low level to be a true clean / simple client API. Instead of something as simple as: process.findWorkInProgress() developers need to know to: a. cast the processInstance, b. get a hold of NodeInstances c. iterate over them d. filter out what nodes are in progress e. query DB for the data associated with those nodes 2. There is no one view to all the wait nodes, because of the sub-processes, so this solution gets even hairier when there are multiple subflows, subflows within subflows, etc.. That is why it is rather odd that you think these low level APIs are enough. /Anatoly -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p693482.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] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
Good to see that you are agree with me at least in something.. about your other points: 1 a. As you may know, casting and the use of interfaces let us (in the java world) provide support for different types of processes. So no matter which type of processes we are handling this method will always return a ProcessInstance. In your case you cast to RuleFlowProcessInstance, and that's ok, but if you have another type of process instance you should use another interface. b. I'm not sure what you mean with this, but call a method to get node instances sound pretty easy to be a developer task. c. we, as developers, iterate stuff all the times d. getNodeInstances only returns the wait state, not node in progress. e. depends on the mechanism that you choose, as you can see the WSHT module uses a client api to not do that kind of queries directly. 2. Probably you got this feeling because you think about process like things that you must continue. In drools flow this is not the common way to think about processes. Because we consider that processes are smart enough to continue them selves their executions. I see sub processes in the same way, it don't think that it's a complication. If you see how WSHT works, you will see that no matter which process is running (parentflow, subflow, subsubflow,subsubsubflow) all the human task created will be in the same human task list to be completed. I think that these low level (for you) APIs are enough because it let us implement a high level layer, like the one you want for each specific implementation. The problem with high level layers is that you end up with something that is not too flexible as the low level APIs. Feel free to implement a high level APIs and create a new project that can be used on top of drools flow. Greetings! On Fri, Apr 2, 2010 at 2:27 PM, tolitius webaka...@gmail.com wrote: yes, but: 1. It is too low level to be a true clean / simple client API. Instead of something as simple as: process.findWorkInProgress() developers need to know to: a. cast the processInstance, b. get a hold of NodeInstances c. iterate over them d. filter out what nodes are in progress e. query DB for the data associated with those nodes 2. There is no one view to all the wait nodes, because of the sub-processes, so this solution gets even hairier when there are multiple subflows, subflows within subflows, etc.. That is why it is rather odd that you think these low level APIs are enough. /Anatoly -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p693482.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 -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
I'm facing similar requirements, I think. In many cases the other systems that I'll be working with have no place to stuff a WorkItem Id, etc. I'm planning to implement a http://www.eaipatterns.com/SmartProxy.html Smart Proxy , which stores in a database a mapping from: - a unique set of data in the request and the response to - the session-id/process-id/workitem-id necessary to resume. When a response comes in, the table will be used for correlation. An event monitor will clean out the table entries when a given process terminates. The mapping may be stored as rules - I'm not sure yet. Thoughts? Experience? I'm a total drools-noob - this may make no sense. Thanks, -Ed Staub -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p693680.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] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
Hi Ed, Cool, are you planning to implement your own work Item? What will be the main functionality of your work item? Sound to complex to implement that pattern just to keep the relationship. Did you see the WSHT module? On Fri, Apr 2, 2010 at 4:09 PM, Ed Staub est...@telcordia.com wrote: I'm facing similar requirements, I think. In many cases the other systems that I'll be working with have no place to stuff a WorkItem Id, etc. I'm planning to implement a http://www.eaipatterns.com/SmartProxy.html Smart Proxy , which stores in a database a mapping from: - a unique set of data in the request and the response to - the session-id/process-id/workitem-id necessary to resume. When a response comes in, the table will be used for correlation. An event monitor will clean out the table entries when a given process terminates. The mapping may be stored as rules - I'm not sure yet. Thoughts? Experience? I'm a total drools-noob - this may make no sense. Thanks, -Ed Staub -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p693680.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 -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
Salatino, Thanks for your responses. I don't see what's relevant in WSHT - but I wasn't very clear about the problem I'm trying to solve. We expect to be using Flow to glue together a lot of existing systems, with existing async API's, largely transported over JMS. They don't have a place to hold onto a Drools-provided correlation ID - they have ad hoc correlation ids constructable from common data in the request and response. We will need to map from these ad hoc ids to the workitem. Cool, are you planning to implement your own work Item? I haven't worked out where/how to wire this in yet. I was hoping someone might point me to this being on the shelf somewhere! -Ed -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p693778.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
[rules-users] Importing Fact model in Eclipse
Hi I have created a Drools project and trying to create a guided rule in Eclipse 3.5 and Drools 5.0.x. I have my own domain objects in another java project to be used by Drools project. I want to use the java domain model as the fact model in my Drools project. How is that done ? Do i have to go thru the web based guvnor first ? All I m planing to have is a simple java project which has java classes of my domain model of POJOs and in my Drools project i want to use them as fact model. How do i do it in eclipse IDE ? Thanks - shailesh ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Importing Fact model in Eclipse
On 02.04.2010 22:48, Shailesh Hedaoo wrote: Hi I have created a Drools project and trying to create a guided rule in Eclipse 3.5 and Drools 5.0.x. I have my own domain objects in another java project to be used by Drools project. I want to use the java domain model as the fact model in my Drools project. How is that done ? Do i have to go thru the web based guvnor first ? All I m planing to have is a simple java project which has java classes of my domain model of POJOs and in my Drools project i want to use them as fact model. How do i do it in eclipse IDE ? Should suffice to add the fact model jar to the classpath of the project containing your rules source code. That's how we did it when still working with Eclipse (now switched to IDEA). If you don't want to compile the jar beforehand, on the rules project's root folder, right-click build path - configure build path, select Projects tab, click Add, check your fact model project and confirm everything. Kind regards Ansgar ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
Anatoly, I see you point too. But you are comparing a clean and high level API the criterias APIs from hibernate, that are also generic. If you want to do with Hibernate a query that creates a relationship between persons and documents, you need to include inside the criteria the person and the document that you want to look for. You don't have something like hibernate.getThePersonAndTheDocumentThatIWant(); //That's what I see when you ask me about high level apis to get all the waiting work items. That's why I think that you need to change the way you think about Drools Flow. I know that you are learning but you don't follow my suggestions. Providing us simple test cases and projects where we can look at and make suggestions. Now, do you see my point? On Fri, Apr 2, 2010 at 5:44 PM, tolitius webaka...@gmail.com wrote: good to get a full response instead of copy this / yes, you can do that / etc... actually, I am not sure what I am agreeing with you on :) And it is not about agreeing, it is about me getting Drools Flow approach, since the documentation is very high level. Where I would really throw forces to make it low-level, that would be documentation, but not a product APIs. That is a definite differences in opinions. Think about other good frameworks, like Spring and Hibernate for example. If I had to do 6 low level calls to get a reference to a bean in Spring, I would never even consider using it, would go for CDI http://jcp.org/en/jsr/detail?id=299 right away. (but no, it is as simple HIGH LEVEL as Autowire or implement a certain (Aware) interface) If I had to create 15 queries and write my high level APIs on top of the Hibernate's low level APIs to make them flexible enough, I would rather use iBatis, or just GORM (but no I can use a nice HIGH LEVEL Criteria API) The point is there should be a healthy balance between the framework and the client. Now, I am not saying Drools Flow does not have that balance, what I am saying help me learn Drools Flow in a way that I can use its full power. And I am SURE that there is a better way in Drools Flow to find all waiting workitems. Maybe not by a single HIGH LEVEL API call ( not YET :) ), but surely not through some low level NodeInstance hooks. And as far as Java World, Asgard http://en.wikipedia.org/wiki/Asgard_%28Stargate%29 World, and many other worlds, clean and simple is always stronger, than weakly-typed, convoluted and low-level. /Anatoly -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p693769.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 -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] creating .pkg from .drl
Hi Amit, this is a simple snippet from KnowledgeAgentTest.java. String rule1 = ; rule1 += package org.drools.test\n; rule1 += global java.util.List list\n; rule1 += rule rule1\n; rule1 += when\n; rule1 += then\n; rule1 += list.add( drools.getRule().getName() );\n; rule1 += end\n; String rule2 = ; rule2 += package org.drools.test\n; rule2 += global java.util.List list\n; rule2 += rule rule2\n; rule2 += when\n; rule2 += then\n; rule2 += list.add( drools.getRule().getName() );\n; rule2 += end\n; //Creates a builder and add the 2 rules KnowledgeBuilder kbuilder = KnowledgeBuilderFactory .newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newByteArrayResource(rule1.getBytes()), ResourceType.DRL); kbuilder.add(ResourceFactory.newByteArrayResource(rule2.getBytes()), ResourceType.DRL); if (kbuilder.hasErrors()) { fail(kbuilder.getErrors().toString()); } //get the generated package (change this if you have more than one package) KnowledgePackage pkg = (KnowledgePackage) kbuilder .getKnowledgePackages().iterator().next(); // writes the package to a file FileOutputStream out = new FileOutputStream(/tmp/myPackage.pkg); try { DroolsStreamUtils.streamOut(out, pkg); } finally { out.close(); } Best, 2010/4/2 Amit Kumar amitku...@gmail.com Hi Folks, I am trying to create a .pkg file (for probably faster loading) from a .drl file Does anybody has a code snippet which I can use. Am unable to find it in javadocs. Thanks Amit ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Esteban Aliverti ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
not sure where you are going with this, but ok: public interface ProcessInstance extends EventListener { int STATE_PENDING = 0; int STATE_ACTIVE= 1; int STATE_COMPLETED = 2; int STATE_ABORTED = 3; int STATE_SUSPENDED = 4;// // } So does WorkItem: public class WorkItemImpl implements WorkItem, Serializable { private static final long serialVersionUID = 400L; private long id; private String name; private int state = 0; // private MapString, Object parameters = new HashMapString, Object(); private MapString, Object results = new HashMapString, Object(); private long processInstanceId; // } And yes, it is framework concern from both angles. /Anatoly -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p694087.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] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
Yes it's there: public interface WorkItem { int PENDING = 0; int ACTIVE= 1; int COMPLETED = 2; int ABORTED = 3; depending on your work item handler implementation you will set the state as you wish.. notice that you can add more states if you need a complex life cycle. That means that it's not fixed to one single state when it's active. You can implement multiple phases of execution. On Fri, Apr 2, 2010 at 7:24 PM, tolitius webaka...@gmail.com wrote: not sure where you are going with this, but ok: public interface ProcessInstance extends EventListener { int STATE_PENDING = 0; int STATE_ACTIVE= 1; int STATE_COMPLETED = 2; int STATE_ABORTED = 3; int STATE_SUSPENDED = 4;// // } So does WorkItem: public class WorkItemImpl implements WorkItem, Serializable { private static final long serialVersionUID = 400L; private long id; private String name; private int state = 0; // private MapString, Object parameters = new HashMapString, Object(); private MapString, Object results = new HashMapString, Object(); private long processInstanceId; // } And yes, it is framework concern from both angles. /Anatoly -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p694087.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 -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] creating .pkg from .drl
Cool.. Thanks folks! On Fri, Apr 2, 2010 at 3:48 PM, Ansgar Konermann ansgar.konerm...@googlemail.com wrote: On 03.04.2010 00:40, Amit Kumar wrote: Hi Folks, I am trying to create a .pkg file (for probably faster loading) from a .drl file Does anybody has a code snippet which I can use. Am unable to find it in javadocs. Hi, from what we figured out at work, they're just plain serialized knowledge packages (or rather, collections thereof). IIRC, this is also described somewhere in the docs. So all you need to do is: - create the knowledge packages in-memory using the normal KnowledgeBuilder api calls (loads of documentation available for this) - use java object serialization to write a CollectionKnowledgePackage into a file. Upon loading these packages, make sure all the classes used/imported in the *.drl files are available on the classpath, otherwise you probably won't be able to deserialize the packages. Kind regards Ansgar ___ 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] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
my point exactly. state IS there in framework's ProcessInstance AND in framework's WorkItem, hence it IS a framework concern [it is a framework DSL]. Therefore it needs to be addressed by straightforward clean and simple APIs. /Anatoly -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p694317.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] Resuming the Flow: SESSION_ID, PROCESS_INSTANCE_ID, WORKITEM_ID
Yes state is there. For your implementation you can create the high level API that you want, there's no problem with that right? I see that we discuss about what the framework should do or not based on different perspectives. We can continue forever if you do not switch your perspective. The code is there and it allows you to build applications applying the mechanisms that work better for you. For what I know there is no plan to create an API like the one you mention. (honestly I don't think it worth it, from the project perspective) Everything else that I can offer are suggestions to do a real implentation, but that will requiere as I mention before, knowledge about your particular domain. - Ing. Mauricio Salatino - On Apr 2, 2010, at 23:58, tolitius webaka...@gmail.com wrote: my point exactly. state IS there in framework's ProcessInstance AND in framework's WorkItem, hence it IS a framework concern [it is a framework DSL]. Therefore it needs to be addressed by straightforward clean and simple APIs. /Anatoly -- View this message in context: http://n3.nabble.com/Resuming-the-Flow-SESSION-ID-PROCESS-INSTANCE-ID-WORKITEM-ID-tp607507p694317.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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Problem With DEFAULT_REFS Table Taking Up A Very Large Amount of Space
Hello, I previously asked a question about programmatically creating rules and then uploading them to Guvnor ( http://n3.nabble.com/Question-About-Programmatically-Creating-Drools-Rules-Remotely-td452619.html ). I decided to go ahead with the idea proposed by david_nabble and upload the rules I created to Guvnor via webdav using sardine. Unfortunately I have run into a problem where the DEFAULT_REFS table in the database I am using has become incredibly large; over 27 gigabytes. Not only that, but the DEFAULT_REFS table consists of only 4 rows of LOBs. This size was hit after uploading approximately 30 000 - 40 000 rules. If I examine the .brl, each rule is only about 1.1 kilobytes in size each, so I have only uploaded about 32-42 MB of rules. Does anyone know what is going on here and/or what direction I could go in solving this issue? Thank You, Scott McKee ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users