InvalidItemStateException while accessing Guvnor
by worldofprasanna
Hi All ..
We are getting the following error message in Guvnor when trying to access
it.
org.drools.repository.RulesRepositoryException:
javax.jcr.InvalidItemStateException: property
/drools:repository/drools:package_area/com.lsi.sort/assets/Lotting
Guidelines/drools:content: the property cannot be saved because it has been
modified externally.
This occurs in our production system and it is occurring rarely (So We
couldn t reproduce it locally in our environment).
But this issue is resolved when we restarted the Server in which the Guvnor
app is running. But this is nearly impossible as this occurs in production
system.
We are using Oracle DB as our Persistent Manager (as seen in the attachment)
and running the guvnor in clustered environment.
I presume that the issue might be related to versioning in Guvnor ? If so
can anyone guide us to solve this versioning problem ?
Herewith attached the repository.xml file.
Thanks in advance,
Prasanna Venkataraman.
repository.xml
<http://drools.46999.n3.nabble.com/file/n4021115/repository.xml>
--
View this message in context: http://drools.46999.n3.nabble.com/InvalidItemStateException-while-accessi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
documentation on rules engine
by Michiel Vermandel
Hi,
I would like to read some documentation on how the rules engine (specifically for planner) works.
I have a number of unanswered questions.
Some type of questions:
- If I have two rules in my drl file, will the engine execute first the first rule with all possible combinations of the planning entities matching the conditions of the rule
and then the second rule with all possible combinations of the planning entities matching the conditions of the rule
- Can I trace which rules are executed with what planning-variables and in which order
- What is the purpose of the last variable amount of parameters ($x, $y, $z) in the RHS logic insertLogical(new IntConstraintOccurrence( ... , $x, $y ,$z))
I know there is http://docs.jboss.org/drools/release/5.5.0.Final/drools-planner-docs/html... but it does not really answer the above questions.
Thanks,
Michiel
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
12 years
Re: [rules-users] debug
by Kevin Kelleher
Hi,
As I see it , this is a big problem.
I was looking at drools about 10 months ago (5.3.0 Final) and debug worked
just fine ... ... so similar to earlier comment of Bruno here.
Today I downloaded drools 5.5.0 Final & eclipse Juno and debug is broken
...
Can we expect a patch? I can't see how we could proceed if this issue is not
resolved.
Any suggestions welcome.
Regards,
Kevin
--
View this message in context: http://drools.46999.n3.nabble.com/debug-tp3889772p4021012.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
Re: [rules-users] Executing more than one rules having no infinite execution
by Esteban Aliverti
Using drools.halt() is not considered a good practice at all. I would
recommend you to read this post:
http://ilesteban.wordpress.com/2012/11/16/about-drools-and-infinite-execu...
Best Regards,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
- Blog @ http://ilesteban.wordpress.com
On Fri, Dec 7, 2012 at 8:59 AM, Hushen Savani
<hushen.savani(a)elitecore.com>wrote:
> Hi,****
>
> ** **
>
> I have a simple rule as following:****
>
> ** **
>
> *import java.util.HashMap;*
>
> * *
>
> *rule "first"*
>
> *when*
>
> * a : CrestelRuleModel( $hmap : singleHashMap!=null);*
>
> *then*
>
> * System.out.println("Old Map: " + $hmap);*
>
> * HashMap mapp = new HashMap();*
>
> * mapp.put("hello", "world");*
>
> * a.setSingleHashMap(mapp);*
>
> * System.out.println("New Map: " + a.getSingleHashMap());*
>
> * update(a);*
>
> *end;*
>
> ** **
>
> When I invoke the rule from my client, the rule is executed *infinitely*.*
> ***
>
> ** **
>
> So, I have placed a “*drools.halt()*” before “*end*” statement of above
> rule. So, it stopped executing infinitely as I wanted. But *is it a good
> practice?*****
>
> ** **
>
> Now, I want my input to be filtered by *two rules*, so I have placed
> rules like following:****
>
> ** **
>
> *import java.util.HashMap;*
>
> * *
>
> *rule "first"*
>
> *when*
>
> * a : CrestelRuleModel( $hmap : singleHashMap!=null);*
>
> *then*
>
> * System.out.println("Old Map: " + $hmap);*
>
> * HashMap mapp = new HashMap();*
>
> * mapp.put("hello", "world");*
>
> * a.setSingleHashMap(mapp);*
>
> * System.out.println("New Map: " + a.getSingleHashMap());*
>
> * update(a);*
>
> * drools.halt();*
>
> *end;*
>
> * *
>
> *rule "second"*
>
> *when*
>
> * b : CrestelRuleModel( $hmap2 : singleHashMap!=null);*
>
> *then*
>
> * System.out.println("Old Map2: " + $hmap2);*
>
> * HashMap mapp2 = new HashMap();*
>
> * mapp2.put("hello2", "world2");*
>
> * b.setSingleHashMap(mapp2);*
>
> * System.out.println("New Map2: " + b.getSingleHashMap());*
>
> * update(b);*
>
> * drools.halt();*
>
> *end;*
>
> ** **
>
> But in above case, *only the “second” rule executes*. What to do in
> order to execute both the rules without any infinite loop?****
>
> ** **
>
> Kindly share some pointers on this. Thanks.****
>
> ** **
>
> ** **
>
> *PS*: *CrestelRuleModel* is my POJO model having following fields,****
>
> * *
>
> *public* *class* CrestelRuleModel {****
>
> ****
>
> *private* *ArrayList* arrayListOfHashMap;****
>
> *private* *HashMap* singleHashMap;****
>
> *private* Object object;****
>
> *private* String remarks;****
>
> ** **
>
> //Getters and Setters****
>
> ** **
>
> }****
>
> ** **
>
> Best Regards****
>
> *Hushen Savani* | Crestel Billing****
>
> [image: ecTag]****
>
> ** **
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
12 years
Executing more than one rules having no infinite execution
by Hushen Savani
Hi,
I have a simple rule as following:
import java.util.HashMap;
rule "first"
when
a : CrestelRuleModel( $hmap : singleHashMap!=null);
then
System.out.println("Old Map: " + $hmap);
HashMap mapp = new HashMap();
mapp.put("hello", "world");
a.setSingleHashMap(mapp);
System.out.println("New Map: " + a.getSingleHashMap());
update(a);
end;
When I invoke the rule from my client, the rule is executed infinitely.
So, I have placed a "drools.halt()" before "end" statement of above rule.
So, it stopped executing infinitely as I wanted. But is it a good practice?
Now, I want my input to be filtered by two rules, so I have placed rules
like following:
import java.util.HashMap;
rule "first"
when
a : CrestelRuleModel( $hmap : singleHashMap!=null);
then
System.out.println("Old Map: " + $hmap);
HashMap mapp = new HashMap();
mapp.put("hello", "world");
a.setSingleHashMap(mapp);
System.out.println("New Map: " + a.getSingleHashMap());
update(a);
drools.halt();
end;
rule "second"
when
b : CrestelRuleModel( $hmap2 : singleHashMap!=null);
then
System.out.println("Old Map2: " + $hmap2);
HashMap mapp2 = new HashMap();
mapp2.put("hello2", "world2");
b.setSingleHashMap(mapp2);
System.out.println("New Map2: " + b.getSingleHashMap());
update(b);
drools.halt();
end;
But in above case, only the "second" rule executes. What to do in order to
execute both the rules without any infinite loop?
Kindly share some pointers on this. Thanks.
PS: CrestelRuleModel is my POJO model having following fields,
public class CrestelRuleModel {
private ArrayList arrayListOfHashMap;
private HashMap singleHashMap;
private Object object;
private String remarks;
//Getters and Setters
}
Best Regards
Hushen Savani | Crestel Billing
ecTag
12 years
How to get a package from Guvnor and start it
by DO
I've posted this over in the JBPM forums, but now I think it's more of a
Guvnor question...
Can anyone tell me how to get a process/package from Guvnor and run it from
a java app using the demo setup?
I have installed jbpm via the JBPM 5.4 full installer. I have taken the
ScriptTask.bpmn from jbpm-examples and successfully put it in the Guvnor. I
have added a Model Pojo and was able to build the package inside the default
package. I have even created a snapshot.
Guvnor lists these URLS:
URL for package documentation:
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...
Use this url to download package documentation PDF.
URL for package source:
http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/source
Use this URL to download the source, or in the 'runtime agent' to access
the rules in source form
URL for package binary:
http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/binary
Use this url in the 'runtime agent' to fetch a pre compiled binary.
URL for running tests:
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...
Use this url to run the scenarios remotely and collect results.
Change Set:
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...
URL to change set for deployment agents.
POJO Model:
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...
Additionally it has this link Download binary package which is:
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...
Now I have my main java app:
package org.jbpm.examples.quickstarts;
import java.util.HashMap;
import java.util.Map;
import org.drools.KnowledgeBase;
import org.drools.agent.KnowledgeAgent;
import org.drools.agent.KnowledgeAgentConfiguration;
import org.drools.agent.KnowledgeAgentFactory;
import org.drools.io.Resource;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatefulKnowledgeSession;
public class HelloRunner {
public static final void main(String[] args) {
try {
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();
Map<String, Object> params = new HashMap<String, Object>();
Person p = new Person("Krisv");
params.put("person", p);
ksession.startProcess("com.sample.script", params);
} catch (Throwable t) {
t.printStackTrace();
}
}
private static KnowledgeBase readKnowledgeBase() throws Exception {
KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent("test", aconf);
String url =
"http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...";
UrlResource resource = (UrlResource)
ResourceFactory.newUrlResource(url);
resource.setBasicAuthentication("enabled");
resource.setUsername("guest");
resource.setPassword("guest");
kagent.applyChangeSet(resource);
return kagent.getKnowledgeBase();
}
}
This code runs, authenticates, and then gives me back this error:
ERROR drools.xml.ExtensibleXmlParser.fatalError - (null: 1, 1): Content
is not allowed in prolog.
I figured out this was because I am trying to add the binary package as a
changeset, and it can't parse the binary file as a changeset... so I realize
my approach is kind of flawed...
So how do I get the binary package from Guvnor and start the process?
Thank you!
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-get-a-package-from-Guvnor-and-st...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
null planning variables
by Michiel Vermandel
Hi,
I have got a Planning entity which takes several planning variables.
The provided variable-lists never contain null elements.
Though, in my rules I get planning entities with uninitialized planning variables (null).
Why is that?
Can this be avoided?
Thanks
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
12 years
please help on complex rule (linking entities)
by Dave Brubanks
Hi all,
(after writing this mail I realized that it became quite long, but please hang in there with me. my actual question is not that big, I only need to build some context.)
I need to implement a planning for placing new floors in hotels (renovation).
Renovating a single hotel requires a number of jobs. For example
- replacing wooden floor in the lobby
- replacing carpets in the bedrooms
- replacing tiles in the bathroom
Each kind of replacement is done by a specialized kind team.
Thus for example a team that places wooden floors will only do that.
for each renovation project we decide which jobs are needed (for example only carpet and tiles) and we make an estimate of how many people we want to send there and how long it will take to complete the job.
For example: we have a
Renovation A
- replacing wooden floor : 3 weeks, 2 workers
- replacing carpet floor : 5 weeks, 4 workers
- replacing tiles: 4 weeks, 5 workers
Renovation B
- replacing carpet floor : 3 weeks, 1 workers
- replacing tiles: 3 weeks, 2 workers
... and so on.
Now we need to schedule the renovations.
Actually we took the replacement jobs as planning entity, I hope that was the right choise:
In case of renovation A we will have
- 2 jobs of type wood, each lasting 3 weeks.
- 4 jobs of type carpet, each lasting 5 weeks
- 5 jobs of type tile, each lasting 4 weeks.
I currently do not have projects as facts. I do have the project-id set on a Job on its instantiation (so I know which jobs belong together).
When scheduling the jobs of a renovation we need to follow these rules:
- it does not matter when a renovation is planned (for now) (within a given number of weeks - usually 12)
- a resource with the required skill needs to be available for doing that kind of job (planning-variable)
- the start of a job needs to be planned in a week (one of 12 - planning 12 weeks at the time) - we do not plan exactly on a day.
- the job is always done in 1 sequential block of x weeks, no gaps between.
- !! all jobs need to be done within the time of the longest job in the project.
So in Renovation A all jobs need to be fitted in a time span of 5 weeks.
In Renovation A the wooden-floor team can start in week 1, 2 or 3 of the 5-week span.
- the jobs of a project do not have to start in the same week (for better occupation)
I already have some rules up and running, but the one I cannot figure how to do is how I can plan the jobs of a renovation project so that they all are planned within the span of the largest job.
Currently I have all jobs of a project to start in the same week... but that limits the number of solutions.
In order to get this extra flexibility, do I need to introduce a kind of holder-fact (project)?
Any ideas will be greatly appreciated.
Thanks
Davido
12 years