[Drools Planner] Multi depot CVRP / CVRPTW
by Mats Norén
Hi,
I've been looking at the VRP example in Drools and I'm thinking about using
it for multi depot cvrp and / or capacitated vrp with time windows.
Has anyone else tried planner for these use cases and can maybe shed some
light on their implementation?
Regards,
Mats
11 years, 8 months
"Rule-Id" for a Drools Rule
by harishtejwani
All:
We are using Drools to detect specific events/conditions in our system.
In the 'then' condition of Drools rule, we would like to persist the "Rule
Id" of the rule that created the specific event/condition
This is because all our reporting is based on "rules" as filters, where
users can look at exceptions by specific rules.
Is there a suggestion or sample as how can the "Rule Id" be persisted or
indicated in the then condition that is immutable or can be long-lived. The
current approach of using Rule Name itself as the ID is brittle as this can
be changed and suddenly all reports would break.
If we assign ID's to rules, where do we keep the mapping of RULE ID to
Rules. If we store rules in GUVRNOR is there a way we can get Rule Id's for
Rules?
Best regards
Harish Tejwani
--
View this message in context: http://drools.46999.n3.nabble.com/Rule-Id-for-a-Drools-Rule-tp2914385p291...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 8 months
Fact insertion & retraction in working memory
by jigna
I need to add rule for filtering an event for 30 seconds.
i.e. The action would be taken once event has occurred for the first time &
then all the events of the same type would be ignored 30 seconds
& action should again take place if event has occurred anytime after 30
seconds.
I have tried creating a Throote class for holding thrittle value & timestamp
of firts occurance of events.
Following are the three rules which I am creating for the same.
It works correctly with first two rules, however for triggering third rule,
I need to insert an event which is not '000000A1'
& then this would give result retarcting ThrottleInfo Object which is
holding timestamp of this event for which throttle period has passed.
How can I make third rule trigger when there is not event of type '000000A1'
after throttle period?
Also is it possible to simplify this & write in single rule using timestamp
or any other features of fusion?
import com.igate.iheal.model.ErrorInfo
import com.igate.iheal.model.ThrottleInfo
import com.igate.iheal.model.process.IHEALProcessModel
declare ErrorInfo
@role(event)
@timestamp(errorTimeStamp)
end
rule "Error Rule 1"
no-loop true
when
$Error1:ErrorInfo(errorCode=="000000A1")from entry-point ErrorEntryPoint
not(exists(ThrottleInfo(errorCode=="000000A1")))
then
#Passing throttle duration as 30 seconds
insert(new
ThrottleInfo("000000A1",30,System.currentTimeMillis()));
retract($Error1);
System.out.println("New throttle info instance created");
end
rule "Error Rule 2"
no-loop true
when
$Error2:ErrorInfo(errorCode=="000000A1") from entry-point
ErrorEntryPoint
exists(ThrottleInfo(errorCode=="000000A1"))
$ThrottleError:ThrottleInfo(errorCode=="000000A1")
eval($ThrottleError.isThrottleCompleted()==true)
then
modify($ThrottleError)
{setErrorTimeStamp(System.currentTimeMillis())};
retract($Error2);
System.out.println("Modified throttle info instance");
end
rule "Error Rule 3"
#no-loop true
when
$Error3:ErrorInfo(errorCode!="000000A1") from entry-point ErrorEntryPoint
not(ErrorInfo(errorCode=="000000A1"))
exists(ThrottleInfo(errorCode=="000000A1"))
$ThrottleError:ThrottleInfo(errorCode=="000000A1")
eval($ThrottleError.isThrottleCompleted()==true)
then
retract($ThrottleError);
System.out.println("Delete unused throttle info instance");
end
--
View this message in context: http://drools.46999.n3.nabble.com/Fact-insertion-retraction-in-working-me...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 8 months
Not Able to create a cindition BRL fragment
by Aditi Hardas
Hi ,
I am using Drool Guvnor 5.5 along with IE 9 and Tomcat 7.0.32. I have
successfully deployed Guvnor in Tomcat.In next step I have created a package
then add a new category and added a rule with Decision Table (web - guided
rule ) as a rule formate.I was able to create a rule with certain set of
conditions and actions.On clicking Include Advance Option and choose *Add a
condition BRL fragment* or *Add an action BRL fragment*, I am getting java
script error and nothing is moving forword after that. That mean I am not
able to add and BRL fragment to my rule.
Can any one help me for this. Does I am doing any thing wrong.
Thx in advance.
--
View this message in context: http://drools.46999.n3.nabble.com/Not-Able-to-create-a-cindition-BRL-frag...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 8 months
Guvnor + Oracle 10g
by abhinay_agarwal
hi ,
I was trying to connect my guvnor to oracle 10g database, but somehow i get
the following error when i try to redploy guvnor after pasting the
repository.xml.
Any idea what this can be ?
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public
abstract org.drools.guvnor.client.rpc.Module[]
org.drools.guvnor.client.rpc.ModuleService.listModules()' threw an
unexpected exception: org.jboss.weld.exceptions.WeldException: WELD-000049
Unable to invoke [method] @PostConstruct public
org.drools.guvnor.server.repository.RepositoryStartupService.create() on
org.drools.guvnor.server.repository.ProductionRepositoryStartupService@dddff
at
com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jboss.weld.exceptions.WeldException: WELD-000049 Unable to
invoke [method] @PostConstruct public
org.drools.guvnor.server.repository.RepositoryStartupService.create() on
org.drools.guvnor.server.repository.ProductionRepositoryStartupService@dddff
at
org.jboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:400)
at
org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.postConstruct(ManagedBean.java:174)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:294)
at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)
at
org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)
at
org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)
at
org.drools.guvnor.server.repository.ProductionRepositoryStartupService$Proxy$_$$_WeldClientProxy.newSession(ProductionRepositoryStartupService$Proxy$_$$_WeldClientProxy.java)
at
org.drools.guvnor.server.repository.RulesRepositoryManager.getRulesRepository(RulesRepositoryManager.java:78)
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
org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)
at
org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
at
org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
at
org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)
at
org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)
at
org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:137)
at
org.jboss.weld.bean.ProducerMethod$ProducerMethodProducer.produce(ProducerMethod.java:136)
at
org.jboss.weld.bean.AbstractProducerBean$AbstractProducer.produce(AbstractProducerBean.java:319)
at
org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:307)
at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)
at
org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)
at
org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)
at
org.drools.repository.RulesRepository$Proxy$_$$_WeldClientProxy.listModules(RulesRepository$Proxy$_$$_WeldClientProxy.java)
at
org.drools.guvnor.server.RepositoryModuleOperations.listModules(RepositoryModuleOperations.java:102)
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
org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:44)
at
org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)
at
org.drools.guvnor.server.RepositoryModuleOperations$Proxy$_$$_WeldClientProxy.listModules(RepositoryModuleOperations$Proxy$_$$_WeldClientProxy.java)
at
org.drools.guvnor.server.RepositoryModuleService.listModules(RepositoryModuleService.java:109)
at
org.drools.guvnor.server.RepositoryModuleService.listModules(RepositoryModuleService.java:102)
at
org.drools.guvnor.server.RepositoryModuleService$Proxy$_$$_WeldClientProxy.listModules(RepositoryModuleService$Proxy$_$$_WeldClientProxy.java)
at
org.drools.guvnor.server.ModuleServiceServlet.listModules(ModuleServiceServlet.java:26)
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 com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
... 17 more
Caused by: java.lang.reflect.InvocationTargetException
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
org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)
at
org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
at
org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
at
org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)
at
org.jboss.weld.introspector.jlr.WeldMethodImpl.invoke(WeldMethodImpl.java:174)
at
org.jboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:398)
... 58 more
Caused by: java.lang.OutOfMemoryError: Java heap space
at
oracle.jdbc.driver.PhysicalConnection.getByteBuffer(PhysicalConnection.java:6991)
at
oracle.jdbc.driver.OracleStatement.prepareAccessors(OracleStatement.java:895)
at oracle.jdbc.driver.T4CTTIdcb.receiveCommon(T4CTTIdcb.java:261)
at oracle.jdbc.driver.T4CTTIdcb.receive(T4CTTIdcb.java:127)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:992)
at
oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
at
oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
at
oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
at
oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
at
oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3488)
at
oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:169)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:169)
at
org.apache.jackrabbit.core.util.db.ConnectionHelper.execute(ConnectionHelper.java:438)
at
org.apache.jackrabbit.core.util.db.ConnectionHelper.reallyExec(ConnectionHelper.java:359)
at
org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:339)
at
org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:335)
at
org.apache.jackrabbit.core.util.db.ConnectionHelper$RetryManager.doTry(ConnectionHelper.java:458)
at
org.apache.jackrabbit.core.util.db.ConnectionHelper.exec(ConnectionHelper.java:335)
at
org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.loadBundle(BundleDbPersistenceManager.java:1020)
at
org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.getBundle(AbstractBundlePersistenceManager.java:654)
at
org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.exists(AbstractBundlePersistenceManager.java:473)
at
org.apache.jackrabbit.core.version.InternalVersionManagerImpl.<init>(InternalVersionManagerImpl.java:159)
at
org.apache.jackrabbit.core.RepositoryImpl.createVersionManager(RepositoryImpl.java:509)
at
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:329)
at
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:605)
at
org.apache.jackrabbit.core.TransientRepository$2.getRepository(TransientRepository.java:232)
at
org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:280)
at
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:376)
at
org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:123)
at
org.drools.repository.JCRRepositoryConfigurator.login(JCRRepositoryConfigurator.java:95)
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-Oracle-10g-tp4022991.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
Guvnor REST APIs - what rule features are supported?
by kurrent93
Hi
I saw a thread a few days ago asking about how to enable/disable rules using
the guvnor REST Api - only to find that that functionality does not exist.
What other functionalities are not covered by the REST apis?
For example, can we add calendars using the REST api?
What about salience, no-loop, activation group, agenda group, duration?
We are looking to build a custom UI for editing rules, using the Guvnor REST
apis, and but if there is limited coverage, then we will need to find an
alternative.
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-REST-APIs-what-rule-features-are...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
drl for Selection and Decreasing
by Al Ferguson
Hi,
I'd like to use the Planner to determine the location of items to be shipped
(aka Order Sourcing).
The Planning Entity is:
.---------------------.
| OrderLine |
| ------------------- |
| String productCode |
| int orderedQuantity |
| StockItem stockItem |
'---------------------'
The resource (Planning Variable) is:
.-----------------------.
| StockItem |
| --------------------- |
| String productCode |
| String warehouseId |
| int availableQuantity |
'-----------------------'
Solution Implementation is:
.-----------------.
| OrderPlanning |
| --------------- |
| score |
| orderLineList |
| stockItemList |
'-----------------'
Here's an example to be solved:
OrderLine [id=1, productCode=A, orderedQuantity=1]
OrderLine [id=2, productCode=B, orderedQuantity=2]
OrderLine [id=3, productCode=B, orderedQuantity=2]
StockItem [id=1, productCode=A, warehouseId=NYC, availableQuantity=1000]
StockItem [id=1, productCode=B, warehouseId=NYC, availableQuantity=1000]
StockItem [id=1, productCode=B, warehouseId=CHI, availableQuantity=1000]
Can you help me writing the required 'drl'?
- StockItem.productCode must be the OrderLine.productCode
- StockItem.availableQuantity must be decreased when an OrderLine is
allocated
Obviously the allocation rules are much more complex. But I'm starting with
the Planner and I need help to start.
Thanks,
Al
--
View this message in context: http://drools.46999.n3.nabble.com/drl-for-Selection-and-Decreasing-tp4022...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months