How to Call RuleFLow from Servlet
by josh
Drools 5.0
Server Tomcat
I am not able to call RuleFlow from servlet. It doesn’t throw any error, nor
shows the output. However I am able to call single rule(SampleRule.drl.DRL).
Below is the snapshot for the same.
/private RuleBase readRule() throws Exception {
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl(new InputStreamReader(
TestServlet1.class.getResourceAsStream( "/com/sample/SampleRule.drl" ) ) );
builder.addRuleFlow( new
InputStreamReader(TestServlet1.class.getResourceAsStream(
"/com/sample/sampleruleflow.rf" ) ) );
Package pkg = builder.getPackage();
// add the package to a rulebase (deploy the rule package).
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(pkg);
return ruleBase;
}
/
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-Call-RuleFLow-from-Servlet-tp402...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Any API accessing to the rule logic instead of only Facts
by Sean Su
Does anyone know a public Drools API that we can use to access to the
actual rule logic in a structured way? Current we can use
AgendaEventListener and WorkingMemoryEventListener to access the facts
using in LHS and the objects used in RHS. But my project has some special
requirements which need to access the actual rule logic on LHS for auditing
and justification purpose.
For example, if a rule is like this:
when fact.list contains "123"
then do something.
When this rule is fired, not only do I need to know what the fact object
is, I also need to know the condition of this rule is involved a "contains"
API, with value "123".
Thanks in advance.
Sean
11 years, 3 months
Questions On Rule Flow
by josh
I am from WODM background and have a question on rule flow
1). Why do I need to add all the rules or decision tables to the
KnowledgeBuilder object? I have created rule flow with multiple task (rule
task # 1 for myRule1.drl, rule task # 2 for myTable.xls). Shouldn’t it take
all the elements from the rule task automatically that has been added to the
rule flow like WODM does?
KnowledgeBuilder builder = KnowledgeBuilderFactory.newKnowledgeBuilder();
DecisionTableConfiguration config =
KnowledgeBuilderFactory.newDecisionTableConfiguration();
config.setInputType(DecisionTableInputType.XLS);
kbuilder.add(ResourceFactory.newClassPathResource("myRule1.drl",myClas.class),
ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource("myTable.xls"),ResourceType.DTABLE,
config);
kbuilder.add(ResourceFactory.newClassPathResource("myRuleFlow.rf",myClas.class),
ResourceType.DRF);
2). Why do I need to give ‘RuleFlowGroup” in my decision table. If I am
executing table it should execute all the rows based on their condition?
What is the usage of RuleFlowGroup?
3). What is the benefit of using reusable Subtask within rule flow?
Thanks in Advance
--
View this message in context: http://drools.46999.n3.nabble.com/Questions-On-Rule-Flow-tp4025223.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
IntelliFest 2013 (San Diego) - only 10 weeks to go
by Mark Proctor
http://blog.athico.com/2013/07/intellifest-2013-san-diegl-only-10.html
----
Here is the updated flyer for IntelliFest 2013, this October in San Diego. Dr. Ernest Friedman-Hill, the creator ofJess, will be there talking about the new Jess 8.0 release. Also Dr. Daniel Miranker, the creator of the Leaps algorithm (a lazy alternative to the Rete algorithm), will be there talking about web scale distributed pattern matching.
I'll also be there presenting my new algorithm, entitled "From Eager to Lazy : The Evolution of the Rete Algorithm
11 years, 3 months
Why the drools modified object does not reflect the changes when I call the remote web service?
by Nuwan Bandara
When I use the local drools rules instance, object gets updated and
reflects the changes accordingly but when I use the remote web service call
to use the remote drools engine, rules get executed correctly but updated
values does not get reflected back in the return object.
Environment into:
- JBoss 5
- Uses XLS decision table for the drools rules file
- Front end uses jbosseap5 and back-end users JBoss 5
Currently I have drools engine running on front end server (referred as
local) and back-end server (referred as remote) both. When I call the local
drools engine it works. But when I call the remote server through REST web
server function get executed correctly but updated values are not in the
object when it comes back to the front end.
Here’s the function that I use in the decision table (.xls)
function boolean setCTCFlag(Object resultViewMapObj, String siteCode){
boolean flag = false;
Map<String, ResultView> resultViewMap = (Map<String, ResultView>)
resultViewMapObj;
List<ResultView> resultViewList = new ArrayList<ResultView>();
resultViewList = new ArrayList<ResultView> (resultViewMap.values());
ResultView resultView = new ResultView();
resultView = resultViewList.get(0);
if(resultView.getSampleView().getSample() != null){
String sampleInd =
resultView.getSampleView().getSample().getSampleIndicator();
if(sampleInd != null && sampleInd.length() != 0){
String[] sampleIndComp = sampleInd.split(""[^\\w\\s]"");
for(int i = 0; i<sampleIndComp.length; i++){
LabelValueView labelValueView = new
LabelValueView();
labelValueView.setLabel(sampleIndComp[i].trim());
labelValueView.setValue(" ");
// DOTO: this is the issue
// folowing line gets executed but changes do
not get reflected in the object.
// Only happens when this called remotely.
resultView.getDynamicFields().put("CTC_CLIENT_FLAG", labelValueView);
flag = true;
}
}
}
return flag;
}
11 years, 3 months
how to debug rules in JBoss AS?
by Marina
Hello,
I know one can debug rules (put breakpoints in .drl and ruleflow files) when
running/debugging an application as a Drools Application.
However, I would like to debug rules when my application is running in JBoss AS
- just like we do a normal debugging of a Remote application running in a
different JVM ,by enabling the JDWP on the server
(-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n) and then
connecting to the specified port.
Basically, I would like to be able to debug both my Java classes and rules
together. Is it possible?
thanks,
Marina
11 years, 3 months
brms depoylment diagrams
by Ravi Gupta
I am looking for deployment diagrams, from say dev to qa to prod
I know there are several "techniques", snapshots, webdav, import/export
entire repo.
Just wondering if there are some diagrams of rules sdlc in multiple
environments
11 years, 3 months