Planner: weighting moves & adaptive foragers
by Christopher Dolan
Three related questions about Drools Planner:
My planning problem involves distributing N jobs into M job queues. The optimal queue ordering depends on a large number of factors, but most important are job priority and job age. Priority usually wins, but old jobs can trump to avoid starvation.
If N x M is large, the collection of possible moves becomes large. But I know a priori that some moves are more likely to help than others. For example, I can promote the high-priority and old jobs first, because they will have the largest score impact.
1) Can I weight the selector to pick the better moves first? It looks like I'd make a custom AbstractSelector subclass that shuffled differently from MoveFactorySelector, maybe lazily finding moves via a pick function.
Of course, selecting better moves first is worthless if the forager doesn't use shortcuts, like FIRST_BEST_SCORE_IMPROVING. But the existing AcceptingForager implementation is very binary: it either takes the first good score or it ignores score and waits for a total number of moves.
2) Has anyone built a generic Forager that looks at the distribution of scores and stops early if it finds a fantastic outlier? In particular, early in the solver there are lots of very easy improvements to make. Taking the first good one may be premature, but going through 1000 moves is a waste of time. I'd like a forager that just tries a few moves early and then tries more moves later on when it's harder to make gains. On the other hand, is putting a lot of work into a perfect forager just redundant with the acceptor?
3) Has anyone employed the undocumented TopListSelector? I'm intrigued that it feeds the forager's best moves back into the selector. How does it work? I think you need to combine it with a move factory to seed the solutions, but then it's redundant with that factory's output. Are selectors allowed to return the same move twice??
Chris
14 years, 3 months
Guvnor Rest API
by Amin Mohammed-Coleman
Hi
I am trying to use the Guvnor Rest API to upload rules and BPMN process definitions to a remote Guvnor installation. So far I am able to update the binary content of the asset using:
/drools-guvnor/rest/packages/myPackage/assets/myAsset/binary
However when I look at the history for the asset, the current version does not point to the version I have uploaded using the API. Is there a separate API I have to call in order to set the current version to be the one I've uploaded or is there an example which I can reference?
I'm using Guvnor 5.4.0-CR1
Any help would be appreciated.
Thanks
14 years, 3 months
Issue deploying 2.1 oryxdesigner on guvnor 5.4 CR1 and jboss 7.1.1 final
by sumatheja
Hi I deployed the designer 2.1 war in standalone/deployments afetr changing
the url in the jbpm.xml to the appropriate port.
* <externalloadurl protocol="http" host="localhost:8380"
subdomain="drools-guvnor/org.drools.guvnor.Guvnor/oryxeditor" usr="admin"
pwd="admin"/>*
When I create a new jbpm and save it nothing happens.. I get the following
server log.... Can anyone let me knoe if it is a bug or If I'm missing
anything.....
*17:00:14,356 INFO [stdout] (http--127.0.0.1-8380-2) (null: -1, -1):
Premature end of file.
17:00:17,997 INFO [org.jbpm.designer.server.EditorHandler]
(http--127.0.0.1-8380-10) Performing diagram information pre-processing
steps.
17:00:18,027 INFO [org.drools.guvnor.server.security.DemoAuthenticator]
(http--127.0.0.1-8380-5) Demo login for user (admin) succeeded.
17:00:18,251 INFO [org.drools.guvnor.server.security.DemoAuthenticator]
(http--127.0.0.1-8380-5) Demo login for user (admin) succeeded.
17:00:18,369 INFO [org.drools.guvnor.server.security.DemoAuthenticator]
(http--127.0.0.1-8380-5) Demo login for user (admin) succeeded.
17:00:18,598 INFO [org.drools.guvnor.server.security.DemoAuthenticator]
(http--127.0.0.1-8380-5) Demo login for user (admin) succeeded.
17:00:18,682 INFO [org.drools.guvnor.server.security.DemoAuthenticator]
(http--127.0.0.1-8380-5) Demo login for user (admin) succeeded.
17:00:18,765 INFO
[org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit]
(http--127.0.0.1-8380-10) Successfully deleted file
:C:\Users\Sumatheja\mywork\jboss-
as-7.1.1.Final\standalone\deployments\designer.war\stencilsets/bpmn2.0jbpm/bpmn2.0jbpm.json
17:00:18,821 INFO
[org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit]
(http--127.0.0.1-8380-10) Created
file:C:\Users\Sumatheja\mywork\jboss-as-7.1.1.Final
\standalone\deployments\designer.war\stencilsets/bpmn2.0jbpm/bpmn2.0jbpm.json
17:00:18,827 INFO
[org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit]
(http--127.0.0.1-8380-10) Successfully deleted file
:C:\Users\Sumatheja\mywork\jboss-
as-7.1.1.Final\standalone\deployments\designer.war\stencilsets\bpmn2.0jbpm\view\activity\workitems\Email.svg
17:00:18,833 INFO
[org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit]
(http--127.0.0.1-8380-10) Successfully deleted file
:C:\Users\Sumatheja\mywork\jboss-
as-7.1.1.Final\standalone\deployments\designer.war\stencilsets\bpmn2.0jbpm\view\activity\workitems\Log.svg
17:00:18,860 INFO
[org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit]
(http--127.0.0.1-8380-10) Created
file:C:\Users\Sumatheja\mywork\jboss-as-7.1.1.Final
\standalone\deployments\designer.war\stencilsets/bpmn2.0jbpm/view/activity/workitems/Log.svg
17:00:18,874 INFO
[org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit]
(http--127.0.0.1-8380-10) Created
file:C:\Users\Sumatheja\mywork\jboss-as-7.1.1.Final
\standalone\deployments\designer.war\stencilsets/bpmn2.0jbpm/view/activity/workitems/Email.svg
17:00:19,647 INFO [org.drools.guvnor.server.security.DemoAuthenticator]
(http--127.0.0.1-8380-5) Demo login for user (admin) succeeded.
17:00:19,660 INFO [stdout] (http--127.0.0.1-8380-5) (null: -1, -1):
Premature end of file.
17:00:20,478 INFO [org.drools.guvnor.server.security.DemoAuthenticator]
(http--127.0.0.1-8380-5) Demo login for user (admin) succeeded.
17:00:20,744 INFO [org.drools.guvnor.server.security.DemoAuthenticator]
(http--127.0.0.1-8380-5) Demo login for user (admin) succeeded.
17:00:21,134 INFO [org.drools.guvnor.server.security.DemoAuthenticator]
(http--127.0.0.1-8380-5) Demo login for user (admin) succeeded.
17:00:21,436 INFO [org.drools.guvnor.server.security.DemoAuthenticator]
(http--127.0.0.1-8380-5) Demo login for user (admin) succeeded.
17:00:21,439 WARNING
[org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper]
(http--127.0.0.1-8380-5) WebApplicationException has been caught :
javax.jcr.PathNotFoundE
xception: processdictionary
17:00:21,443 INFO [org.jbpm.designer.web.server.DictionaryServlet]
(http--127.0.0.1-8380-2) check connection response code: 500*
Appreciate any help..... thanks in advance
--
cheers
Sumatheja Dasararaju
14 years, 3 months
SOAP rule invocation in droolsjbpm-integration-distribution-5.4.0.CR1
by Oldrich Kotas
Hello,
I am trying to invoke rules in the sample integration deployment from
drools-camel-server-5.4.0.CR1 release.
No matter what I keep sending to the endpoint, only following returns:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>org.apache.cxf.binding.soap.SoapMessage cannot be cast
to java.lang.String</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I have the server running on
http://localhost:8080/drools-camel-server-5.4.0.CR1/kservice/soap, the WSDL
downloads faultlessly. What is puzzling me, the very same request were
working in version 5.3. The deployment in regard of Camel is completely
intact with only chages whatsoever being specification of the Agent
knowledge-services.xml.
My sample request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soap="http://soap.jax.drools.org/">
<soapenv:Header/>
<soapenv:Body>
<soap:execute>
<soap:arg0>
</soap:arg0>
</soap:execute>
</soapenv:Body>
</soapenv:Envelope>
A side note: In 5.3.0.Final I have not succeed in making the Knowledge Agent
to sniff on Guvnor to get up-to-date packages therefore I tried last version
with the troubles reportedly repaired.
A side note 2: I have found in the drools-camel-server-5.4.0.CR1
documentation, chapter 3.3.1.2 a statement indicating the SOAP support is
not bundled in yet, is that correct or a remnant of some old version?
Citation: "If you want to have SOAP support you need to create your custom
Drools Policy, but it's going to be added in the next release."
Is there perhaps a fault in the camel/cxf configuration or the function is
just not implemented yet?
Help is very appreciated. Thank you,
Oldrich
--
View this message in context: http://drools.46999.n3.nabble.com/SOAP-rule-invocation-in-droolsjbpm-inte...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Creating and consuming processes in Guvnor programmatically
by affandar
In one of our scenarios we need to create a few workflows on the fly, upload
them to the guvnor repository and make them available to the jBPM engine
which is reading from this guvnor repository.
I was able to upload the process to Guvnor by posting the bpmn file to its
webdav endpoint but was not able to find a way to publish the package.
Questions:
1) Is there a better way to upload new processes to the Guvnor repo?
2) How do I publish a package programmatically?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Creating-and-consuming-processes-in-Guv...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
maven drools compiler (plugin)
by Sean Su
Hello, guys,
I did some search online and it seems we do not have any official plugin
that allows us to compile Drools rules as part of the maven build.
Is this the case or I have not found it yet?
Thanks for the help.
Sean
--
"But beware of the Dark Side. Anger, fear, aggression - the Dark Side of
the Force are they." -Yoda
14 years, 3 months
Drools crash on simple drl
by Shur, Bob
I have what looks to me like a Drools bug on a simple drl with declared classes. I'm using version drools-distribution-5.3.0.Final.
I'm invoking it with this:
StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
List<Object> facts = new ArrayList<Object>();
ksession.execute( facts );
=============================
I get this crash:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sample/Cap
at ASMAccessorImpl_129541121334339192620.getValue(Unknown Source)
at org.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:73)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:103)
at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:42)
at org.mvel2.MVEL.executeExpression(MVEL.java:952)
...
==========================
Here's the drl file:
package com.sample
import com.sample.*;
declare Item
id : int;
end
declare Priority
name : String;
priority : int;
end
declare Cap
item : Item;
name : String
end
rule "split cart into items"
when
then
insert(new Item(1));
insert(new Item(2));
insert(new Item(3));
end
rule "Priorities"
when
then
insert(new Priority("A", 3));
insert(new Priority("B", 2));
insert(new Priority("C", 5));
end
rule "Caps"
when
$i : Item()
$p : Priority($name : name)
then
insert(new Cap($i, $name));
end
rule "test"
when
$i : Item()
Cap(item.id == $i.id)
then
System.out.println("Cap");
end
====================
Some observations:
- If I comment out any of the insert lines, the crash goes away
- If I change the first field of class Cap to be id:int instead of item:Item and make the corresponding changes, the crash goes away
14 years, 3 months