compare attributes form similar type
by kashif10
Hi I need help to come up with the expression which match an attribute form
similar type of bean.
e.g matching dob of all Person object.
Example:
I have Person Object
Person{
Date dateOfBith;
String name;
String gender;
}
exists (Person ( gender=="male" , <whose dob is first in period 1/1/2012 to
12/31/2012>) )
Now at run time, I am going to get data of multiple Persons.
If a person who born first in 2012 among all person data & if he is male -->
condition match.
But if that person is a female then condition will not match.
--
View this message in context: http://drools.46999.n3.nabble.com/compare-attributes-form-similar-type-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Re: [rules-users] So can you automatically upload a POJO JAR Model or not?
by Nicolas Héron
Hi,
Yes it is possible to upload a pojo jar over rest. There were commits in
the 5.5.x branch so you have to compile it yourself.
Contact me in direct if you need more info : nicolas dot heron at pymma dot
com
Cheers
Nicolas
2013/8/16 Mark Bennett [via Drools] <ml-node+s46999n4025580h13(a)n3.nabble.com
>
> Hi guys,
>
> I'm using 5.5, and I've looked around and around on Google, and although
> I've seen a few claims that this might work, so far I haven't had any luck.
> I'm getting various errors, 404 no such page, also "service not
> available".
>
> I do pass in the authentication header. I'm also making sure to generate
> Java 1.6 classes, and the UI accepts the JAR without complaint and exposes
> it in the UI.
>
> I saw one post claiming to upload as an asset, but there was some code
> change required to Drools/Guvnor to get it to treat it as a model, so
> that's not an option.
>
>
> Let me try a few simple questions that might narrow this down:
>
> * Would you expect to use the REST API or the Webdav API to upload?
>
> * What would the URL look like? (I've tried a bunch, looks simple enough
> online, and I'm able to download the DRLs)
>
> * I downloaded the combo pack of JBoss and Drools/Guvnor 5.5. Is there
> maybe some config change needed to enable the additional REST or Webdav
> URLs?
>
> * When you submit a JAR interactively, I know GWT is involved, but does it
> hand over the request to either the REST or Webdav API? OR does it have
> some other special entrance into the system, some third way in? And if so,
> could I use that?
>
> * Would I use a POST or a PUT? The theory seems to be use POST if it's
> new, or PUT if it's an update, but neither has worked.
>
> * What mime type would you use? The 3 ideas were octet-stream, multipart
> or java jar (not the exact syntax)
>
> * Would I shove just the bytes of the jar file, or do I need multipart and
> also include some type of XML file as well?
>
> * Is it OK to just write the raw bytes of the jar, or do I need to encode
> them?
>
> * Assuming I could upload a JAR, would I then also need to issue some type
> of "commit", the way the UI does?
>
> * Do you agree that this should be possible to test with curl? (to
> eliminate Java coding and library differences as the problem)
>
> * Instead of a JAR, is there some other fact model / syntax that I can
> automatically generate and upload? I get the impression there is, but
> neither the doc nor the 3 books seem very specific, I haven't seen a full
> example of this.
>
> * Generally, for dynamic models driven by external systems, what is the
> "Best Practice" for telling the Guvnor UI about the model? Maybe I'm going
> about this all wrong?
>
> * Does Drools 6 and the new Guvnor replacement suddenly make this much
> easier?
>
>
> I've been looking around and experimenting for about a week now so I'm
> running out of ideas.
>
> Thanks,
> Mark
>
> --
> Mark Bennett / LucidWorks: Search & Big Data / [hidden email]<http://user/SendEmail.jtp?type=node&node=4025580&i=0>
> Office: 408-898-4201 / Telecommute: 408-733-0387 / Cell: 408-829-6513
>
>
> _______________________________________________
> rules-users mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=4025580&i=1>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://drools.46999.n3.nabble.com/rules-users-So-can-you-automatically-up...
> To start a new topic under Drools: User forum, email
> ml-node+s46999n47000h33(a)n3.nabble.com
> To unsubscribe from Drools, click here<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscr...>
> .
> NAML<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_vi...>
>
-----
Nicolas Héron
--
View this message in context: http://drools.46999.n3.nabble.com/Re-rules-users-So-can-you-automatically...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Re: [rules-users] unable to resolve method using strict-mode
by Roopa
Hi,
Even I am struck in the same kind of problem.
"RuleBaseTask failed: [Error: unable to resolve method using strict-mode:
com.nph.radar.drools.UpdateQuery.updateQuery(com.nph.radar.rule.operands.Query,
com.nph.radar.rule.operands.AOCCRuleKnobConfig, java.lang.String,
org.apache.log4j.Logger)]"
[Near : {... updateQuery($query, $aoccRuleK ....}]
This is the error I am getting while compiling drl file.
I am calling a method in the when clause.
The same code works fine in eclipse. Error is when I am compiling using ant
script.
Eclipse is doing some settings, that even I got to do in ant script.
I am using drools 5.5.0 and eclipse indigo.
Code :
function String updateQuery(Query querie, AOCCRuleKnobConfig
aoccRuleKnobConfig, String advPgmExclude, Logger log){
}
rule "ExecuteQuery"
//include attributes such as "salience" here...
no-loop true
salience 9
when
//conditions
$aoccRuleKnobConfig : AOCCRuleKnobConfig($commissionThreshold :
commissionThreshold)
$query : Query(name == "Account-Eligibility-Criteria" , $statement :
statement)
Query(name == "AdvisoryProgramExclusion" , $advPgmExclude :
statement)
$order : Order() from
hibernateSession.createSQLQuery(updateQuery($query, $aoccRuleKnobConfig,
$advPgmExclude, log))
.addScalar("id",LongType.INSTANCE)
.addScalar("totalCommission", BigDecimalType.INSTANCE)
.setResultTransformer(Transformers.aliasToBean(com.nph.radar.rule.operands.Order.class)).list();
then
end
Thanks in advance.
--
View this message in context: http://drools.46999.n3.nabble.com/unable-to-resolve-method-using-strict-m...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Drools desciion tbale - obecjt intialisation
by captainrhino
The following descision table is being used to initialise some question
object before fire all our rules.
<http://drools.46999.n3.nabble.com/file/n4025538/table.gif>
Its creating the following rules butI only want a new question created for
each row with the ability to split the data across multiple columns. I
could probably do this using the data all in one column and use a comma
delimted list but was wondering of there was a way to split the data across
columns for a single rule?
rule "create static questions_18"
salience 65518
when
eval( true )
then
insert(new Question(99,"$2","$3",$4));
insert(new Question(nameA,"$2","$3",$4));
insert(new Question(SELECT,"$2","$3",$4));
insert(new Question(10,"$2","$3",$4));
end
regards and thx for any advice
Graeme
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-desciion-tbale-obecjt-intialisat...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
So can you automatically upload a POJO JAR Model or not?
by Mark Bennett
Hi guys,
I'm using 5.5, and I've looked around and around on Google, and although I've seen a few claims that this might work, so far I haven't had any luck. I'm getting various errors, 404 no such page, also "service not available".
I do pass in the authentication header. I'm also making sure to generate Java 1.6 classes, and the UI accepts the JAR without complaint and exposes it in the UI.
I saw one post claiming to upload as an asset, but there was some code change required to Drools/Guvnor to get it to treat it as a model, so that's not an option.
Let me try a few simple questions that might narrow this down:
* Would you expect to use the REST API or the Webdav API to upload?
* What would the URL look like? (I've tried a bunch, looks simple enough online, and I'm able to download the DRLs)
* I downloaded the combo pack of JBoss and Drools/Guvnor 5.5. Is there maybe some config change needed to enable the additional REST or Webdav URLs?
* When you submit a JAR interactively, I know GWT is involved, but does it hand over the request to either the REST or Webdav API? OR does it have some other special entrance into the system, some third way in? And if so, could I use that?
* Would I use a POST or a PUT? The theory seems to be use POST if it's new, or PUT if it's an update, but neither has worked.
* What mime type would you use? The 3 ideas were octet-stream, multipart or java jar (not the exact syntax)
* Would I shove just the bytes of the jar file, or do I need multipart and also include some type of XML file as well?
* Is it OK to just write the raw bytes of the jar, or do I need to encode them?
* Assuming I could upload a JAR, would I then also need to issue some type of "commit", the way the UI does?
* Do you agree that this should be possible to test with curl? (to eliminate Java coding and library differences as the problem)
* Instead of a JAR, is there some other fact model / syntax that I can automatically generate and upload? I get the impression there is, but neither the doc nor the 3 books seem very specific, I haven't seen a full example of this.
* Generally, for dynamic models driven by external systems, what is the "Best Practice" for telling the Guvnor UI about the model? Maybe I'm going about this all wrong?
* Does Drools 6 and the new Guvnor replacement suddenly make this much easier?
I've been looking around and experimenting for about a week now so I'm running out of ideas.
Thanks,
Mark
--
Mark Bennett / LucidWorks: Search & Big Data / mark.bennett(a)lucidworks.com
Office: 408-898-4201 / Telecommute: 408-733-0387 / Cell: 408-829-6513
11 years, 3 months
setting the @expires in java
by samsonrithvik
Hi,
how do i set the @expires vaule in the java class.
because in drl file @expires id not accepting the variables. so i want to
set it in the java class. how do i do that
my sample drl file looks like this
declare MyEvent
@role(event)
//@expires(timeThreshold) not working because its not accepting the
variables
end
my event class looks like this
public class MyEvent {
private String eventName;
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public MyEvent(String eventName) {
super();
this.eventName = eventName;
}
}
Now how do i delclate @expires in this java class ?
--
View this message in context: http://drools.46999.n3.nabble.com/setting-the-expires-in-java-tp4025574.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Destroy the events
by samsonrithvik
How do i destroy the events in dsl ..when i no longer needed it
for example
this is my sample .drl file
rule "setting the event"
no-loop
when
$msg : Message($eventName:eventName ,$host: hostName) from entry-point
myevent
not $event:Myevent(eventName == $eventName,hostName == $host)
then
insert(new Myevent($eventName,$host));
end
Now how do i destroy the event Myevent when i'm not getting any message from
that entry-point after certain amount of time
--
View this message in context: http://drools.46999.n3.nabble.com/Destroy-the-events-tp4025418.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Can't build 5.5.x with Maven 3.0.4 nor 3.1.0
by Mark Bennett
(sending this to user since I'm not hoping to modify anything, just want to see what's going on, debug, etc)
I'm working through this command on the 5.5.x branch:
droolsjbpm-build-bootstrap/script/mvn-all.sh clean install -DskipTests
I started the day with Maven 3.0.3, but had to upgrade due to this error:
[INFO] --- maven-enforcer-plugin:1.2:enforce (default) @ kie-parent-metadata ---
[WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
Detected Maven Version: 3.0.3 is not in the allowed range [3.0.4,).
The maven site put me to 3.1.0.
But now I'm getting this error:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getRepositorySession()Lorg/sonatype/aether/RepositorySystemSession;
at org.eclipse.tycho.core.maven.utils.PluginRealmHelper.execute(PluginRealmHelper.java:86)
Looking around, it appears Maven 3.1.0 is the problem:
(http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg26246.html)
So… Can't use maven 3.0.4, and can't use 3.1.0…
I guess I could look for maven 3.0.5, but this seems really odd to back port, and make things so fussy on build tools. I haven't seen mvn sensitivity like this on other projects?
BTW, encountered other problems as well running mvn-all.sh against 5.5.x
Links:
Following link from this page: http://www.jboss.org/drools/source-code
To this readme file: https://github.com/droolsjbpm/droolsjbpm-build-bootstrap/blob/master/READ...
But switched to 5.5.x branch: https://github.com/droolsjbpm/droolsjbpm-build-bootstrap/tree/5.5.x
--
Mark Bennett / LucidWorks: Search & Big Data / mark.bennett(a)lucidworks.com
Office: 408-898-4201 / Telecommute: 408-733-0387 / Cell: 408-829-6513
11 years, 3 months
Duplicating template capability in decision table?
by dunnlow
My long lived templates have stopped working (I click the Load Template Data
button and nothing happens) -- I have seen this issue in Jira spanning
several versions (with associated "fixes"). Oh well.
Anyway, I've decided to re-implement using a decision table, which I heard
can duplicate the same functionality. I'm close but can't get past one
issue.
I'm using Drools 5.5, and building the decision table in guvnor.
I am trying (as an Action) to create a new object, assign some of its
variable using a few different columns in the table, and then insert it.
There are at least 5 values that I want to assign, so I don't want to cram
something like "1,123.31,TRUE,2,BROWN" in a single cell -- I want each of
those fields to have their own cell with a header.
The resulting code should look like:
TravelEvent $te = new TravelEvent();
$te.setStartTag({value from "start" column});
$te.setEngTag({value from "end" column});
$te.setOneWay({value from "oneway" column});
.
.
insert($ne);
I've tried putting it all into an action BRL that looks like:
THEN
Insert TravelEvent [$te]:
startTag $start
endTag $end
That creates a column for those values, but no headings. Thus it is only
somewhat better than a comma separated list.
Has anyone tackled this issue before?
Thanks for any thoughts,
-J
--
View this message in context: http://drools.46999.n3.nabble.com/Duplicating-template-capability-in-deci...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months