Proto Buf generated code and KIE
by Joe White
We are starting to take a look at using the KIE workbench to expose some decision tables to our users. The original idea is to use generated java from a proto buffer schema as the model. I've got the jar building and imported into KIE. The challenge I'm running into is that the proto buff java doesn't contain the member definitions in a way that the KIE can see them. So I get all of the classes but can't access the actual data elemetns.
Has anybody tried this? Or know of a way to take a proto schema (or generated code) and import it as the model for KIE?
Thanks,
Joe
12 years
Custom Operator - 5.4.0 works but nor not in 5.6.0.
by mattmadhavan
Hello,
I have written a drools custom operator called inlist. It takes two strings
are parameters and works great in 5.4.0.
I can do some thing like this.
rule inList_1
dialect "mvel"
when
$cp3rRecord : Cp3rRecord (*primarySite*e inlist ("C500-C505") )
then
System.out.println ("Fired inList_1");
end
where primary site is a filed of the type Cp3rRecord and it works great in
5.4.0
There is a change in the API from 5.4.0 to 5.6.0
The Old evaluator is:
/The new one (Per 5.6.0) is/
Note the third parameter! its is changed from Object to a Fact handle
(*Please see lines 1) and 2)* )
When I extract the Object its returning me the FACT again and it blows off
when I cast it to String. Any ideas please> I have been stuck on this for a
day!
I am getting the exception *cannot cast primarySite to a FactHnadle
*
Can some one throw some light on this one please?
Thanks in advance!
Matt'M
--
View this message in context: http://drools.46999.n3.nabble.com/Custom-Operator-5-4-0-works-but-nor-not...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
Upgrade from drools 5.4 to 6.0.0-Beta3 - Legacy API Adapter JAR
by MaverickDrools
Hi,
There is not enough documentation on drools v6.0.0-Beta3, but this is what
I'm trying to do.
Our system was designed with 5.3 but then we encountered the issue with
synchronization (https://issues.jboss.org/browse/JBRULES-3283), so we
upgraded to v 5.4.
Things worked fine until we multithreaded the client code due to which we
faced another issue (https://issues.jboss.org/browse/JBRULES-3675)
So finally now, I'm trying to upgrade to 6.0.0-Beta3 since both those issues
should've been fixed with 6.0.0-Alpha1. The problem I'm facing is, I do not
have enough documentation to look at to see how to convert those things. I
went through the slides etc that were posted on the mailing list for the
conferences, but I'm still unable to figure it out correctly..
So, can someone point me to a JUnit or something that I can look at to
figure this thing out?
static {
KieServices ks = KieServices.Factory.get();
KieRepository kr = ks.getRepository();
Resource res = ks.getResources().newFileSystemResource(
"src/main/resources/rules/abc.drl");
KieModule kModule = kr.addKieModule(res);
kc = ks.newKieContainer(kModule.getReleaseId());
}
throws an exception on kr.addKieModule(res) which says Error in opening zip
file.. I assume we are now expecting a jar instead of a plain drl file. Is
there a way to convert this drl into a jar that the 6.0 code can understand
(for compatibility purposes with the existing system)?
Another thought was to make use of the Legacy API Adapter JAR, but I
couldn't find any examples of the same. Can you point me to a code
sample/JUnit that could explain how this works?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Upgrade-from-drools-5-4-to-6-0-0-Beta3-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
packageBuilder.getPackage() returns null
by Raja Sekhar
Hi
i am trying to use drools template
String drl = resultSetGenerator.compile(resultSet, new FileInputStream(new
File("D:\\Raj\\dymanic.drt")));
complied drl as above
when i try add the pakage packageBuilder.getPackage() it return null
i am using the 5.6.0.Final version of drools
Regards,
Raja Sekhar Amirapu
------------------------------------------------------
"If any anyone can do it, i can do it. If no one else can do it, i must do
it"
12 years
java.lang.NullPointerException when using a custom operator
by Hezi Stern
Hi all,
I have been working with Drools 5.2.0 on windows xp and I have a stable
project.
I upgraded to windows 8, drools 5.5.0 and upgraded to eclipse Juno (from
Helios).
I have now encountered a strange problem with my existing drools project. I
have a accustom operator called supersetof which now results in the
following error reported in the IDE in any file where the supersetOf is used
(LHS):
Error: java.lang.NullPointerException
After receving this error the drools parser does not work, hence this is the
only error I have.
I have tried to use the Drools 5.2.0 again (on the new windows 8 machine)
but I get the same problem so I guess it has to do with some IDE\eclispe
configuration or compatibility issue.
Obviously not the drools project code as I have not made any changes to the
working project.
I did make sure the custom operator is configured similar to the way it was
on my previous computer.
Any ideas? Is there a different configuration for Juno?
Thanks,
Hezi
12 years
Asynchronous Rule Evaluation
by droolster
I have situation where the set of rules I am writing will be invoked via a
REST service in an asynchronous manner via JMS message queues. Essentially
what is happening is that from the GUI, a ticket is raised which has a
unique ticket id value. For this ticket, a particular rule evaluation has to
be done. Once this rule evaluation is done, the result of the evaluation has
to be linked to this particular ticket via the ticket id.My question is what
is the best way to achieve is in my DRL files? Do I have a Ticket fact type
in every condition of every rule?Thanks in advance.
--
View this message in context: http://drools.46999.n3.nabble.com/Asynchronous-Rule-Evaluation-tp4028141....
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
Multiple planning variables in optaplanner 6.0.1
by lloydstockman
Hi Guys,
I am trying to get a basic program going using Optaplanner 6.0.1 I have come
across a problem because I am using two planning variables within a single
planning entity. I have checked other examples, such as the examination
example, and it seems fine to have multiple planning variables within a
single planning entity. I also tried to add another planning variable to the
cloud balancing example and the same error occurs so I believe there is
something I need to do to be able to use multiple planning variables in a
single entity. The error is as follows.
Exception in thread "main" java.lang.IllegalArgumentException: The
selectorConfig (ValueSelectorConfig(null)) has no configured variableName
(null) for planningEntityClass (class domain.Provisional) and because there
are multiple in the variableNameSet ([date, morning, technician]), it can
not be deducted automatically.
at
org.optaplanner.core.config.heuristic.selector.SelectorConfig.deduceVariableDescriptor(SelectorConfig.java:108)
I haven't found anything in the manual to suggest what needs to be done in
this scenario, or found any posts of the forum regarding this topic. If
anyone can point me in the right direction I would greatly appreciate it.
best regards,
- Lloyd Stockman
--
View this message in context: http://drools.46999.n3.nabble.com/Multiple-planning-variables-in-optaplan...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
real world examples wanted
by Mark Proctor
Real wold examples wanted. If you can help, please let us know.
We have a large user base now, and over the years a number of people have said they would help with contributing real world examples. Alas after 10 years, except for the small banking example, we are still waiting for a single user example contribution.
Mark
12 years
irrational behaviour by drools engine
by Avin
Hi,
I have a hashmap inserted as global variable and some objects as facts.
In drools i try to locate object from hashmap using facts. It behaves
differently and i dont know why. I will post my code and then try to
describe the behaviour
global java.util.Map encapsulationMap;
rule "test rule"
no-loop
when
EncapsulatingObject($key : id == 7)
EncapsulatingObject( encapsulationMap[$key+""] !=null)
//eval( encapsulationMap.get($key+"") != null) working
then
System.out.println("key is "+$key +" value is :::
"+encapsulationMap.get($key+""));
end
Out put
key is 7 value is ::: Encapsulating object key 7
key is 7 value is ::: Encapsulating object key 7
key is 7 value is ::: Encapsulating object key 7
key is 7 value is ::: Encapsulating object key 7
key is 7 value is ::: Encapsulating object key 7
key is 7 value is ::: Encapsulating object key 7
key is 7 value is ::: Encapsulating object key 7
key is 7 value is ::: Encapsulating object key 7
key is 7 value is ::: Encapsulating object key 7
Explanation :
I have objects of Encapsulating as facts. same type of objects are present
in hashmap. Field id is getting used for hashcode and for equals to store it
in hashmap.
I am inserting 9 facts and all of them are unique. Number of occurance if
you see are 9.
1. I dont know why it behaves like this? i think there should have been
just 1 object.
2. If I *comment out EncapsulatingObject( encapsulationMap[$key+""]
!=null)*
and *uncomment eval* i get proper results i.e only one output. BZut i want
to assign object to a variable hence i have to use *EncapsulatingObject(
encapsulationMap[$key+""] !=null)*
Can any one explain me this behaviour ?
What am i missing or where am i going wrong.
Please help
Thanks and Regards
Avin
--
View this message in context: http://drools.46999.n3.nabble.com/irrational-behaviour-by-drools-engine-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years