help with designing / implementing a way for users to write their own rules
by kurrent93
Dear drools experts
Can I get some ideas on how best to do the following.
I would like users of my app to be able to write their own rule(s). For
example, if Joe User buys an item that is more that $200 then he uses XYZ
shipping. If he does not select shipping the he uses ABC shipping.
More precisely, how can I offer the ability, using Guvnor, for the end user
to write a rule, that does not give him the ability to modify a rule
condition regaring user id. The example above, of coures, has a condition
that if user is 'Joe User'.
There are very many places in the app where users should be able to write
rules, so it would be nice to use (embed) guvnor, rather than writing a
special UI for each situation.
Any suggestions welcome.
Br
Anton
--
View this message in context: http://drools.46999.n3.nabble.com/help-with-designing-implementing-a-way-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
6.0 Alpha - Annotation Driven development with Multi Version Loading
by Mark Proctor
http://blog.athico.com/2012/12/60-alpha-annotation-driven-development.html
-----
Drools & jBPM 6.0 alpha should be out end of next week. 6.0 introduces convention based projects that remove the need for boiler plate code - literally just drop in the drl or bpmn2 and get going. Further we now allow rules and processes to be published as maven artifacts, in maven repositories. These artifacts can either be resolve via the classpath or downloaded dynamically on the fly. We even support out of the box side by side version loading, via the maven ReleaseId conventions.
As a little taster here is a new screenshot showing the annotation driven development. The lines below are all that's needed to dynamically load a module from a local or remote maven repository and start working with it. KieSession is the new, shorter name, for StatefulKnowlegeSession. Kie is an acronym for "Knowledge Is Everything", but I'll talk about Kie in another blog, expect to start hearing a lot about it soon :)
And here is a complete example screen shot. Create the drl, define the kmodule and start using them.
(click image to enlarge)
13 years, 6 months
Drools Planner: Solving a job schedule problem
by mr_moe
Hey,
I want to solve the following problem using drools planner:There are several
jobs which should be worked through by a machine on one day. Each job has a
length and a constraint that it only can be worked of between a fixed start
and end date.
For example there are three tasks
Job first possible start date last possible start date length
A 7:00 am 8:30 am 60 min
B 7:30 am 10:00 am 30 min
C 10:30 am 12:00 pm 60 min
The jobs should be organized in the following way, that there is as less
time between tasks as possible. If it is due to restrictions not possible to
order the tasks without a break and also the break is longer than, say, 20
minutes, the tasks should be organized with a long break as possible.Tasks
cannot overlap.
A good solution would be:
Job Start date End date
A 7:00 am 8:00 am
B 8:00 am 8:30 am
C 12:00 am 1:00 pm
First, the planning variable (ValueRangeType.FROM_PLANNING_ENTITY_PROPERTY)
of each task is its start date, which can takes a value which is between the
first possible start date and the last possible start date. E.g. possible
start dates for job A are between 7:00 am and 8:30 am. To make sure, that
tasks aren’t scheduled at the same time, I’ve written a hard constraint
rule, which checks if one task overlaps with another one. And running the
planner with hard constraints only, it works fine.
But now I’m getting problems, writing the soft constraints. At the moment,
every job (planning entity) has variables, called “nextJob” und “prevJob”,
which points to the jobs which are scheduled before and after that job. In
my example, it would look like this:
Job prevJob nextJob
A null Job B
B Job A Job C
C Job B null
My intention of these variables is that I can check with a soft constraint
rule, if the current chosen job and the job with which it gets compared are
consecutive jobs, and if so, how much time between these jobs is left.
In the soft constraint rule, I check if the “nextJob” Variable points to the
job, with which I’m currently comparing the job. If this is the case, then
there is no other job scheduled between those jobs and I can check how much
time between these jobs is left.
Every time drools planner reschedules a job, I have to check if nextJob and
prevJob of each job are still pointing to their right predecessor and
successor.
For example, if Job A gets moved to 8:00 the sequence could look like this:
Job Start date End date
A 8:00 am 9:00 am
B 7:30 am 8:00 am
C 12:00 am 1:00 pm
Therefore the variables preJob and nextJob have to be adjusted for each job:
Job prevJob nextJob
Job A Job B Job C
Job B null Job A
Job C Job A null
To achieve that, I use a list in which I save the current order of the
jobs.Furthermore I’ve written my own mover that, besides assigning the
current job to its new start date, updates the list and each job if a job
gets rescheduled.
You’ve probably got the punch line by now: It’s not working. And besides
from getting a scoreCurroption exception, I truly doubt that this is the
perfect solution for solving this planning problem.Have any of you an idea,
what a better way for solving this problem could be?
I’ve tried to find a similar problem in the examples, but none of them has
similar restrictions as mine. The curriculumcourse example has only fixed
time slots instead of a variable length and in the nurserostering, nurses
(jobs) get assigned to fixed shifts (time periods) and not the other way
around.
Thanks!
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Planner-Solving-a-job-schedule-p...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months