Drools flow web console (5.1.M1) deployment in JBoss
by satjo
Could some one share the experience in getting the Drools Flow 5.1 web
console working in JBoss?
I downloaded the “Standalone Guvnor with JBoss AS” (Drools 5.1.0.M1 Guvnor
Standalone) from the download site.
As it did not have the gwt-console war files
(gwt-console-server-drools-{version}.war and
gwt-console-drools-{version}.war) in the Standalone download, I built them
from source code and deployed in JBoss.
I uploaded a test rule flow in Guvnor’s default package and rebuilt the
package.
After log into gwt-console, when I click on process definition, I see a
HTTP 500 error ‘class com.google.gwt.http.client.RequestException', ‘ Could
not initialize stateful knowledge session: null’.
Any comments on the required steps for viewing the process definitions are
appreciated.
satjo
--
View this message in context: http://www.nabble.com/Drools-flow-web-console-%285.1.M1%29-deployment-in-...
Sent from the drools - user mailing list archive at Nabble.com.
15 years
Once the engine gets the package from guvnor, how to cache it and make it independent of guvnor.
by Wesley Akio Imamura
Hi,
I'm using this drools 5.0 scenario: agent using changeset file pointing to a
LATEST package guvnor URL.
The guvnor docs says how to start the agent resource scanning to make the
engine change aware:
- ResourceFactory.getResourceChangeNotifierService().start();
- ResourceFactory.getResourceChangeScannerService().start();
I suppose once the agent gets the packages from guvnor and caches it, it
should not need guvnor anymore unless there are changes. The agent could use
the cache and guvnor could be offline for a long time. This worked on
version 5 M1. You could even restart the engine and it started using the
cached version.
The problem I have with the latest 5.0 with new Knowledge classes ang
changeset.xml: when guvnor is offline, the resource scanning detects this
and unsubscribes the package, leaving the engine without any knowledge. When
guvnor is up again, the resource scanning cannot detect it, and the engine
remains without any knowledge.
How do I tell the agent to not unsubscribe url's that are offline, not to
remove their knowledge and just use the cache ?
Can I still configure the cache directory ?
Maybe the problem I have is that I'm using the LATEST packages and not
snapshots ?
The point here is to make the engine totally independent of Guvnor when it
got a package once.
Hope anyone can help me. Maybe I'll try version 5.1 to see what happens then
guvnor is down.
Thanks,
Wesley.
[2009:10:292 12:10:296:debug] ResourceChangeScanner attempt to scan 0
resources
--
Wesley Akio Imamura
São Paulo - SP - Brazil
15 years
Re: [rules-users] Implementaion of Rule Flow in Guvnor
by Ambika Goel
Hi All,
I have attached the Guvnor repository and the java code that I am using to run a ruleflow.
The two tables 'MasterHud' and 'FeeCalc' are decision tables made in Guvnor.
* MasterHud decision table is used to get the hudLineNumber based on lienPosition and productType.
* FeeCalc table is used to get the fee based on hudLineNumber.
I have created a ruleflow 'Fee.rf' which connects these two tables.
Below is the code I use to call Fee.rf:
public static void main(String args[]){
try{
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
LoanDetail l = new LoanDetail();
l.setLienPosition("Second Lien");
l.setProductType("ABC");
ksession.insert(l);
ksession.startProcess("hudRule");
ksession.fireAllRules();
System.out.println("Hud Line Number: " +l.getHudLineNumber());
System.out.println("Fee: " +l.getFee());
ksession.dispose();
}catch(Throwable t){
t.printStackTrace();
}
}
private static KnowledgeBase readKnowledgeBase()throws Exception{
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newUrlResource("http://localhost:8080/guvnor/org.drools.guvnor.Guvnor/package/com.example..."),ResourceType.PKG);
kbuilder.add(ResourceFactory.newClassPathResource("Fee.rf", Test.class), ResourceType.DRF);
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if(errors.size()>0){
for(KnowledgeBuilderError error : errors){
System.err.println(error);
}
throw new IllegalArgumentException("Could not parse knowledge.");
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
}
When I run this code, I get the Hud Line Number as 801 but the fee displayed is 0.0
The expected output is Hud Line Number as 801 but the fee displayed as 450.
There is no exception but I don't get the desired output.
________________________________
From: Ambika Goel
Sent: Monday, October 12, 2009 1:09 PM
To: 'rules-users(a)lists.jboss.org'
Subject: Implementaion of Rule Flow in Guvnor
I am using the following code to add to knowledge builder and run it:
knowledgeBuilder.add(ResourceFactory.newClassPathResource("QueueFlow.rf", GuvnorTest.class), ResourceType.DRF) // ruleflow
knowledgeBuilder.add(ResourceFactory.newUrlResource("http://..."), ResourceType.PKG) // guvnor package
My rule flow is connection of two tables. I set a property in action of one decision table and use it as a condition in another decision table to get the desired result.
If I run the above code, I don't get any exception but the output is 'null'.
15 years
Re: [rules-users] [Droolsflow] Pagination of getTasksAssignedAsPotentialOwner (Mauricio Salatino)
by Anderson vasconcelos
Hi Mauricio Salatino.
Analysing the code of Drools-Process-Task, i found TaskServiceSession. In
this service , has the entitityManager , and he called the
TasksAssignedAsPotentialOwner.
I just wanna to pass a parameter :
tasksAssignedAsPotentialOwner.setFirstResult(firstResult);
tasksAssignedAsPotentialOwner.setMaxResults(maxResult)
To do this, the best way is override a lot of classes?
DroosProcessTask,Cannot provided this for me?
Thanks
Message: 3
Date: Thu, 29 Oct 2009 15:14:50 -0500
From: Mauricio Salatino <salaboy(a)gmail.com>
Subject: Re: [rules-users] [Droolsflow] Pagination of
getTasksAssignedAsPotentialOwn
er
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<efac615a0910291314g5ad73ddfr649a989bb83e1b9d(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Yes.. also probably you need to extend the named query too..
2009/10/29 Anderson vasconcelos <anderson.vass(a)gmail.com>
> HI
>
> It's possible to build a real pagination search using
> MinaTaskClient.getTasksAssignedAsPotentialOwner() (Using Limit and
Offset)?
> Must I Override the implementation of BlockingTaskSummaryResponseHandler
or
> MinaTaskClient?
>
> Thanks
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
15 years
Rule flow skip ruleSet node.
by liuzhikun
I want increase user age by rule.But ruleSet node trigge only one time.
When execute output:
new Usesr
ageA: 0
inc
ageB: 1
ageA: 1
ageB: 1
ageA: 1
ageB: 1
....
.....
rule:***************************
package t2.state
import t2.state.User;
import java.util.Map;
import java.util.HashMap;
function Map createMap(String key,Object obj){
Map m=new HashMap();
m.put(key,obj);
return m;
}
rule "boot"
dialect "mvel"
when
u : User(age==0)
then
System.out.println(" new Usesr");
kcontext.getKnowledgeRuntime().startProcess("p1rf",createMap("user",u));
end
rule "inc user age"
dialect "mvel"
ruleflow-group "inc age"
no-loop true
when
u : User();
then
System.out.println("inc");
modify(u){age+=1};
end
rule flow:************************************
<?xml version="1.0" encoding="UTF-8"?>
<process xmlns="http://drools.org/drools-5.0/process"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/drools-5.0/process drools-processes-5.0.xsd"
type="RuleFlow" name="p1 rule flow" id="p1rf" package-name="t2.state" >
<header>
<imports>
<import name="t2.state.User"/>
</imports>
<variables>
<variable name="user" >
<type name="org.drools.process.core.datatype.impl.type.ObjectDataType" className="User" />
</variable>
</variables>
</header>
<nodes>
<start id="1" name="Start"/>
<join id="2" name="Restart" type="2"/>
<actionNode id="3" name="changeAge">
<action type="expression" dialect="mvel">System.out.println("ageA: "+user.age);</action>
</actionNode>
<ruleSet id="4" name="user rule" ruleFlowGroup="inc age"/>
<actionNode id="5" name="changeAge">
<action type="expression" dialect="mvel">System.out.println("ageB: "+user.age);System.in.read();</action>
</actionNode>
<split id="6" name="decide" type="2">
<constraints>
<constraint toNodeId="2" toType="DROOLS_DEFAULT" name="go to rest" type="rule" priority="1" dialect="mvel">User(age < 6)</constraint>
<constraint toNodeId="100" toType="DROOLS_DEFAULT" name="go to end" type="rule" priority="2" dialect="mvel">eval(true)</constraint>
</constraints>
</split>
<end id="100" name="End"/>
</nodes>
<connections>
<connection from="1" to="2"/>
<connection from="2" to="3"/>
<connection from="3" to="4"/>
<connection from="4" to="5"/>
<connection from="5" to="6"/>
<connection from="6" to="2"/>
<connection from="6" to="100"/>
</connections>
</process>
liuzhikun
2009-10-30
15 years
supported platforms
by Duane Rosengartner
I have a client that needs a mobile device application and needs to operate with or without tower access. I need a drools engine on one or both of the following.
Does drools have support for running on these platforms?
.Net compact framework
J2ME
15 years
drl 2.0 invoking drl 6.0
by Peter Williams
Anyone think of an obvious way for a fixed (legacy) install of a system running 2.x-era drools to pass control over to modern process (running drls 6).
Would want to pass the fact base across efficiently, but not the active rules/agenda state etc
15 years
JTA question
by Allen Day
I am new to this list, so I apologize if this question has been asked before.
It appears that drools-flow requires JTA in order to use JPA. Is anybody using drools-flow running on WebSphere, because WebSphere uses its' own transaction manager (and the two don't seem compatible). Has anybody looked at the feature request to provide support for resource local transactions -
https://jira.jboss.org/jira/browse/JBRULES-2289
We need to decide soon between Drools Flow & JBPM, and this issue could swing in JBPM's favor.
Thanks,
Allen
NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
15 years
[droolsflow] Jmeter Test
by Anderson vasconcelos
Hi All
I Make a test with Jmeter (http://jakarta.apache.org/jmeter/) to stress my
flow. I Created a Thread Group, to execute 1000 simultaneous users for start
the flow.
I had the follow trouble:
The First users that try to started the process, received this execption:
Caused by: java.lang.NullPointerException
at
org.drools.task.service.MinaTaskClient.addTask(MinaTaskClient.java:43)
at
org.drools.process.workitem.wsht.WSHumanTaskHandler.executeWorkItem(WSHumanTaskHandler.java:161)
at
org.drools.process.instance.impl.DefaultWorkItemManager.internalExecuteWorkItem(DefaultWorkItemManager.java:55)
at
org.drools.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:95)
at
org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:112)
at
org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:148)
at
org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:135)
at
org.drools.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)
at
org.drools.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)
at
org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:112)
at
org.drools.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:16)
at
org.drools.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:185)
at
org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:239)
at
org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1708)
at
org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:288)
at
br.com.dextra.droolsflow.tasks.TaskServiceBean.startProcessFlow(TaskServiceBean.java:68)
After some users, the process starts normal. The problem occur only for the
first users. I Believe that problem is from MinaTaskServer tha was not
started correctly. (Just start, after some calls).
I used to start MinaTaskServer the follow code (This code is inside a Jboss
- MBean):
*
*
*TaskService taskService = new TaskService(*
* this.entityManageSessionFactory, SystemEventListenerFactory
*
* .getSystemEventListener());*
* server = new MinaTaskServer(taskService);*
* Thread thread = new Thread(server);*
* thread.start();*
* Thread.sleep(5000);*
could anybody help me?
Thanks
15 years
Serialization of the StatefullKnowledgeSession
by Nair, Mahesh
Hi,
I am trying to implement one drools rule flow based feature to my application.
My application consists of a struts2 application as well as a rcp desktop application as its client.
We are using satefullKnowledgeSession which we want to keep around in the Http Session because it will be used by multiple requests during a user session.
But the StateFullKnowledgeSession is not serilaizable and hence if I keep it in my http session it will affect the session replication.
I am sure some of you have already faced this issue so was interested to know so of the approaches you took to overcome this hurdle.
One of the approaches we are thinking about is to use the org.drools.marshalling.Marshaller to do the marshalling and get a byte array output and place it inside the session and umarshall that later.
Is this a valid approach?
Thanks
mahesh
________________________________
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
15 years