fusion
by Ravi Gupta
How would one write a rule that checked if say Message has been inserted
into the stream 10 times over the last 30 days?
11 years, 7 months
Re: [rules-users] [uberfire-users] Configurable and Reusable Editor
by Michael Anstis
All Drools and jBPM components use the Uberfire framework.
Any individual component can be used in isolation (subject to inclusion of
any dependencies) by any other Uberfire compliant application.
Vice-versa any 3rd party Uberfire compliant component can be used within
the Kie Workbench extending its functionality.
On 17 May 2013 13:35, "Suminda Dharmasena" <sirinath(a)sakrio.com> wrote:
> Hi,
>
> The components and functionality can be used for larger tools than just
> jBPM and Drools solution through customisation. I think this should be kept
> in mind when developing.
>
> Suminda
> --
> Suminda Sirinath Salpitikorala Dharmasena, B.Sc. Comp. & I.S. (Hon.)
> Lond., P.G.Dip. Ind. Maths. J'Pura, MIEEE, MACM, CEO Sakrīō! ▣ *Address*:
> 6G • 1st Lane • Pagoda Road • Nugegoda 10250 • Sri Lanka. ▣ *Mobile*:
> +94-(0)711007945 ▣ *Tele*: +94-(0)11-5 864614 / 5 875614 / 2 825908 ▣ *Web
> *: http://www.sakrio.com ▣
>
> This email is subjected to the email Terms of Use and Disclaimer:
> http://www.sakrio.com/email-legal. Please read this first.
> --
>
> _______________________________________________
> uberfire-users mailing list
> uberfire-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/uberfire-users
>
11 years, 7 months
Re: [rules-users] NoSuchFieldError: session
by Lance
As it turned out, this problem came about because I had a model that was
based on a POJO jar file. The jar that was in Guvnor contained the
offending field(s), but when the package was being loaded it was using a
version of the jar that did not contain the offending fields. This served
as a lesson to me, demonstrating why updating the serialVersionId is an
important step in managing POJOs.
~ Lance
On Mon, May 6, 2013 at 2:19 AM, Alok [via Drools] <
ml-node+s46999n4023691h60(a)n3.nabble.com> wrote:
> Hi Lance,
> Even i am facing the issue , what was the work around or what is solution
> to fix the issue
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://drools.46999.n3.nabble.com/NoSuchFieldError-session-tp4023263p4023...
> To unsubscribe from NoSuchFieldError: session, click here<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscr...>
> .
> NAML<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_vi...>
>
--
View this message in context: http://drools.46999.n3.nabble.com/NoSuchFieldError-session-tp4023263p4023...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Using Java Rule Engine JSR-94
by abhinay_agarwal
Hey,
I read about JSR-94 and found it quite useful, so was trying to do a POC on
its usage. These are the steps which i followed.
1. Made a new java application.
2. Added the JSR-94 api jars in its build path.
3. Made a rule as myRuleFile.drl
4. Wrote a RuleAdapter class as shown in drools expert document Chapter 5.
The Java Rule Engine
API (JSR94).
But when i tried to run the piece of code, it kept giving me errors related
to Class missing related to drools.
Are are the drools jar required to run this example,if yes, then what is the
avantage of using jsr-94 api ?
If any specific jars, can you please list them out?
If I am doing anything wrong, then, can you please point me to the correct
direction.
Thanks,
Abhinay
--
View this message in context: http://drools.46999.n3.nabble.com/Using-Java-Rule-Engine-JSR-94-tp4023852...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Drools Fusion Dropping Events?
by Jason Barto
I've been working to load test Drools 5.3 to determine if its a fit for a
project. As part of the test I programmatically insert events as rapidly
as possible; an example, my earlier test inserted 10k events in about
300ms. There is currently a single rule which reads the event and stores
the event's value into the only fact in Drools. I'm very happy to report,
and I'm sure it will be no surprise to anyone, that the engine processes
all the events in roughly 1 sec. However I have noticed that any large
number of events (~>1000) usually sees that a small number of events don't
get processed. I think after 10k events as many as 7 appear to have gone
unprocessed. If 100 events are inserted, rather than 10k, no events get
disregarded. Being new to Drools I can easily accept that my java code or
DRL code is off or unoptimized in some way. However not knowing how Drools
does its magic I'm currently inclined to think that Drools gets swamped
(10k in 300ms is a lot) and a few events get dropped so Drools can keep
operating. Is this a known or expected behavior from Drools? If not I am
happy to post my code, it is similar to the other code sets I've posted in
the last few days. I'm still new to Drools and trying to learn its behavior
so any insight or enlightenment is greatly appreciated.
Sincerely,
Jason
11 years, 7 months
Error : JAAS Authentication with Guvnor 5.5.0 and Authorization Error
by Zahid Ahmed
Hi,
I have run into a set of errors configuring JAAS Authentication for Guvnor. I have searched a lot on jboss community and for all the solutions nothing is working for me. I am getting either the login popup or I am getting "This User has no permissions setup". The Guvnor Manual is referring to jboss eap 5 and I am trying to do this on Jboss AS 7.1.
Note : I am unable to find login-config.xml file mentioned in the following link. http://docs.jboss.org/drools/release/5.5.0.Final/drools-guvnor-docs/html/... . Is guvnor deployment targeted only for JBOSS EAP 5.0 ?
Environment:
1. Guvnor 5.5.0.Final
2. JBOSS AS 7.1.0
Files Configured (Only these files I configured):
1. Standalone.xml
2. Guvnor.war/WEB-INF/beans.xml
3. Created users using "add-user.sh"
4. standalone/configuration/application-users.properties (attached).
5. standalone/configuration/application-roles.properties (attached)
6. standalone/configuration/management-users.properties
Configurations
Standalone.xml :
Only configured below tags. There's nothing else I changed for the purpose of JAAS Authentication and Guvnor Authorization. Added <security-domain name="drools-guvnor" cache-type="default"> to check if "other" is not working.
<security-domain name="other" cache-type="default">
<authentication>
<login-module code="Remoting" flag="optional">
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
<login-module code="RealmUsersRoles" flag="required">
<module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>
<module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>
<module-option name="realm" value="ApplicationRealm"/>
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
</authentication>
</security-domain>
<security-domain name="drools-guvnor" cache-type="default">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
<module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>
<module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>
<module-option name="realm" value="ApplicationRealm"/>
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
</authentication>
</security-domain>
Drools-guvnor.war.
1. beans.xml (Tried 4 different configs as suggested on community)
a. Config 1 (Attached "Config1 beans.xml" and Config1 error.txt) . Error "This User has no permission setup".
<security:IdentityImpl>
<s:modifies/>
<!-- JAAS based authentication -->
<security:authenticatorName>jaasAuthenticator</security:authenticatorName>
</security:IdentityImpl>
<security:jaas.JaasAuthenticator>
<s:modifies/>
<jaasConfigName>other</jaasConfigName>
</security:jaas.JaasAuthenticator>
<!-- SECURITY AUTHORIZATION CONFIGURATION -->
<!--
This is used to enable or disable role-based authorization. By default it is disabled.
-->
<guvnorSecurity:RoleBasedPermissionResolver>
<s:modifies/>
<guvnorSecurity:enableRoleBasedAuthorization>true</guvnorSecurity:enableRoleBasedAuthorization>
</guvnorSecurity:RoleBasedPermissionResolver>
b. Config 2 (Attached "Config2 beans.xml" and Config2 error.txt). Error "This User has no permission setup".
<security:IdentityImpl>
<s:modifies/>
<!-- JAAS based authentication -->
<security:authenticatorName>jaasAuthenticator</security:authenticatorName>
</security:IdentityImpl>
<security:jaas.JaasAuthenticator>
<s:modifies/>
<security:jaasConfigName>drools-guvnor</security:jaasConfigName>
</security:jaas.JaasAuthenticator>
<!-- SECURITY AUTHORIZATION CONFIGURATION -->
<!--
This is used to enable or disable role-based authorization. By default it is disabled.
-->
<guvnorSecurity:RoleBasedPermissionResolver>
<s:modifies/>
<guvnorSecurity:enableRoleBasedAuthorization>true</guvnorSecurity:enableRoleBasedAuthorization>
</guvnorSecurity:RoleBasedPermissionResolver>
c. Config 3 (Attached "Config3 beans.xml" and Config1 error.txt). Error (Same error as of Config 1) "This User has no permission setup".
<security:IdentityImpl>
<s:modifies/>
<!-- JAAS based authentication -->
<security:authenticatorName>jaasAuthenticator</security:authenticatorName>
</security:IdentityImpl>
<security:jaas.JaasAuthenticator>
<s:modifies/>
<jaasConfigName>other</jaasConfigName>
</security:jaas.JaasAuthenticator>
<guvnorSecurity:RoleBasedPermissionResolver>
<s:modifies/>
<guvnorSecurity:enableRoleBasedAuthorization>true</guvnorSecurity:enableRoleBasedAuthorization>
</guvnorSecurity:RoleBasedPermissionResolver>
<component name="org.jboss.seam.security.roleBasedPermissionResolver">
<s:modifies/>
<property name="enableRoleBasedAuthorization">true</property>
</component>
I HAVE ALSO ADDED THIS COMPONENT TAG found every where on forums to resolve this issue. I tried Tried without this also but at that time I get LOGIN screen which always says Incorrect User/Password.Is this required or <guvnorSecurity:RoleBasedPermissionResolver> is the only authorization config.
<component name="org.jboss.seam.security.roleBasedPermissionResolver">;
<s:modifies/>
<property name="enableRoleBasedAuthorization">true</property>
</component>
Kindly help me in this configuration. I can't find a single authentic document for my environment.
Regards,
Zahid
11 years, 7 months
Drools 6.0.0.Beta2 Documentation and Examples
by 445511
I'm trying to use Drools 6.0.0.Beta2 but none of the examples appear to be
"Kie"-ified making it difficult to figure out. Is there more up to date
documentation concerning Drools 6 without pooring through source code?
I'm specifically interested in drools + jbpm, new annotations, git
integration, maven integration, new Drools UI (the uberfire one which I'm
still unclear whether this is going to be called guvnor or something
completely different).
I realize how hard it is to work on a project and document at the same time
- especially given the multi-continent talks coming up but this has been an
ongoing struggle with JBoss based projects. The early releases (and even
final) lack sufficient accurate documentation to even evaluate its use. I
can only assume that this substantially reduces support contract
opportunities and frustrates early adopters.
Any pointers will be greatly appreciated.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-6-0-0-Beta2-Documentation-and-Ex...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
NPE from reteoo.AccumulateNode
by jpbarto
First the specifics: JDK 1.6, Mac OSX, using Drools 5.5 Final
The full source code and rules are pasted below but here's the gist, I have
a stateful knowledge session to which I am inserting events and running an
accumulate on the input events. I have a for loop generating the events and
inserting them as rapidly as possible. In the rules I use an accumulator to
calculate the average of the values contained within the events. The
behavior I'm observing is that if I insert ~120 events without any waiting I
receive an NPE. If I Thread.sleep for even just 1ms the test goes off
without a hitch. Have I uncovered a bug which should be logged in JIRA? I
would check through JIRA to see if something similar has been logged but I'm
so unfamiliar with the codebase, not to mention it could all just be user
error.
The NPE is as follows:
Exception in thread "main" java.lang.NullPointerException
at org.drools.reteoo.AccumulateNode.getFirstMatch(AccumulateNode.java:1050)
at
org.drools.reteoo.AccumulateNode.modifyLeftTuple(AccumulateNode.java:345)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateModifyChildLeftTuple(SingleLeftTupleSinkAdapter.java:259)
at
org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:676)
at
org.drools.reteoo.ReteooWorkingMemory$EvaluateResultConstraints.execute(ReteooWorkingMemory.java:590)
at
org.drools.common.PropagationContextImpl.evaluateActionQueue(PropagationContextImpl.java:350)
at
org.drools.rule.SlidingLengthWindow.assertFact(SlidingLengthWindow.java:119)
at org.drools.rule.BehaviorManager.assertFact(BehaviorManager.java:94)
at org.drools.reteoo.WindowNode.assertObject(WindowNode.java:167)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:127)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:55)
at drools5fusioneval.Average.main(Average.java:66)
### Average.java ###
package drools5fusioneval;
import java.io.IOException;
import java.util.Random;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseConfiguration;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.conf.EventProcessingOption;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.rule.WorkingMemoryEntryPoint;
class AvgDFEChannel implements org.drools.runtime.Channel {
@Override
public void send(Object o) {
System.err.println ("Recieved channel message: "+ o);
}
}
public class Average {
public static void main(String[] args) throws InterruptedException,
IOException {
KnowledgeBaseConfiguration kbconfig =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
kbconfig.setOption(EventProcessingOption.STREAM);
KnowledgeBase kbase =
KnowledgeBaseFactory.newKnowledgeBase(kbconfig);
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("drools5fusioneval/average.drl"),
ResourceType.DRL);
if (kbuilder.hasErrors()) {
System.err.println(kbuilder.getErrors().toString());
}
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
final StatefulKnowledgeSession session =
kbase.newStatefulKnowledgeSession();
session.registerChannel("heartbeat", new AvgDFEChannel ());
WorkingMemoryEntryPoint ep01 =
session.getWorkingMemoryEntryPoint("ep01");
new Thread() {
public void run() {
session.fireUntilHalt();
}
}.start();
Thread.sleep (5000); // give the engine time to get setup
Server hiwaesdk = new Server ("hiwaesdk");
session.insert(hiwaesdk);
long LIMIT = 120;
Random rnd = new Random (System.nanoTime());
for (long i = LIMIT; i > 0; i--) {
int j = rnd.nextInt (212);
ep01.insert (new IntEvent (j));
//Thread.sleep (0x1);
}
System.out.println (hiwaesdk);
}
}
### average.drl ###
package drools5fusioneval
declare IntEvent
@role ( event )
@expires(15s)
end
declare Statistics
opsec : long
total : long
end
global Statistics stats;
rule "Init engine"
salience 100
when
then
stats = new Statistics ();
stats.setTotal (0);
stats.setOpsec (0);
drools.getWorkingMemory ().setGlobal ("stats", stats);
System.out.println ("Engine initialized");
end
rule "number rule"
when
$e : IntEvent () from entry-point ep01
$s : Server (hostname == "hiwaesdk")
then
$s.currentTemp = $e.data;
stats.setOpsec (stats.getOpsec () + 1);
stats.setTotal (stats.getTotal () + 1);
end
rule "average temp"
when
Number ($avg : intValue) from accumulate (
IntEvent ($temp : data) over window:length(10) from entry-point
ep01, average ($temp)
)
$s : Server (hostname == "hiwaesdk")
then
$s.avgTemp = $avg;
end
rule "Heartbeat"
timer ( int: 5s 5s)
when
then
channels["heartbeat"].send ("Heartbeat: "+ stats.getOpsec () / 5 +", "+
stats.getTotal ());
stats.setOpsec (0);
end
--
View this message in context: http://drools.46999.n3.nabble.com/NPE-from-reteoo-AccumulateNode-tp402381...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
clustering
by sara ibrahim
hi,
i need to configure Jboss clustering , i tried to apply it in the same server but i couldn't perform Failover
so now i'm trying two different ips at different machines , what should i do exactly?!
REGARDS,
SARA
11 years, 7 months