Designer for Guvnor 5.3.5
by Lance Leverich
Can anyone point me to where I can find the jBPM designer tool for use
within Guvnor v5.3.5? Instead of getting a download option, all we get is
the error message telling us that Guvnor couldn't find the designer tool.
~ Lance
12 years, 11 months
Guvnor 5.4.0 Deployment Failing on Websphere CE 2.1.1.4
by kulpreet_singh
Hi,
Trying to deploy 'guvnor-5.4.0.Final-tomcat-6.0.war' on Websphere CE
2.1.1.4, but getting following deployment error:
-----------------------------------------
Deployment Failed
Can not resolve admin object ref ?j2eeType=JCAAdminObject,name=BeanManager#
in configuration default/guvnor-5.4.0.Final-tomcat-6.0/1366121936876/war
org.apache.geronimo.common.DeploymentException: Can not resolve admin object
ref ?j2eeType=JCAAdminObject,name=BeanManager# in configuration
default/guvnor-5.4.0.Final-tomcat-6.0/1366121936876/war
at
org.apache.geronimo.connector.deployment.AdminObjectRefBuilder.buildAdminObjectReference(AdminObjectRefBuilder.java:260)
at
org.apache.geronimo.connector.deployment.AdminObjectRefBuilder.buildNaming(AdminObjectRefBuilder.java:153)
at
org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
------------------------------------------
If anyone has faced similar issue before, please help me in this regard.
Thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-5-4-0-Deployment-Failing-on-Webs...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 11 months
Create package in Guvnor via REST API fail (Missing package name)
by Magic
Hi,
I am trying to operate my local 5.5.0 Guvnor through RESTful API and have
some trouble.
For example, below is my code to create a package through a InputStream DRL.
The DRL string is copied from
org.drools.guvnor.server.util.FileManagerUtilsTest.java
=====================================================================
String content = "package testClassicDRLImport\n import blah \n rule 'ola'
\n when \n then \n end \n rule 'hola' \n when \n then \n end";
HttpClient client = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(baseURL + "/rest/packages");
httpPost.addHeader("Authorization", securityToken);
httpPost.addHeader("Accept", MediaType.APPLICATION_JSON);
httpPost.addHeader("Content-Type", MediaType.APPLICATION_OCTET_STREAM);
InputStreamEntity entity = new
InputStreamEntity(IOUtils.toInputStream(comment), comment.length(),
ContentType.APPLICATION_OCTET_STREAM);
httpPost.setEntity(entity);
HttpResponse response = client.execute(httpPost);
=====================================================================
But, I still got an error that told me "Missing package name":
Caused by: java.lang.IllegalArgumentException: Missing package name.
at
org.drools.guvnor.server.files.FileManagerService.importClassicDRL(FileManagerService.java:313)
[guvnor-webap
p-core-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.guvnor.server.files.FileManagerService$Proxy$_$$_WeldClientProxy.importClassicDRL(FileManagerServi
ce$Proxy$_$$_WeldClientProxy.java)
[guvnor-webapp-core-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.guvnor.server.jaxrs.PackageResource.createPackageFromDRLAndReturnAsJaxB(PackageResource.java:172)
[guvnor-webapp-core-5.5.0.Final.jar:5.5.0.Final]
I really don't know what's wrong and any help is really appreciate!
--
View this message in context: http://drools.46999.n3.nabble.com/Create-package-in-Guvnor-via-REST-API-f...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 11 months
NullPointerException when using bean property which happens to be a Enum name
by Sean Su
I am using 5.5.0.Final and I think I may have run into a bug.
Assuming I have a class Foo that has a getter which is getMyEnum().
Also I have a Enum class which happens to have the name MyEnum.
When writing rules, I have
$foo : Foo (MyEnum == MyEnum.someItem)
This line will throw NullPointerException.
I have to write it as:
$foo : Foo (getMyEnum() == MyEnum.someItem)
This statement will work just fine.
The workaround is ok for DRL. However I tested this on Guvnor and the rule
editor would generate the DRL just like the first statement (MyEnum ==
MyEnum.someItem). So we would be out of luck there.
Has anyone ever ran into this before.
Thanks
Sean
12 years, 11 months
drools queries: strange dependency
by upalik
This message was cross-posted to stack-exchange. If someone wants to answer
there, the URL is
http://stackoverflow.com/questions/15922343/drools-queries-strange-depend...
.
I'm somewhat new to Drools, and experienced this strange behavior during
writing a query.
To start with, the Hotel class here is a subclass of PlaceImpl, which
implements the interface Place. PlaceImpl itself is a subclass (via another
class) of OntologyClassImpl, where the method getClasses() is implemented in
the most trivial way: it returns an already existing java.util.Set of
objects. In short, getClasses() is accessible from both Place interface and
Hotel class.
My problem is this: The following query does not return any result even when
there are matching Hotels.
query "qryRomantic" $e: Hotel (classes contains
Semantics.AMB_Romantic)end
However, if I replace Hotel with Place, then the /query returns desired
results/, although the ONLY condition-setting rules are written for Hotel,
as follows. (This rule actually gets fired several times.)
rule "Set semantic class Romantic"no-loop when $hotel: Hotel( ...
conditions go here ... ) then modify ($hotel){
addToClasses(Semantics.AMB_Romantic) }end
It does not end there.
if I add another query to the rule file, for exactly the opposite condition
as follows,
query "qryNonRomantic" $e: Hotel (classes not contains
Semantics.AMB_Romantic)end
then the /first query/ starts to return the desired results, /EVEN WHEN the
new query is not called at all/!
What am I doing wrong? I'd be really grateful for any pointers.
--
View this message in context: http://drools.46999.n3.nabble.com/drools-queries-strange-dependency-tp402...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 11 months
Guvnor 5.5.0.Final with IE and Firefox issues
by Sean Su
Do we have existing issues being tracked for "Guided Rule Editor" in Guvnor
5.5.0.Final not working on IE? The same Editor opened fine with Firefox.
Also noticed, even though the editor can be opened in Firefox, the "Load
Template Data" button in the "rule template" seems not working. There is no
visible response after it is clicked.
Unfortunately, I can't test this on IE as I could not open the "editor" in
the first place.
Sean
12 years, 11 months
Error adding new rule at Runtime drools 5.4.0.Final
by Tushar
Hi all,
I am using Drools-Fusion v5.4.0.Final. My use case is to add rules
dynamically at runtime which should get automatically updated in the
KnowledgeSession. Rules in my application are defined as DTO. I have
written a toDrl() method which returns a String which essentially is a rule
in drl. I use following code to add it to the already running instance of
rule engine.
*Initialize Rule Engine
*KnowledgeBuilder kBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
KnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase();
if(kBase != null){
kBase.addKnowledgePackages(kBuilder.getKnowledgePackages());
}
// Populate rules from DB
List<AlertDefinitionDto> alertDefs = getDbRules();
for(AlertDefinitionDto alertDef : alertDefs) {
addRule(alertDef);
}
StatefulKnowledgeSession kSession = kBase.newStatefulKnowledgeSession();
*Add Rule
* try {
rwl.lock();
// Create new rule from AlertDefinitionDto
kBuilder.add(org.drools.io.ResourceFactory.newByteArrayResource(alertDef.toDrl().getBytes()),
org.drools.builder.ResourceType.DRL);
if(kBuilder.hasErrors()) {
kBuilder.undo();
KnowledgeBuilderErrors errs = kBuilder.getErrors();
System.err.print(AlertGenerationServiceImpl.class, "Error
adding rule : "+alertDef.getName());
String errorStr = "";
for (KnowledgeBuilderError error : errs) {
errorStr = errorStr + error.getMessage()+"\\n";
}
System.err.print("Error adding new rule: "+errorStr);
}
} finally {
rwl.unlock();
}
*
*
* *// No errors. Update KnowledgeBase.
try {
Collection<KnowledgePackage> kPkgs =
kBuilder.getKnowledgePackages();
kBase.addKnowledgePackages(kPkgs);
} catch (RuntimeException e) {
if(kBase.getRule(RULE_PACKAGE_NAME, alertDef.getName()) !=
null) {
kBuilder.undo();
}
e.printStackStrace();
}
*
*
*Fire Rules
*
* *LogMessage logMsg = getLog();*
*
kSession.insert(logMsg);
kSession.fireAllRules();
This code works fine under all conditions for initialization where rules
are fetched from DB and rule engine is initialized.
The code fails to add new rule dynamically, when the rule engine is already
initialized and fired few number of times with LogMessage as fact. The
errors which I am getting are
------------------------------------------------------------------
1. For the first time when it fails to add new rule.
------------------------------------------------------------------
java.lang.RuntimeException: Null accessor on node: null
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeNode(ConditionAnalyzer.java:229)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeSingleCondition(ConditionAnalyzer.java:126)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:102)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeCombinedCondition(ConditionAnalyzer.java:134)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:94)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:73)
at
org.drools.rule.constraint.MvelConditionEvaluator.getAnalyzedCondition(MvelConditionEvaluator.java:78)
at
org.drools.rule.constraint.MvelConstraint.getListenedPropertyMask(MvelConstraint.java:273)
at org.drools.reteoo.AlphaNode.calculateDeclaredMask(AlphaNode.java:372)
at org.drools.reteoo.ObjectSource.initDeclaredMask(ObjectSource.java:151)
at org.drools.reteoo.AlphaNode.<init>(AlphaNode.java:86)
at
org.drools.reteoo.builder.PatternBuilder.attachAlphaNodes(PatternBuilder.java:323)
at
org.drools.reteoo.builder.PatternBuilder.attachPattern(PatternBuilder.java:162)
at org.drools.reteoo.builder.PatternBuilder.build(PatternBuilder.java:80)
at
org.drools.reteoo.builder.GroupElementBuilder$AndBuilder.build(GroupElementBuilder.java:113)
at
org.drools.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:71)
at
org.drools.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:155)
at
org.drools.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:128)
at org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:116)
at org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:445)
at org.drools.common.AbstractRuleBase.addRule(AbstractRuleBase.java:956)
at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:627)
at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:472)
at
org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:150)
------------------------------------------------------------------
2. Everytime after 1st failure.
------------------------------------------------------------------
java.lang.NullPointerException
at org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:259)
at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:459)
at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:1107)
at
org.drools.common.AbstractRuleBase.mergePackage(AbstractRuleBase.java:851)
at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:610)
at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:472)
at
org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:150)
I have checked numerous times the generated drl (from method toDrl()) is
syntactically correct. The LogMessage has some null fields but they are
checked appropriately in the rules.
I am not sure what is going wrong here. May be the stacktrace provided
above give some pointers to the problem.
Also, please confirm if this is the right way to update rules dynamically.
I have taken a look at KnowledgeAgent but that requires a changeset
represented in XML which I do not have currently in my implementation.
Awaiting response.
12 years, 11 months