Using hashmap in guided decision table in Guvnor
by ankitmasrani
Hi,
I am new to Drools and Guvnor and I have the following query:
1. I have uploaded a pojo model jar which has a class A containing a
hashmap<String, String> attr1.
2. Then, I created a new rule- Guided decision table.
3. And i want to define a rule lets me select a key of the hashmap defined
using the drop-down pop-up and check the corresponding value in the second
column. Then perform an action.
Example: check Key= "Name" and value="Abc". then set an output string- "Name
ok" in action.
Please provide any suggestions.
Thank You
Ankit
--
View this message in context: http://drools.46999.n3.nabble.com/Using-hashmap-in-guided-decision-table-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 11 months
Scheduling events with varying durations - corrupted score
by nickels
Hi, I am relatively new to the Drools space and I am working on a project
utilizing Drools planner (5.4.0.Beta1) for use in scheduling events. I have
a set of events of varying duration and a set of possible venues for the
events with varying availability. I read some previous comments relating to
similar problems and it seems that the best approach is to create time slots
for each of the venues and then assign the events to time slots based on the
availability similar to how the CloudBalancing example assigns tasks to
machines. The difference is that I need to know the actual start/end time of
each event for a given time slot during planning in order to make sure that
an event is not scheduled at the same time as another event from a previous
run of the solver for another schedule.
Here is how the problem is modeled (simplified to the important parts):
- Event (Planning entity) {venueTimeSlot, startDateTime, endDateTime,
duration}
- VenueTimeSlot (Planning Variable) {Venue, startDateTime, endDateTime,
duration}
- PreviousEvent (Constraint) {Venue, startDateTime, endDateTime}
And the pertinent rules:
// Rule that makes sure the time slot can fit the number of events scheduled
in it.
rule "minimalDurationTotal"
when
$venueTimeSlot : VenueTimeSlot($duration : duration)
$minimalDurationTotal : Number(intValue > $duration) from
accumulate(
Event(venueTimeSlot == $venueTimeSlot, $minimalDuration :
totalDuration),
sum($minimalDuration)
)
then
insertLogical(new IntConstraintOccurrence("minimalDurationTotal",
ConstraintType.NEGATIVE_HARD, $minimalDurationTotal.intValue() - $duration,
$venueTimeSlot));
end
// Rule that checks for any previous events that were already scheduled for
this venue
rule "previousEventConflict"
when
$e : Event($venue:venueTimeSlot.venue)
exists PreviousEvent(venue == $venue, startDateTime <= $e.endDateTime,
$e.startDateTime <= endDateTime)
then
insertLogical(new IntConstraintOccurrence("previousEventConflict",
ConstraintType.NEGATIVE_HARD, 1, $e));
end
// Rule that calculates the start/end date time for the event based on the
events in the time slot
rule "updateEventDateTime"
salience 10
when
$e : Event()
$eventList : LinkedList() from collect(
Event(venueTimeSlot == $e.venueTimeSlot)
)
then
$e.updateDateFromEventList($eventList); --> Loops through the events and
sets the startDateTime
end
Ok, so this rule that updates the date time is where I am not sure about, I
get an error about score corruption during the construction heuristic phase.
java.lang.IllegalStateException: Score corruption: the presumedScore
(0hard/0soft) is not the uncorruptedScore (-1hard/0soft):
The workingMemory has 0 ConstraintOccurrence(s) lacking:
previousEventConflict/NEGATIVE_HARD:[Event 75]=1
Check the score rules who created those ConstraintOccurrences. Verify that
each ConstraintOccurrence's causes and weight is correct.
Problem is I don't know what order the events were "added to the time slot"
so every time I call the updateDateFromEventList method the list of events
may be in a different order and therefore change the actual time they occur.
How is it that I set the position of the event when the time slot is set by
the construction heuristic? Or is there a better way altogether to model
this?
Any insight you can provide would be appreciated.
Best Regards,
Nick
--
View this message in context: http://drools.46999.n3.nabble.com/Scheduling-events-with-varying-duration...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 11 months
Drools HA
by gboro54
Hi everyone. We are currently evaluating drools as a potential solution of a
high throughput billing system. As is such we are planning to have messages
read from a queue from 2 or more nodes. One thing we are trying to figure
out is best way to share state in drools. The situation we are facing is as
follow:
-Node 1 reads message 1
-Node 2 reads message 2
-Node1 begins execution of rules on message 1 with context information
-Node2 begins execution of rules on message 2 with context information
-Node 1 updates the context information such that rules being executed by
node2 should be reevaluated(i.e node 1 in the rules session executed an
update on the context object)
What is the best way to handle this situation?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-HA-tp3619496p3619496.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 11 months
KnowledgeAgent and applyChangeSet
by bob.breitling
If I have a KnowledgeAgent and I create a URL Resource and set its
basicAuthenication, username and password attributes then I call the agents
applyChangeSet method I get a HTTPD 401 response from the Guvnor. It does
not happen to my resourse which has a valid username and password, but it
happens to the resource in the changeSet xml tag.
It would seem to me that the resources that are built from the resource I
passed would inherit the basicAuthenication, username and password
attributes that I set and know work, but they don't and I get this error.
If I debug the code and filling in those values on the resource passed to
the createPackageFromResource method before the resource stream is read the
code works.
I am using the NilAuthenicator in the Guvnor components.xml and that seems
to be working. I get access to the Guvnor without being asked for
credentials.
I tried to configure my jboss (4.2.0) in login-config.xml to allow access to
everything as guest. But no luck.
Any suggestions?
Bob
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/KnowledgeAgent-and-ap...
Sent from the Drools - User mailing list archive at Nabble.com.
12 years, 11 months
Doubts about JBPM and Drools versioning rules...
by Cristiano Gavião
Hi,
I've decided to build my own Knowledge OSGi bundle to be able to test
the latest things of Drools and JBPM. Now I have some puzzle is in my
head that I would like someone clarifying me.
Looking at the master branch of the droolsjbpm-parent project, which is
in version 5.4.0-SNAPSHOT, I could see this in its POM:
> <!-- Internal dependencies -->
> <drools.version>5.4.0-SNAPSHOT</drools.version>
> <drools.osgi.version>5.4.0.SNAPSHOT</drools.osgi.version>
> <drools-planner.version>${drools.version}</drools-planner.version>
> <jbpm.version>5.2.0.Final</jbpm.version>
> <jbpm.osgi.version>5.2.0.Final</jbpm.osgi.version>
and at the master branch of the jbpm project, I could see this in its POM:
> <parent>
> <groupId>org.drools</groupId>
> <artifactId>droolsjbpm-parent</artifactId>
> <version>5.3.2-SNAPSHOT</version>
> <!-- relativePath causes out-of-date problems on hudson slaves -->
> <!--<relativePath>../droolsjbpm-build-bootstrap/pom.xml</relativePath>-->
> </parent>
and at the master branch of the drools project, in its POM I could see this:
> <parent>
> <groupId>org.drools</groupId>
> <artifactId>droolsjbpm-parent</artifactId>
> <version>5.4.0-SNAPSHOT</version>
> <!-- relativePath causes out-of-date problems on hudson slaves -->
> <!--<relativePath>../droolsjbpm-build-bootstrap/pom.xml</relativePath>-->
> </parent>
Could someone explain me the choose release cycle and the relationship
of the these projects: droolsjbpm-parent, drools, jbpm ?
I think that I read once that JBPM 5 runs on top of Drools and that both
has different release cycles, but shouldn't Jbpm SNAPSHOT, once it is a
snapshot, *always* use the latest version of droolsjbpm-parent and
consequently the latest of Drools too ?
regards
Cristiano
12 years, 11 months
Scalability Tips
by Gp P
Hi All,
Can drools scale without heavy duty server or commodity servers which
startups uses
Are the tips for increasing performance and failover ? like cache
, clustering
Are there any real life success stories of startups using Drools ?
Thanks ,
Gp
12 years, 11 months