Maven builds for drools-flow
by Brian Wallis
I'm trying to get a simple standalone drools-flow build working using maven and cannot seem to resolve the dependencies.
What are the dependencies for drools-flow? I've found mention of drools-flow-core and drools-flow-compiler but they are only available for 5.2.0 snapshot and I was wanting to use 5.1.1.
I'm having no end of problems with the 5.2.0-SNAPSHOT dependencies. I've attached the pom and here is the output I get:
t% mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Coding Workflow
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory /Users/bwallis/src/Drools/install/Coding/target
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO] Copying 3 resources
[INFO] snapshot org.drools:drools-flow-core:5.2.0.SNAPSHOT: checking for updates from jboss-public-repository-group
Downloading: https://repository.jboss.org/nexus/content/groups/public/org/drools/drool...
3K downloaded (drools-flow-core-5.2.0.20101123.060233-137.pom)
[INFO] snapshot org.drools:drools:5.2.0.SNAPSHOT: checking for updates from jboss-public-repository-group
Downloading: https://repository.jboss.org/nexus/content/groups/public/org/drools/drool...
[INFO] Unable to find resource 'org.drools:drools:pom:5.2.0.SNAPSHOT' in repository jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:drools-flow-core:jar:null
Reason: Cannot find parent: org.drools:drools for project: null:drools-flow-core:jar:null for project null:drools-flow-core:jar:null
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12 seconds
[INFO] Finished at: Sun Nov 28 14:01:25 EST 2010
[INFO] Final Memory: 18M/81M
[INFO] ------------------------------------------------------------------------
Brian Wallis
InfoMedix | Architect
p: 3 8615 4553 | f: 3 8615 4501
e: brian.wallis(a)infomedix.com.au
Level 5, 451 Little Bourke Street, Melbourne VIC 3000
15 years, 3 months
Drools-server and fact-IDs - emptying/resetting stateful sessions
by flo
Hello,
I'm currently working to setup a experimental drools decision service with
the drools-server component via REST. In the server, I run a stateful
session with rules from a guvnor repo. The stateful session absolutely needs
to stay stateful because I use some of the CEP features in my rules.
What I try to achieve at the moment is to "clean up" this session if my
client (there is just one single client)(re-)connects. That basically means
either to clear out the working memory by doing some retracts, or to reset
the whole server.
So, my first approach was a get-objects command to get handles to all
objects in the working memory (to retract them one after another), but soon
I discovered that the get-objects result doesn't provide fact-ids for its
results. As it seems, the same also applies to queries. But without fact-id,
no retracts can be made.
My second approach to reset the whole session or server also failed, because
there is no dedicated command for this and I'm not enough into java app
server stuff to implement something like that on the fly. But this solution
would also have the advantage that the rules would get reloaded after the
reset, which would really simplify things (as the resource change scanner
obviously doesn't work with guvnor and drools-server - at least I didn't get
it to work, and as it seems the problem is also know on this list).
So my question is - does someone know either how to reset the whole
drools-server via REST or alternatively a possibility how to gather all
facts in the WM with their corresponding fact ids?
Thanks for your help, really appreciate it!
Best regards,
flo
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-server-and-fac...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 3 months
Resuming rule flow using nodeId
by drdaveg
I've been working on a proof-of-concept where microseconds count and I need
more performance than JPAKnowledgeService's hibernate/jpa/jta stack can
provide. I can use process event listener's to get the processId, nodeId,
sessionId to persist the state of a rule flow but can't find an API that
would let me resume a rule flow, BPMN, or BPMN2 module at the node
corresponding to the nodeId.
Any thoughts on the code needed to start the process at the node having a
particular id within a rule flow? Thanks!
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Resuming-rule-flow-us...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 3 months
Problem in getting session from JPAKnowledgeService.newStatefulKnowledgeSession();
by Bennet Joseph
Hi All,
follwoing is the code i used to get the session using
JPAKnowledgeService.newStatefulKnowledgeSession.
table for the mentioned classes are getting created, after that
JPAKnowledgeService.newStatefulKnowledgeSession() method throws following
exception....
EntityManagerFactory emf =
Persistence.createEntityManagerFactory( "org.drools.persistence.jpa" );
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
env.set( EnvironmentName.TRANSACTION_MANAGER,
TransactionManagerServices.getTransactionManager() );
StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
-------------------------
persistence.xml
i copied only persistent unit part...
<persistence-unit name="org.drools.persistence.jpa">
<class>org.drools.persistence.session.SessionInfo</class>
<class>org.drools.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.processinstance.ProcessInstanceEventInfo</class>
<class>org.drools.persistence.processinstance.WorkItemInfo</class>
<class>org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo</class>
<class>org.drools.persistence.processinstance.variabletypes.JPAPersistedVariable</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.BTMTransactionManagerLookup" />
<property name="hibernate.connection.url"
value="jdbc:oracle:thin:@192.168.4.93:1521:POST" />
<property name="hibernate.connection.driver_class"
value="oracle.jdbc.driver.OracleDriver" />
<property name="hibernate.connection.password" value="voms_test"
/>
<property name="hibernate.connection.username" value="voms_test"
/>
<property name="java.naming.factory.initial"
value="bitronix.tm.jndi.BitronixInitialContextFactory"/>
<!--
<property name="hibernate.format_sql" value="true"/>
-->
</properties>
</persistence-unit>
but it throws exception
java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
at
org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:137)
at
org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:61)
* at
org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:109)
at com.sample.FirstTest.main(FirstTest.java:87)*
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:123)
... 3 more
Caused by: java.lang.RuntimeException: Could not commit session or rollback
at
org.drools.persistence.session.SingleSessionCommandService.<init>(SingleSessionCommandService.java:132)
... 8 more
Caused by: java.lang.RuntimeException: Unable to rollback transaction
at
org.drools.persistence.session.JtaTransactionManager.rollback(JtaTransactionManager.java:181)
at
org.drools.persistence.session.SingleSessionCommandService.<init>(SingleSessionCommandService.java:130)
... 8 more
Caused by: java.lang.NullPointerException
at
org.drools.persistence.session.JtaTransactionManager.rollback(JtaTransactionManager.java:178)
... 9 more
15 years, 3 months
forall not delivering as expected
by Wolfgang Laun
Given classes
class Triangle { int a, b, c;... }
class Quadrangle { int a, b, c, d;... }
with appropriate getters (but no hashCode or equals) and these facts
Triangle( 3, 3, 3 )
Triangle( 3, 3, 3 ) // a duplicate, intentional
Quadrangle ( 3, 4, 5, 6 );
the rule
rule "all equilaterals have a 'fitting' quadrangle"
when
forall( Triangle( $a: a, b == $a, c == $a )
Quadrangle( a == $a || b == $a || c == $a || d == $a ) )
then // ...
end
works as expected - it fires.
But the rule
rule "all equilaterals have a duplicate"
when
forall( $t: Triangle( $a: a, b == $a, c == $a )
Triangle( this != $t, a == $a, b == $a , c == $a ) )
then // ...
end
does not fire, not even when I omit this != $t. Why?
Do I have a white spot in my grey cells? Please tint my taint...
-W
15 years, 3 months
How to store Session or session info.
by Bennet Joseph
Hi All,
i am trying to execute the flow, and it is persisting history log in
ProcessInstanceLog and NodeInstanceLog.
if the server crashes, from where i have to retrive the session details.
Thanks,
Jose.
15 years, 3 months
Start TaskServer in Execution Server
by raic
Hi,
There is a way for starting the MinaTaskServer at ExecutionServer startup? I
want to configure TaskServer out of the application and to have it always
"up".
I mean to replace this code from the application to some configuration in
execution server:
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("org.drools.task");
TaskService taskService = new TaskService(emf,
SystemEventListenerFactory.getSystemEventListener());
TaskServiceSession taskSession = taskService.createSession();
taskSession.addUser(new User("Administrator"));
taskSession.addUser(new User("foo"));
taskSession.addUser(new User("foo1"));
MinaTaskServer server = new MinaTaskServer(taskService);
Thread thread = new Thread(server);
thread.start();
Any idea will be appreciated
Thanks!
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Start-TaskServer-in-E...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 3 months
Re: [rules-users] rules-users Digest, Vol 48, Issue 89
by Shivram kalwar
Hello All ,
I have 2 question on drools 5.1 ,I am using the Tomcat server,
1)where can i see the drools file(.drl) converted into .java file, I mean
internally drools convert the .drl into .java and uses the .java at runtime
?
2) suppose in drools when condition it has many statements so how the logic
works for then condition ..
i Have statement in when for some object the working memory got modified for
some it is not and there are many conditional statements(true or flase) are
there on multiple Object(like Parts ,Discount, etc)
Thank you very much for you guideline in advance.
shiv
15 years, 3 months
5.2.0-SNAPSHOT java.io.OptionalDataException
by mjhn
Hi,
I'm using the 5.2.0-SNAPSHOT binaries for making use of the new auth
attributes in the kagent:resource tag.
I'm attempting to get PKG out of Guvnor. Using the following
droolsservice.xml config
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:drools="http://drools.org/schema/drools-spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://drools.org/schema/drools-spring
http://192.168.2.2/~martinjohnson/xmpp_code/drools-spring-1.2.0.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd" >
<drools:kagent kbase="knowledgeBase" id="kagent" new-instance="false">
<drools:resources>
<drools:resource type="CHANGE_SET"
basic-authentication="enabled" username="admin" password=""
source="http://localhost:8080/drools-guvnor.war/org.drools.guvnor.Guvnor/package/..."
/>
</drools:resources>
</drools:kagent>
</beans>
As far as i can tell the ChangeSet.xml is coming down. The PKG accessed.
Though then...
Nov 25, 2010 9:09:52 PM com.javawhat.rules.RuleAgentManager init
INFO: Loading knowledge agents ...
Nov 25, 2010 9:09:52 PM com.javawhat.rules.RuleAgentManager init
INFO: Initializing knowledge agents with package:
[2010:11:329 21:11:675:info] ResourceChangeScanner reconfigured with
interval=60
[2010:11:329 21:11:676:info] ResourceChangeScanner created with default
interval=60
[2010:11:329 21:11:682:info] ResourceChangeScanner reconfigured with
interval=120
[2010:11:329 21:11:682:info] ResourceChangeScanner reconfigured with
interval=120
[2010:11:329 21:11:14:info] ResourceChangeNotification created
[2010:11:329 21:11:14:debug] ResourceChangeNotification monitor added
monitor=org.drools.io.impl.ResourceChangeScannerImpl@37722456
[2010:11:329 21:11:17:debug] KnowledgeAgent building resource map
[2010:11:329 21:11:17:info] KnowledegAgent has started listening for
ChangeSet notifications
[2010:11:329 21:11:18:info] KnowledgeAgent created, with configuration:
monitorChangeSetEvents=true scanResources=true scanDirectories=true
newInstance=false
[2010:11:329 21:11:514:info] KnowledgeAgent applying ChangeSet
[2010:11:329 21:11:516:debug] KnowledgeAgent notifier subscribing to
resource=[UrlResource
path='http://localhost:8080/drools-guvnor.war/org.drools.guvnor.Guvnor/package/...']
[2010:11:329 21:11:516:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@23000bcf to
resource=[UrlResource
path='http://localhost:8080/drools-guvnor.war/org.drools.guvnor.Guvnor/package/...']
[2010:11:329 21:11:516:debug] ResourceChangeScanner subcribing
notifier=org.drools.io.impl.ResourceChangeNotifierImpl@580754fc to
resource=[UrlResource
path='http://localhost:8080/drools-guvnor.war/org.drools.guvnor.Guvnor/package/...']
[2010:11:329 21:11:517:debug] KnowledgeAgent rebuilding KnowledgeBase using
ChangeSet
[2010:11:329 21:11:517:info] KnowledgeAgent performing an incremental build
of the ChangeSet
[2010:11:329 21:11:280:exception]
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:665)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:618)
at
org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(KnowledgeAgentImpl.java:809)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:587)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:186)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:169)
at
com.javawhat.rules.RuleAgentManager.createKnowledgeAgent(RuleAgentManager.java:125)
at com.javawhat.rules.RuleAgentManager.init(RuleAgentManager.java:85)
at
com.javawhat.rules.RuleAgentManager.getInstance(RuleAgentManager.java:48)
at com.adstream.test.Main.main(Main.java:53)
Caused by: java.io.OptionalDataException
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1282)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at
org.drools.rule.JavaDialectRuntimeData.readExternal(JavaDialectRuntimeData.java:167)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at java.util.HashMap.readObject(HashMap.java:1030)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at
org.drools.rule.DialectRuntimeRegistry.readExternal(DialectRuntimeRegistry.java:59)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at org.drools.rule.Package.readExternal(Package.java:197)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at
org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:205)
at
org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:174)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:654)
... 9 more
[2010:11:329 21:11:283:warning] KnowledgeAgent: The resource didn't create
any package: [UrlResource
path='http://localhost:8080/drools-guvnor.war/org.drools.guvnor.Guvnor/package/...']
[2010:11:329 21:11:283:info] KnowledgeAgent incremental build of
KnowledgeBase finished and in use
[2010:11:329 21:11:284:debug] KnowledgeAgent finished rebuilding
KnowledgeBase using ChangeSet
The issue lies behind 'stream.readObject();' from JavaDialectRuntimeData
around line 167
// Return the object stored as a byte[]
byte[] bytes = (byte[]) stream.readObject();
if ( signed ) {
checkSignature( stream,
helper,
bytes,
pubKeyAlias );
}
guvnor and my sample app are both running 5.2.0-SNAPSHOT. Really appreciate
any advice. Is it falling over an a parse of the binary and some
disagreement on contents of payload?
Thanks
Martin
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/5-2-0-SNAPSHOT-java-i...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 3 months