collect
by Raja Sekhar
Hi,
I am new to drools
The following collect statement is working i wanted group by hild
References(id: hlid);
$prds : Products(products!=null)
$matchingrecords : List() from collect ( Product(hlId==id) from
$prds.products )
when the list contains 1,1,2,2 it works when the list contains 1,1,2,1
the condition fails.
I trying to group by hlId
please help
--
Raja Sekhar Amirapu
------------------------------------------------------
"If any anyone can do it, i can do it. If no one else can do it, i must do
it"
10 years, 9 months
Attribute comparison thru decision table
by bala.ganesh@accenture.com
Hi,
I have a requirement to compare attributes in two objects(Object1 Vs. Object2) and store the values based on business rule in object 3.
Example rules:
If (Obj1.atrr1 != Obj2.atrr1)
Then Obj3.attr1 = Obj2.atrr1
If (Obj1.atrr2 != Obj2.atrr2)
Then Obj3.attr2 = Obj1.atrr2
If (Obj1.atrr3 - Obj2.atrr3 > 10)
Then Obj3.attr3 = Obj1.atrr3
We are planning to use decision table for this to avoid a separate GUI development.
Would like to know whether writing rule for each attribute is the only solution or is there any simpler approach?
Thanks in advance,
-Bala
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. .
______________________________________________________________________________________
www.accenture.com
10 years, 9 months
insertlogical
by Raja Sekhar
Hi ,
i wrote some java code in then clause of the rule to sum the elements of
two list.
Now i want to pass the updated sums back to the caller. i tried with
insertlogical
its not working. Can you some one suggest on how i do this.
--
Raja Sekhar Amirapu
------------------------------------------------------
"If any anyone can do it, i can do it. If no one else can do it, i must do
it"
10 years, 9 months
Save "Business Processes" failure after rename in Drools Workbench (kie-6.1.0))
by jorgehortelano
I am working with Kie-Workbench 6.1.0 at the last few days. recently I
started to create a Business Processes in the project explorer and I have
experimented a non expected behaviour (at least, not expected to me). I can
create tasks, events ... as expected using Oryx editor, and I can save it
correctly. But when I rename the project I have experimented that no more
changes are correctly saved:
How to reproduce this:
1- Create a new project in drools kie workbench.
2- Create Business Processes there. i.e. FirstName
3- Add some flow, tasks,...
4- Save it.
5- Rename it. I.e. SecondName. (At the top left corner of the editor you can
still see the old name, but at the catalina.out you can see a message like
this: 'USER:admin RENAMING asset [FirstName.bpmn2] to [SecondName]').
6- Add new tasks and flows.
7- Save it again.
"Save successfully" message showed in green at the top right corner of the
editor.
But when you reopen the project again, all changes of step 6 are lost. Is
this an issue?
I am using version 6.1.0 in Tomcat7 and the client is Firefox (27.0.1).
--
View this message in context: http://drools.46999.n3.nabble.com/Save-Business-Processes-failure-after-r...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 9 months
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
10 years, 9 months
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.
10 years, 9 months
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.
10 years, 9 months
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"
10 years, 9 months
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
10 years, 9 months
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.
10 years, 9 months