Re: [rules-users] EvalConditionNode cannot be cast to org.drools.reteoo.RightTupleSink
I'm using Drools 5.1.1 -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/EvalConditionNode-cannot-be-cast-to-org-drools-reteoo-RightTupleSink-tp2660572p2660824.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] EvalConditionNode cannot be cast to org.drools.reteoo.RightTupleSink
We are seeing this exception when trying to complete flows in wait state. This happens after we deploy a newer release of our application. Context: 1. we start several process that go to wait state 2. we make bug fixes to our application and deploy a new version 3. we try to resume the existing flows that are in wait state. 4. we get this exceptions when trying to load existing session NOTE: drools version is the same so I don't think this is a serialization incompatibility issue. Exception: Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedConstructorAccessor622.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:95) ... 202 more Caused by: java.lang.RuntimeException: Unable to load session snapshot at org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapshot(JPASessionMarshallingHelper.java:96) at org.drools.persistence.session.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:202) at org.drools.persistence.session.SingleSessionCommandService.(SingleSessionCommandService.java:165) ... 206 more Caused by: java.lang.ClassCastException: org.drools.reteoo.EvalConditionNode cannot be cast to org.drools.reteoo.RightTupleSink at org.drools.marshalling.impl.InputMarshaller.readRightTuple(InputMarshaller.java:401) at org.drools.marshalling.impl.InputMarshaller.readRightTuples(InputMarshaller.java:391) at org.drools.marshalling.impl.InputMarshaller.readFactHandles(InputMarshaller.java:326) at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshaller.java:205) at org.drools.marshalling.impl.DefaultMarshaller.unmarshall(DefaultMarshaller.java:91) at org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapshot(JPASessionMarshallingHelper.java:91) ... 208 more Thanks, Nick -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/EvalConditionNode-cannot-be-cast-to-org-drools-reteoo-RightTupleSink-tp2660572p2660572.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] Referenced file contains errors (http://drools.org/schema/drools-spring.xsd)
I wasn't getting this error before but all of a sudden eclipse started showing this error message. I'm using drools 5.1.1 (it also happens with 5.1.0). Here is how my schema definition looks: http://drools-java-rules-engine.46999.n3.nabble.com/file/n1335740/drools-xsd.jpg and here is the eclipse error message [ 10, 1 for each flow I have :) ] http://drools-java-rules-engine.46999.n3.nabble.com/file/n1335740/drools-xsd-error-message.jpg Drools Spring integration is working fine and all my flows run without problems but nonetheless the error messages are annoying and I would like to have a clean project. I saw in other posts that a couple of ppl had the same problem. Anyone has been able to solve it? I appreciate the comments! Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Referenced-file-contains-errors-http-drools-org-schema-drools-spring-xsd-tp1335740p1335740.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] Timers' Week :)
Hi cafebabe, Thanks for the update. I'm trying my tests and I am not being able to get timer running using persistence. I create the session this way: ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); I know all configuration is correct and persistence as its own is working fine (i.e. I can suspend, resume flows, and complete work items without problems) but timer is not being triggered when I call ksession.fireUntilHalt() and the session was created with JPAKnowledgeService class. I am using the latest code from trunk as of yesterday July 26th. Do you mind ziping up your example and uploading it here. Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Timers-Week-tp912807p999422.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] Timers' Week :)
Hi Kris, Thanks for the post! I believe this thread was created before the fixes came in. I have not had the chance to test the latest code yet. I will look at the test case you mention and will bring in the trunk and run my tests. I'll update the thread after I run my stuff :) Thanks, Nick -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Timers-Week-tp912807p985599.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] Timers' Week :)
Hi retov, Given that the timers do not work when using persistence I haven't been able to test the scenario you described. I did test timer behavior when an exception is thrown from within the workItemHandler that has a timer attached to it. And in this case the timer keeps working, that is, it does not stop if you exit workItemHandler abnormally. But remember, this is without persistence enabled. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Timers-Week-tp912807p984236.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] Implementing Timers With Drools Persistence Enabled
Thanks for the post!!! Have you tried it? I'll update dependencies and try to run it. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Implementing-Timers-With-Drools-Persistence-Enabled-tp923142p978887.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] Timers' Week :)
Hi retoy, Thanks for your comment ;) Just wanted to mention that halt() should not be used to stop a timer. A timer should stop once the flow execution moves away from it to the next node. ksession.halt() might halt other things running on the session and not only the timer. Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Timers-Week-tp912807p978881.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] Implementing Timers With Drools Persistence Enabled
Hi cafebabe, Thanks for your comment. I agree with you that work item ids are database primary keys but in this simple (very simple) case I just decided to harcoded as I know for a fact that the work item id is 1 because that is the only work item and each time I run the test the tables are dropped and recreated. So, there is never more than one row in the workItemInfo table and the only row always has 1 as its id. I could have stored the work item id or a work item object as a variable (like you mentioned) but in this case wouldn't make a difference for the timers. Are timers working for you when you use persistence? I do complete work items by workItem.getId() in all my code (other than this simple example :)). My problem is NOT completing the work item, my problem is triggering timers when persistence is enabled. The timers don't even trigger, thing that should happen before even trying to complete the work item. Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Implementing-Timers-With-Drools-Persistence-Enabled-tp923142p961658.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] Implementing Timers With Drools Persistence Enabled
Hi salaboy, Any luck? Any updates/news? Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Implementing-Timers-With-Drools-Persistence-Enabled-tp923142p939325.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] Implementing Timers With Drools Persistence Enabled
Hi Salaboy, Have you had a chance to look into this? Let me know if you have any findings. Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Implementing-Timers-With-Drools-Persistence-Enabled-tp923142p931029.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] Implementing Timers With Drools Persistence Enabled
Hi salaboy, Here is an image of my flow: http://drools-java-rules-engine.46999.n3.nabble.com/file/n923330/SnapShot.jpg Here is the flow definition: 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="simple-embeded-timer-with-persistence" id="simple-embeded-timer-with-persistence" package-name="com.flow" > System.out.println(" Timer Triggered "); System.out.println(" WorkItem Completed!!! Finishing Flow "); Here is the test code: @Test public void shouldStartFlowAndSuspend() { /* * Persistence enabled - Timer does NOT work!!! */ ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, droolsEnvironment); /* * Persistence disabled - Timer DOES work!!! */ //ksession = kbase.newStatefulKnowledgeSession(); sessionId = ksession.getId(); ksession.getWorkItemManager() .registerWorkItemHandler("doNothingHandler", new DoNothingWorkItemHandler()); ksession.startProcess("simple-embeded-timer-with-persistence", null); // start timer thread new Thread() { @Override public void run() { System.out.println(" Timer thread started "); ksession.fireUntilHalt(); } }.start(); // Allow timer to run for 10s try { Thread.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } } @Test //NOTE: comment out when not using persistence. public void shouldResumeFlowAndComplete() { ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, null, droolsEnvironment); ksession.getWorkItemManager() .registerWorkItemHandler("doNothingHandler", new DoNothingWorkItemHandler()); ksession.getWorkItemManager().completeWorkItem(1, null); } NOTE: when running WITHOUT persistence the second test method for obvious reasons will fail so it needs to be commented out. Persistence is set up correctly, I've checked the database and everything is being persisted. I can as well resume and complete with no problems BUT the timer is NOT working. Let me know if this is enough and/or if you have any question. Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Implementing-Timers-With-Drools-Persistence-Enabled-tp923142p923330.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] Implementing Timers With Drools Persistence Enabled
Hi All, I was able to implement some timers and they behave as expected until I enable persistence. Timers work (get triggered) when creating the StatefulKnowledgeSession by kbase.newStatefulKnowledgeSession() but they do NOT work (do not get triggered) when creating the StatefulKnowledgeSession by JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); I am calling ksession.fireUntilHalt() from within a new thread and all that. The problem is not getting timers to work, as I have already accomplished this, but the problem is rather getting them to work with persistence enabled. - Has anyone implemented timers while using (having enabled) persistence? - Did you experience any problems such as timers not triggering? - If so, have you found a work around you could share? The timers are being implemented in ruleflow (DRF) and I'm using drools 5.1.0 Any comments are welcome. Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Implementing-Timers-With-Drools-Persistence-Enabled-tp923142p923142.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] Couple of questions about Timers
I'm looking to implement this behavior in ruleflow (DRF) either with the Timer node or the Timers present in the properties of a work item. Thanks! -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Couple-of-questions-about-Timers-tp912788p915073.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] Timer Date definition for Timer nodes
Just to clarify I'm asking about this function in ruleflow (DRF) Thanks! -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Timer-Date-definition-for-Timer-nodes-tp912660p915070.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] Timers' Week :)
Alright... two more: 1. If a process suspends, do timers keep running/firing? 2. Let's say I have workItem_1 --> workItem_2 --> workItem_3 of which "workItem_1" suspends the flow and "workItem_3" has a timer. After reloading the StatefulKnowledgeSession and completing "workItem_1" and moving on do I need to restart the timer for "workItem_3"? I would like to mention some inconsistent behavior I have experienced: - ksession.fireUntilHalt() is not starting the timers, instead ksession.fireAllRules() DOES. - ksession.halt() does not stop the timers (if that is the way I'm supposed to stop them) Any tips or personal experience will be very appreciated. Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Timers-Week-tp912807p912807.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] Couple of questions about Timers
Hi all, I'm working with timers and I have a couple of questions. 1) If I have more than one timer in a ruleflow definition, will ksession.fireUntilHalt()/ksession.fireAllRules() take care of starting/initializing all timers? Is one thread enough for multiple timers or I need to handle timers individually? 2) If my flow terminates (normally or abnormally) do I need to clean/restart the timers? Any help is appreciated. Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Couple-of-questions-about-Timers-tp912788p912788.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] Timer Date definition for Timer nodes
Hi Drools community :) As per the BPMN standard: "In Normal Flow the Timer Intermediate Event acts as a delay mechanism based on a specific time-date or a specific cycle (e.g., every Monday at 9am) can be set that will trigger the Event." So, my question is: Does Drools supports something like this? Can we set, for example, a timer to run once every Monday at 9am? I am familiar with Timer Delay and Timer Period but I am not looking for this behavior. I am rather looking to schedule a specific date and time (e.g. Monday's at 9am). Is this possible? If so, How is it configured? Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Timer-Date-definition-for-Timer-nodes-tp912660p912660.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] Access to variables form sub-flows
try kcontext.getVariable("isManager") -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Access-to-variables-form-sub-flows-tp817279p824541.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] Access to variables form sub-flows
Hi PVM, You have to declare the variable in both flows, the parent flow as well as the sub flow. Then you also have to map it to the sub flow node. To do that, in the parent flow click the sub flow node and in the properties map the variable in "Parameter In Mapping". I hope it helps :) -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Access-to-variables-form-sub-flows-tp817279p818122.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] Can't make OR Diverge Gateway (Split OR) work
Hi Salaboy, Thanks for your reply. Yes, I did that. I even checked directly to the xml just in case there was a bug in the editor. When I change type through the editor I see the split node change from AND to XOR to OR depending on what type I select of course. But at run time only AND and XOR work. For OR I get the problem described above. What I'm trying to achieve is run 2 out of the 3 options. That is, I want to run for example Say Hello and Say Nothing nodes. So, basically 2 of the 3 constrains will be met. Do OR node works for you when more than one constrain is met? Thanks, Nick -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Can-t-make-OR-Diverge-Gateway-Split-OR-work-tp782279p783793.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] Can't make OR Diverge Gateway (Split OR) work
Yes, I did that. I even checked directly to the xml just in case there was a bug in the editor. When I change type through the editor I see the split node change from AND to XOR to OR depending on what type I select of course. But at run time only AND and XOR work. For OR I get the problem described above. What I'm trying to achieve is run 2 out of the 3 options. That is, I want to run for example Say Hello and Say Nothing nodes. So, basically 2 of the 3 constrains will be met. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Can-t-make-OR-Diverge-Gateway-Split-OR-work-tp782279p783789.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] Can't make OR Diverge Gateway (Split OR) work
Hi all, I have this simple BPMN2 flow. http://n3.nabble.com/file/n782279/orflow.jpg When I use a XOR Diverge Gateway "" everything works fine. It also works fine for AND Diverge Gateway "". But when I use OR Diverge Gateway "" Drools complains that [Split node 'Gateway' [4] has no type.] http://n3.nabble.com/file/n782279/exeption.jpg As far as I can see it does have a type of and this is how it looks in the flow definition: Am I missing something here? Did anyone implemented an OR node in a BPMN2 flow successfully? I appreciate any help. Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Can-t-make-OR-Diverge-Gateway-Split-OR-work-tp782279p782279.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] Can NOT map variable to "User Task" in BPMN2
Hi All, 1. I have the following BPMN2 flow. http://n3.nabble.com/file/n780238/flow.jpg 2. With a String type flow variable called "firstName". http://n3.nabble.com/file/n780238/props.jpg 3. "Work Handler" has a WorkItemHandler behind it that just prints out the value of "firstName". Variable "firstName" is mapped in "Parameter Mapping". 4. "User Task" is a Human Task node with just a regular WorkItemHandler behind it that as well just prints out the value of "firstName". There is NO Mina Server involvement, just a common WorkItemHandler. Variable "firstName" is mapped in "Parameter Mapping". 5. "Finished Script" just access "firstName" directly. Results: 1. "Work Handler" executes just fine and prints the value of "firstName". 2. "Finished Script" executes just fine and prints the value of "firstName". 3. "User Task" can NOT find "firstName" and shows the following error: http://n3.nabble.com/file/n780238/error1.jpg Comments: 1. I don't believe it is a mapping problem as I have declared the variable at the flow level and mapped it accordingly to each node. Is not a typo error either as I checked that like more than 100 times :) 2. I have the same example in a Ruleflow (.rf) instead of BPMN2 (.bpmn) and it works just fine. Questions: 1. Is there any difference in mapping in variables to a "User Task" node in BPMN2 vs Ruleflow? Specially when not using the Mina Server and just registering a regular WorkItemHandler? 2. Do I have to declare any kind of "scope" for the variable? "Work Handler" doesn't seem to have any problems and doesn't complain about "scope". 3. Any other ideas why the WorkItemHandler behind "User Task" cannot find "firstName"? I appreciate any comments or ideas. Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Can-NOT-map-variable-to-User-Task-in-BPMN2-tp780238p780238.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] Multiple timers in a single ruleflow
Anyone??? Nobody ever needed more than one timer in single flow??? -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Multiple-timers-in-a-single-ruleflow-tp744541p756815.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] Multiple timers in a single ruleflow
Some interesting findings but the main question still remains the same. 1. If you have more than one timer ksession.fireUntilHalt() doesn't work. 2. Only way to get more than one timer working is by calling ksession.fireAllRules(). 3. If you trigger the timers with ksession.fireAllRules() then ksession.halt() doesn't work. So, 1. Does Drools support use of multiple timers in a single ruleflow? 2. Did anybody implemented multiple timers? If yes, How did you approached this? -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Multiple-timers-in-a-single-ruleflow-tp744541p745953.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] Multiple timers in a single ruleflow
Hi guys, I am trying to implement multiple timers in a single ruleflow. I am trying to achieve: 1. Multiple timers running at the same time. 2. Multiple timers running consecutively. It seems to me that the current implementation will not allow for this kind of behavior out of the box. ksession.fireAllRules() and ksession.halt() are very wide spread (as they act on the session and apply to “AllRules”) and don’t leave room to indicate what timer you want to start and which one to stop. This might work OK if you have only one timer, but if you have more than one: ksession.halt(); will stop all timers. And this is no good if you want to stop only a “specific” one and have others keep running. ksession.fireAllRules() will start all timers including timers you already stopped. E.g. a flow with 2 timers, you want to run first timer to send an email periodically while your flow is suspended on Human Task. Once the flow is resumed you’ll want run a second timer, down further on the flow, which waits in a second Human Task node. This works OK to the point where you do kesession.fireAllRules() to start the second timer and get the first timer running again as a bonus :) Has anybody implemented multiple timers? Any idea how to approach this? I appreciate any comments, Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Multiple-timers-in-a-single-ruleflow-tp744541p744541.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???
@Kris Do you have any tips for this? Am I interpreting your AbstractWorkItem implementation for exception handling correctly. Anybody else is very welcome to comment as well. Thanks, Nick. -- View this message in context: http://n3.nabble.com/How-to-do-Exception-Handling-tp689387p725237.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] Building from source
Hi Steban, Thank you so much for your post. I will try that and hopefully it will go just fine. If I have any problems/questions I'll post back here :) Thanks, Nick -- View this message in context: http://n3.nabble.com/Building-from-source-tp722456p723111.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] Building from source
Hi all, Could anyone please post a "step-by-step" guide in how to build Drools from source. I have never built it from source and I know that there is lot of people out here that does it. Something simple and clear as a 1. 2. 3. .. guide. Thank you very much!!! Nick. P.S. I'm doing my homework and investigating as well :) -- View this message in context: http://n3.nabble.com/Building-from-source-tp722456p722456.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 Flow: NPE when completing a work item
Thanks a lot Mauricio!!! It is very appreciated. Nick. -- View this message in context: http://n3.nabble.com/Resuming-Flow-NPE-when-completing-a-work-item-tp716847p721634.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] Timer node issue when using ksession created with JPAKnowledgeService
Hi all, I successfully implemented a Timer node and trigger it by doing: final StatefulKnowledgeSession ksession = knowledgeBase.newStatefulKnowledgeSession(); new Thread(new Runnable() { public void run() { ksession.fireUntilHalt(); } }).start(); But when I've drools persistence in place and use the JPAKnowledgeService to create the knowledge session the timer doesn't run at all. I checked and the thread is being spawned but when ksession.fireUntilHalt() is called nothing happens. final StatefulKnowledgeSession ksession = JPAKnowledgeService .newStatefulKnowledgeSession(knowledgeBase, null, env); new Thread(new Runnable() { public void run() { ksession.fireUntilHalt(); } }).start(); Environment looks like this: Environment env = KnowledgeBaseFactory.newEnvironment(); env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf); env.set(EnvironmentName.GLOBALS, new MapGlobalResolver()); I am trying different things but haven't been able to make it work yet. So, the question is: Can I run a timer when having drools persistence in place? If yes, how can I achive this? Any tips and/or ideas are appreciated. Thanks, Nick. P.S. I "kind" of answered my own questions but I have some other new questions :) Please keep reading below! - I was able to fire the timer when having drools persistence in place using ksession created with JPAKnowledgeService. I got it running by calling ksession.fireAllRules() instead of ksession.fireUntilHalt(); QUESTIONS: a. is it ok to fire a timer by calling fireAllRules()? b. should we still be able to fire the timer with fireUntilHalt() in this situation? c. are there any difference to be considered when firing with fireAllRules() vs. fireUntilHalt()? Thanks, Nick. -- View this message in context: http://n3.nabble.com/Timer-node-issue-when-using-ksession-created-with-JPAKnowledgeService-tp721630p721630.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 Flow: NPE when completing a work item
Hi Mauricio, My test cases are business components that I can't share. But this is just a very simple situation, nothing complicated here. You can do a very simple flow that will suspend in a workItem to which you pass a Long (or Integer) and then after it has been persisted try to reload it to complete the work item... In my case, I'm suspending in a HumanTask that just has a regular WorkItemHandler behind (no Mina server), I am mapping a parameter of type Long. I have also tried the Integer option provided in the graphical eclipse editor and none of them worked. When the flow is resuming and those variables are getting restored I get the exception indicated on the first post. I wanted to point out that it is working fine when the parameter mapped is a String instead of a Long or Integer. I hope this helps clarifying things. Let me know if you have any other question. Thanks, Nick. -- View this message in context: http://n3.nabble.com/Resuming-Flow-NPE-when-completing-a-work-item-tp716847p719300.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 a simple process involving human task
@Touma I'm doing something very similar and it is working for me. Well, I have a different problem that I'm trying to solve but I am able to successfully resume the flow. I am not using the Mina server either. I am just hooking a regular WorkItemHandler to the HumanTask. This is my flow : (start) --> (Human Task) --> (Print Out Node) --> [end] I start the flow the following way: @Test public void shouldSuspendOnHumanTask() { ksession = JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, null, env); dbLogger = new WorkingMemoryDbLogger(ksession); registerWorkItemHandlers(ksession); //nothing special here I just register my work item handlers. Map params = new HashMap(); params.put( "user", "nick" ); ksession.startProcess("approval", params); } The WorkItemHandler for the HumanTask doesn't complete the workItem so the flow suspends and gets persisted. I reload and resume the flow the following way: @Test public void shouldResumeFlow() { System.out.println("Resuming flow..."); MyDAO dao = new MyJpaDAO(emf.createEntityManager()); MyEntity myEntity = dao.findById(ID); //id of the entity that holds the session id for the flow I want to resume ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( myEntity.getSessionId(), knowledgeBase, null, env ); registerWorkItemHandlers( ksession ); //register work item handlers again. dbLogger = new WorkingMemoryDbLogger( ksession ); ksession.getWorkItemManager().completeWorkItem( myEntity.getWorkItemId(), null ); } The only thing to notice which is different and will vary depending on your implementation is that I am using an Entity to store the different IDs that I'll need. So, before the flow suspends I persist this entity and when the flow resumes I use DAO to retrieve it. My entity looks something like: MyEntity { private long id; //entity id private int sessionId; //drools-flow session id private int processInstanceId; //drools-flow process instance id private int workItemId; //drools-flow work item id ... //Constructor //Setters and Getters } So, before resuming the flow I retrieve this entity and then use "myEntity.getSessionId()" to reload the flow. Oh, just in case... my "env" drools runtime environment object looks like this: env = KnowledgeBaseFactory.newEnvironment(); env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf); env.set(EnvironmentName.GLOBALS, new MapGlobalResolver()); I think that's it.. It resumes and the "Print Node" executes and the flow completes. Let me know if you need more details or explanation about what's presented above. I hope it helps!!! Nick. -- View this message in context: http://n3.nabble.com/Resuming-a-simple-process-involving-human-task-tp716250p719197.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???
@Kris Thanks for the input. While I keep investigating on my side I thought of asking you this quick question given that you said this might be trivial to do I am implementing an AbstractWorkItemHandler that catches exceptions and the intention is to map these to Faults with the same name. (just as you mentioned) I then would like to raise a Fault from my AbstractWorkItemHandler and handle these faults with Process Exception Handlers that might signal an event for further processing of the Fault. Now the question is: Can I raise a Fault programmatically in my AbstractWorkItemHandler (i.e. without having any Fault Nodes in my workflow definition) ? If yes, how can I do this? Please let me know if you have any question. Thanks, Nick. -- View this message in context: http://n3.nabble.com/How-to-do-Exception-Handling-tp689387p718847.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 Flow: NPE when completing a work item
Hi Mauricio, Thank you very much for you comments. I am mapping a single variable type Long. Could you please look at posts above as I think they might have a good point. There it seems that the getWorkItem method is creating a MarshallerReaderContext with a "null" value for the ruleBase argument: public WorkItem getWorkItem() { if ( workItem == null ) { try { ByteArrayInputStream bais = new ByteArrayInputStream( workItemByteArray ); MarshallerReaderContext context = new MarshallerReaderContext( bais, null, // THIS IS a RULEBASE < null, null ); workItem = InputMarshaller.readWorkItem( context ); This in turn ends up creating a NPE when the "null" ruleBase is used. protected Class< ? > resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { String name = desc.getName(); try { return Class.forName(name, false, this.ruleBase.getRootClassLoader()); // HERE IS WHERE THE NULL POINTER EXCEPTION OCCURS <<< since the RuleBase is NULL } catch (ClassNotFoundException ex) { return super.resolveClass( desc ); } } This is explained in more detail in the posts above. Do you think this could be the issue? Am I following (and understanding) Drools src code correctly? I appreciate your help! Thanks, Nick. -- View this message in context: http://n3.nabble.com/Resuming-Flow-NPE-when-completing-a-work-item-tp716847p718601.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 Flow: NPE when completing a work item
Hi Mauricio, I am setting my "env" the following way: env = KnowledgeBaseFactory.newEnvironment(); env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf); env.set(EnvironmentName.GLOBALS, new MapGlobalResolver()); My registerWorkItemHandlers() method registers workItemHandlers the following way: manager.registerWorkItemHandler("SomeHandler", new SomeHandler()); manager.registerWorkItemHandler("SomeOtherHandler", new SomeOtherHandler()); After configuring the environment and registering the workItemHandlers I reload the Session as follow: ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( SESSION_ID, knowledgeBase, null, env ); I am using the same knowledgeBase I used to originally start the workflow, the sessionId is the correct as I can see this on the DB, and I think I'm setting the "env" correctly as well. I hope this gives you a better picture of what is going on. Please let me know if you have any questions. Thanks, Nick. P.S. I agree with Tolitius... if I don't have any "Parameter Mapping" variables going in the workItem it runs fine. But whenever I have a Parameter Mapped for the workItem I get this error. -- View this message in context: http://n3.nabble.com/Resuming-Flow-NPE-when-completing-a-work-item-tp716847p717407.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] Resuming Flow: NPE when completing a work item
Hi, I found this question repeated three times on this user list without any answers. I would, however, appreciate one. We have a point where the flow reached a wait state and suspended. Now we are resuming the flow [by running a different test] and trying to complete the work item, as it is suggested by some posts on this user list. However we are getting a Null Pointer Exception here [ at org.drools.marshalling.impl.MarshallerReaderContext.resolveClass(MarshallerReaderContext.java:78) ]. If you have any ideas, it would be helpful. Thank you. // COMPLETING WORK ITEM: ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( rwi.getSessionId(), knowledgeBase, null, env ); registerWorkItemHandlers((WorkItemManager) ksession .getWorkItemManager(), ksession); dbLogger = new WorkingMemoryDbLogger( ksession ); ksession.getWorkItemManager().completeWorkItem( rwi.getWorkItemId(), null ); // EXCEPTION: java.lang.NullPointerException at org.drools.marshalling.impl.MarshallerReaderContext.resolveClass(MarshallerReaderContext.java:78) at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source) at java.io.ObjectInputStream.readClassDesc(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at org.drools.marshalling.impl.InputMarshaller.readWorkItem(InputMarshaller.java:829) at org.drools.persistence.processinstance.WorkItemInfo.getWorkItem(WorkItemInfo.java:86) at org.drools.persistence.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:90) at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:46) at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:12) at org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:254) at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:118) at com.jpmc.admincenter.flow.ApprovalFlowPersistenceTest.shouldResumeFlow(ApprovalFlowPersistenceTest.java:103) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Test Execution Finished -- View this message in context: http://n3.nabble.com/Resuming-Flow-NPE-when-completing-a-work-item-tp716847p716847.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] Issue with drools-flow/persistence
I found why persistencebytearray and the other fields (columns) where being persisted as NULL by the framework. And that is because I was overriding the "hibernate.transaction.factory_class" as follows: in my persistence.xml. I removed that tag from my persistence.xml and now the framework persists the byteArray columns and other fields. -- View this message in context: http://n3.nabble.com/Issue-with-drools-flow-persistence-tp101623p716714.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] Issue with drools-flow/persistence
I am getting exactly the same error in the exactly same way. Any one knows what might we be doing wrong? By looking at the database I noticed that for both tables (workiteminfo and processinstanceinfo) the column "workitembytearray" and "processinstancebytearray" respectively have all NULL entries. And the exception seems to be thrown from org.drools.persistence.processinstance. WorkItemInfo getWorkItem() { ByteArrayInputStream bais = new ByteArrayInputStream( workItemByteArray ); . } AND ProcessInstanceInfo getProcessInstance(...,...) { . ByteArrayInputStream bais = new ByteArrayInputStream(processInstanceByteArray); .. } Any ideas why this is happening and how to solve it? Anything is very welcome. Thanks, Nick. -- View this message in context: http://n3.nabble.com/Issue-with-drools-flow-persistence-tp101623p716438.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???
What I'm trying to do is a little different I have a ruleflow with a workItem node which has a workItemHandler behind it. My workItemHandler will call an external system which might throw an exception. I DO NOT want to catch the exception in the code (or I might but after doing something with the exception I will re-throw a runtime exception from my workItemHandler). I want to have a Process or Composite node ExceptionHandler to catch this runtime exception and then signal an event to do the real handling (work). I have been able to do this but only with drools "Faults". So, the only type of exception that I am being able to handle with the Process or Composite node handler are "FAULTS" being raised by a "Fault" node. If I throw a runtime exception from within my workItemHandler the ExceptionHandler defined in the Process or Composite node is not catching it. So, my questions are: 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)? Any ideas? Thanks, Nick. -- View this message in context: http://n3.nabble.com/How-to-do-Exception-Handling-tp689387p690938.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] How to do Exception Handling???
I have a ruleflow that handles exceptions when they are raised by a "Fault" node but I am not being able to accomplish the same if an exception is thrown by a workItem or an action node instead. I have a workItem node with a work item handler that throws a RuntimeException. My exception handler in the composite node is not catching this exception. So, question 1) how can I handle runtime exceptions thrown by my workItemHandlers? 2) how can I get a hold of the exception to log the stack trace? Any ideas or tips are very appreciated. Nick. -- View this message in context: http://n3.nabble.com/How-to-do-Exception-Handling-tp689387p689387.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-Gunvor
Hi srikar, Check out this link to Drools documentation http://www.jboss.org/drools/documentation.html There you have documentation fro Guvnor that should get you going. I hope it helps! -- View this message in context: http://n3.nabble.com/Drools-Gunvor-tp470499p470891.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] Process with WSHumanTaskHandler
Hi Salaboy, Thank you for a quick response. To make my question a little bit more specific... Here is the approach we are thinking to take: We have a long running process that has a human-task node in it. We use a stateful JPA session, so once the flow reaches the wait state (human-task) it gets persisted to the data store. After that, lets say 2 months later ( we are thinking of using a WSHumanTaskHandler out of the box ), we have a client connecting to a Mina Server, fetching the work item and completing it. Which JVM will the flow continues in? Mina Server JVM? Mina Client JVM? Do we need to have a different JVM where Workflow Engine is running? If yes, how do we link the fact that the HumanTask was completed to that JVM? Thanks!!! -- View this message in context: http://n3.nabble.com/Process-with-WSHumanTaskHandler-tp469303p469839.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] Process with WSHumanTaskHandler
Before I try to get an example working I thought it would be a good idea to post this as it might just be a quick answer to my question. Lets say I have a process with a Human Task and I'm using WSHumanTaskHandler. (Start) --> [Action] --> [Human Task] --> [action] --> . --> (end) The process requires manual intervention (approval from supervisor) so when I get to Human Task my process will get persisted. Now, it is not until next day that the supervisor makes the approval and the Human Task gets mark as completed. Question: will my process be resumed after this and run to completion? or human task will be marked as complete but process will NOT continue? Thanks!!! -- View this message in context: http://n3.nabble.com/Process-with-WSHumanTaskHandler-tp469303p469303.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] Process in GWT Console
Thanks! Yes, I've seen that and looked where to change it and everything but I was wondering about doing it on a declarative way... like using a config file. I read some posts that said you can also use the drools.workItemHandlers proerty in the drools.rulebase.conf file. Something like: drools.workItemHandlers = myWorkItemHandlers.conf And then specifying a file myWorkItemHandlers.conf where you'll map your work item handlers. I was wondering if anybody had done it this way. If you have, can you specify the details? Thanks, -- View this message in context: http://n3.nabble.com/Process-in-GWT-Console-tp468883p469259.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] Process in GWT Console
I can run simple processes through the gwt console but now I'm trying to deploy a process that uses a WorkItemHandler. Gwt console server doesn't know about this work item handler and when execution gets to that point it complains saying that it didn't find a work item (Of course!!!). So, question is. How do I register my work item handler and make gwt-console-server aware of it so it can find it at execution time? Thanks -- View this message in context: http://n3.nabble.com/Process-in-GWT-Console-tp468883p468883.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] WorkItemHandler in Guvnor and GWT Console
I've deployed a ruleflow that uses a WorkItemHandler. How can I make guvnor and gwt console aware of my WorkItemHandler? How can I map my handler to a particular flow and work item? I read that you can specify something like: drools.workItemHandlers = MyWorkItemHandlers.conf in the drools.session.conf file. I don’t seem to find this file… the closest I find is drools.defaul.rulebase.conf but specifying it in this file doesn’t seem to work. 1. Do you know where can I declare drools.workItemHandlers = MyWorkItemHandlers.conf? 2. How do I map the handler name to the handler class in MyWorkItemHandlers.conf? Is it “work item handler name” = “work item handler class” (e.g. approvalWorkItemHandler = com.mydrools.ApprovalWorkItemHandler)? I have deployed a .jar file containing my WorkItemHandler to guvnor and gwt console lib folder and specified the above configuration in drools.default.rulebase.conf but gwt console keeps saying that it didn’t find a work item handler for the process. Any help is appreciated! Anyone that has successfully deployed a process using a WorkItemHandler to guvnor and run it on gwt console could you please let me know how you've done it? -- View this message in context: http://n3.nabble.com/WorkItemHandler-in-Guvnor-and-GWT-Console-tp465985p465985.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] GWT Console issue
Hi ram ram, Thanks for the tip. That worked and I was able to run my process!!! Now, I am trying to get the graphical and reporting capabilities working. When I run the process it sits in a wait state for a little bit and while it is in RUNNING state I'm trying to get the graphical representation of the process and the indication where in the flow exactly is the process sitting. I believe this is through the button "diagram" available for the process instance while in state RUNNING. But when I click on "diagram" i get a message saying that there is no diagram associated with this process. - Do you know if I'm missing something here? Should that be available out of the box or I need to enable/configure something? How do I associate a diagram to my process if that is what I need to do? - I am also planing to move on into reporting I have already set up birt and the report examples...I am trying to get birt pointing to MySQL because there is where I have my hystorylog table now. Of course, I'm getting some errors which I will specify later if I don't solve them. But I was wondering if you had enabled reporting successfully and if you have any tips or direction on this. Thanks a lot, any comments are very welcome. -- View this message in context: http://n3.nabble.com/GWT-Console-issue-tp448038p455638.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] Question About Programmatically Creating Drools Rules Remotely
I created a package in Guvnor and uploaded a ruleflow. You can also deploy the rulflow to Guvnor through Eclipse plugin. Then build the package in guvnor. You'll see this option by clicking in the package you have your ruleflow. Once it builds correctly you can consume this by doing the following: KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); try { kbuilder.add( ResourceFactory.newUrlResource( "http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/default/LATEST";), ResourceType.PKG ); for ( KnowledgeBuilderError error: kbuilder.getErrors() ) { System.out.println(error); } knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase(); knowledgeBase.addKnowledgePackages( kbuilder.getKnowledgePackages() ); } catch (Throwable t) { System.out.println(t.toString()); } My package is named "default" but you can name it whatever you want. Note that you have to use ResourceFactory.newUrlResource() and passed the URL (Guvnor also provides you with the URL to your package) and declare type as ResourceType.PKG. This is working for me -- View this message in context: http://n3.nabble.com/Question-About-Programmatically-Creating-Drools-Rules-Remotely-tp452619p453503.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] GWT Console issue
Hi ramram, I checked deploy\gwt-console-server-drools-5.1.0.R1.war\WEB-INF\classes\META-INF\ and there is no orm.xml file there. There is only the persistence.xml I listed in previous post. Any other idea? Thanks! -- View this message in context: http://n3.nabble.com/GWT-Console-issue-tp448038p453488.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] GWT Console issue
Hi ramram, Thanks for your quick reply. I implemented your suggestions and this is how my persistence unit looks. But I am still getting an error, though a different one. Please see below for error log. persistence.xml org.hibernate.ejb.HibernatePersistence java:jdbc/testDS1 org.drools.persistence.session.SessionInfo org.drools.persistence.processinstance.WorkItemInfo org.drools.persistence.processinstance.ProcessInstanceInfo org.drools.persistence.processinstance.variabletypes.JPAPersistedVariable org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo org.drools.persistence.processinstance.variabletypes.SerializablePersistedVariable .. server.log 2010-03-16 12:47:13,294 ERROR [STDERR] javax.persistence.PersistenceException: org.hibernate.MappingException: Named query not known: ProcessInstancesWaitingForEvent 2010-03-16 12:47:13,294 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(AbstractEntityManagerImpl.java:106) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.persistence.processinstance.JPASignalManager.getProcessInstancesForEvent(JPASignalManager.java:50) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.persistence.processinstance.JPASignalManager.signalEvent(JPASignalManager.java:29) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.setState(WorkflowProcessInstanceImpl.java:191) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.node.EndNodeInstance.internalTrigger(EndNodeInstance.java:56) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:112) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:148) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:135) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:62) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:58) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:112) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:148) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:135) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:112) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:16) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:185) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:230) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1689) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:289) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:52) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:14) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:254) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:163) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.integration.console.DroolsFlowCommandDelegate.startProcess(DroolsFlowCommandDelegate.java:125) 2010-03-16 12:47:13,294 ERROR [STDERR] at org.drools.integration.console.DroolsFlowProcessManagement.newI
Re: [rules-users] GWT Console issue
Thanks ramram!!! That defenitely helped to get rid of that error. Now I can see my process in gwt-console, which is very encouraging :) But when I try to start the process I get the following error: 2010-03-16 09:35:09,495 ERROR [STDERR] java.lang.IllegalArgumentException: Unknown entity: org.drools.persistence.processinstance.ProcessInstanceInfo 2010-03-16 09:35:09,495 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:215) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.drools.persistence.processinstance.JPAProcessInstanceManager.addProcessInstance(JPAProcessInstanceManager.java:33) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.drools.process.instance.AbstractProcessInstanceFactory.createProcessInstance(AbstractProcessInstanceFactory.java:37) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1706) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1682) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:289) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:52) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:14) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:254) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:163) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.drools.integration.console.DroolsFlowCommandDelegate.startProcess(DroolsFlowCommandDelegate.java:125) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.drools.integration.console.DroolsFlowProcessManagement.newInstance(DroolsFlowProcessManagement.java:64) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.drools.integration.console.DroolsFlowProcessManagement.newInstance(DroolsFlowProcessManagement.java:60) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.jboss.bpm.console.server.ProcessMgmtFacade.newInstance(ProcessMgmtFacade.java:189) 2010-03-16 09:35:09,495 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2010-03-16 09:35:09,495 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 2010-03-16 09:35:09,495 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 2010-03-16 09:35:09,495 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68) 2010-03-16 09:35:09,495 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 2010-03-16 09:35:09,495 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChai