Re: [rules-users] Need help related to collection of data accessing in rule file.
by prasad raju sagi
Hi ,
I am trying to create rule on a fact , which contains arraylist of collection and the object in the collection internally contains an arraylist of another collection of objects.
This looks like object A contains collection of objects B and B contains collection object C
A -> blist ( Arraylist<B> )
B -> clist (ArrayList<C> )
C-> dlist( ArrayList<D>)
D-> type ( string)
I am inseting A as fact to the working memory.
I am in confusion state like how to write the rule to place conditions on collection C.
Can I use from in the form of nested from in rule statment.
Thanks
Prasad Raju Sagi
Mobile: 847-644-4103
________________________________
From: Aziz Boxwala <boxwala(a)yahoo.com>
To: rules-users(a)lists.jboss.org
Sent: Thursday, June 11, 2009 1:58:28 PM
Subject: [rules-users] process order example not working fully
I am trying to execute a ruleflow and use rules to assign tasks within the ruleflow in Drools 5.0.1. I have a drl file included in my knowledge base that tries to assign a task to a user when a new human task is created. This is based on the example in org.drools.example.process.order. I can't get my code to work. I don't the rules in the example are working either (dslr for the task assignment or the drl for dynamic logging). After some attempts, I found that this condition
WorkItemNodeInstance()
does not evaluate to true ever.
Do I have to do anything special to make the WorkItemNodeInstance appear in working memory?
Thanks for any help.
--Aziz
16 years, 3 months
Flow (human task) and web apps
by Rodrigo
Just a newbie question...
To use drools flow with human tasks in a Seam application for example, i
will need to start a mina server in another thread (and interact by a mina
client), like documentation suggest?
Anyone have a sample web app that use this approach, drools flow + human
task + webapps.
Thanks in advance.
Rodrigo Valério.
16 years, 3 months
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.
16 years, 3 months
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
16 years, 4 months
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'.
16 years, 4 months
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
>
>
16 years, 4 months
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
16 years, 4 months
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
16 years, 4 months
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
16 years, 4 months