is there any 'followed by' in Drools as we have in esper
by skatta1986
Hi,
Please any one let me know if there is any followed by operator in Drools. I
want to correlate an event with another event which follows the first event.
Esper supports this by using followed by (->) operator.
Example in esper:
"select r1.name as name,r1.userIPAddress as ipaddress,count(*) as
usr_success_count, (r2.getTimeStamp()-r1.getTimeStamp()) as delta_time from
pattern" +
"[ (every r1=EventRecord(eventNumber=105, eventType='EVENT_REQUEST'))-> " +
"(r2=EventRecord(eventNumber=110, eventType='EVENT_SUCCES',
id.getCallId()=r1.getId(), name=r1.name)) where
timer:within(usr_timeout_interval sec)]";
Can you please providesimilar kind of rule in Drools.
--
View this message in context: http://drools.46999.n3.nabble.com/is-there-any-followed-by-in-Drools-as-w...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
Objects from Working Memory not available in drl
by Magublafix
Hey guys,
I'm playing with the drools planner a few days now and got stuck.
I have a Solution with an PlanningEntity Ambulance and a normal Class
SendAmbulance.
I add a List SendAmbulance to the Working Memory with the getProblemFacts()
method. The Ambulance objects are loaded automatically.
The problem now is that i can access the Ambulance Objects within the drl
correctly but nut the SendAmbulance objects.
Has somebody an advice for me to solve this?
thanks,
Magublafix
--
View this message in context: http://drools.46999.n3.nabble.com/Objects-from-Working-Memory-not-availab...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
Employee Shift Rostering: algorithm details
by HarrySimons
Hi,
I'm new both to Drools Planner and to metaheuristic algorithms like Tabu
Search. Though I have done some preliminary reading on the Net on how this
algorithm 'generally' works -- including reading the 'plain-English'
portions of Chapter 8 of the 'Essentials of Metaheuristics' book -- it still
isn't perfectly clear to me how an actual implementation of the algorithm
would code the 'Tweak' / 'Next Move' function (other than via a random
combination of planning variables) in an application such as Employee Shift
Rostering with a very large search space and with multiple planning
variables.
On the page (http://www.jboss.org/drools/drools-planner.html) where Drools
Planner is compared side-by-side to other naive (greedy algorithms-based)
approachesfor various kinds of problems, could it be the case that the
algorithms used in Drools Planner were able to perfectly solve the
highlighted problems only because of the use of extremely small search
spaces / input datasets?! A wikipedia entry related to metaheuristic
algorithms says that not only is it possible that such an algorithm may not
give an optimal solution, it may not even give any solution at all(!!) due
to the algorithm reaching its timeout limit specified by the user. I'm
assuming it won't be possible to specify a timeout value in days or even
hours for any metaheuristics-based approach to a real-world problem of a
real-world scale.
Lastly, from looking at the pseudocode of Tabu Search, it *appears* that the
core, 'driver portion' of the algorithm may itself be not all that hard to
implement; it is rather the call-back portion of the algorithm (such as the
problem-specific Tweak / Next Move function, which the driver portion calls
back) that may be hardest to implement. Given this, what would be the
advantages of using Drools Planner over a from-scratch, hand-coded version
of Tabu Search (other than its declarative, rule-based flexibility which a
hand-coded, from-scratch version may not want to implement due to its focus
on solving a specific planning problem vs. a whole slew of generic planning
problems requiring a generic piece of code such as Drools Planner)?
Would greatly appreciate if someone more knowlegeable than me could clarify
/ elaborate on the above getting-started questions of mine.
Regards,
/HS
--
View this message in context: http://drools.46999.n3.nabble.com/Employee-Shift-Rostering-algorithm-deta...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
[Drools Planner] Proof-of-Concept Stock-planning System
by Reinis
Hello,
I want to ask you, guys, if you could guess if it is possible or
probable to build such a System with Drools Planner:
The system shall plan the best time where the transport unit (TU) has to
be input into stock system to reach set delivery deadlines, utilization
of resources and load balancing of bottle necks (all expressed as rules).
Most of things (resource capacity, route within the stock system, etc.)
are given and constant facts. Actually there is only one planning
variable - time interval of a transport unit characterizing retention
period within a given Resource. Like this:
TU#1 is in Resource #A from 11:00 till 11:30 <- the optimal interval has
to be planned
TU#1 is in Resource #B from 11:45 till 12:00 <- the optimal interval has
to be planned
TU#1 is in Resource #C from 12:30 till 13:00 <- the optimal interval has
to be planned
I have following problem size and constraints:
- TUs per day: 160'000
- Amount of resources a TU travel through: 3
- Average smallest time interval: 15 Min
- Planning period: 09:00 - 16:00 = 8 hours = 32 intervals
- Initial planning window: 4-6 hours
- continuous planning multiple batch execution time during the day after
addition and/or retraction of number of TUs: 20 minutes
So the problem size would be(?):
(TUs * resources) ^ intervals = (160'000 * 3) ^ 32 = 6.305500958×10¹⁸¹
I know there is no one answer to this question. I would like only to get
your feeling on this problem. Would you take on solving this sort of
problem with drools planner?
thanks and br
Reinis
12 years, 7 months
drools process flow not firing all rule flow group
by ravendra.gupta
I have segregated my rules in two ruleflow-groups 1. mandatoryRulesGroup and
2. businessRulesGroup, and I want to use them in same given order.
details is below
-------------------------------------------------------------------------------------------
1. #business rule: 09
rule "Earth Station attached to uplinked carriers"
ruleflow-group "mandatoryRulesGroup"
when
$es: EarthStation($esId: id, $esPolarizationId:
earthStationType.feedPolarisationTypeUUIDRef.id)
$cxr: Carrier( $cxrId: id, $cxrPtxpId: potentialTransponderUUIDRef.id)
CarrierCarrierTransmitEarthStationCrossAggregateUUIDAssociation(earthStationId
== $esId)
from $cxr.carrierTransmitEarthStationAssociations
then
insert(new EsLinkedUplinkCxr($es, $cxr)); //
end
--------------------------------------------------------------------------------------------------
2. Rule "Carriers transmitted to transponders on same satellite"
ruleflow-group "businessRulesGroup"
when
$cxr: Carrier()
then
System.out.println("Carriers transmitted fired");
end
-------------------------------------------------------------------------
the problem is if I add only carriers fact then second group execute, but if
I add earth station and Carriers fact second group doesn't execute. looks
like only one group executes
my test file is like below
-------------------------------------------------------------------------------------------------
kbuilder.add(ResourceFactory.newClassPathResource("mandatoryRules.drl"),
ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource("businessRules.drl"),
ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource("ruleFlowProcess.bpmn"),
ResourceType.BPMN2);
kSession.insert(testData.cxrRxesTxpSatCons003); //Carrier1
kSession.insert(testData.cxrHpaLimitCons1004); // Carrier2
kSession.insert(testData.esRxesTxpSatCons001);// EarthStation(If I
add this businessRulesGroup not fired!!)
kSession.startProcess("ruleFlowProcess");
kSession.fireAllRules(new AgendaFilter() {........});
-----------------------------------------------------------------------------------------
ruleFlow.bpmn:
<process processType="Private" isExecutable="true" id="ruleFlowProcess"
name="ruleFlowProcess" tns:packageName="ruleFlowProcess" >
<startEvent id="_1" name="Start" />
<businessRuleTask id="_2" name="graphBuilderRuleTask"
g:ruleFlowGroup="graphBuilderRulesGroup" >
</businessRuleTask>
<businessRuleTask id="_4" name="mandatoryRuleTask"
g:ruleFlowGroup="mandatoryRulesGroup" >
</businessRuleTask>
<businessRuleTask id="_5" name="businessRuleTask"
g:ruleFlowGroup="businessRulesGroup" >
</businessRuleTask>
<endEvent id="_6" name="End" >
<terminateEventDefinition/>
</endEvent>
<businessRuleTask id="_7" name="filterRulesTask"
g:ruleFlowGroup="filterRulesGroup" >
</businessRuleTask>
---------------
------------------------------------
I am not able to figure out why both groups not are not being executed even
after I am inserting data to satisfy all of the rules.
I would be grateful, if someone could help me to get the clue.
Thanks very much.
-Ravi
--
View this message in context: http://drools.46999.n3.nabble.com/drools-process-flow-not-firing-all-rule...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
https://issues.jboss.org/browse/GUVNOR-579
by Sean Su
I see this case has been marked as resolved but without any comment. I am about to start a new project based on fusion but I need a UI such as guvnor. How are we supporting fusion in Guvnor? I could find reference documents on this topic.
Does anyone have experience here?
Thanks
Sean
Sent from my iPad
12 years, 7 months
Using accumulate function
by sanal
Hi,
Iam trying to use the accumulate function of the drools.I need to
accumulate based on the result of a rule execution.
Eg: Suppose i have list of orders and another list of conditions
for a particular package.I need to check weather each of the order is part
of package or not.
Suppose a qty limit is set to 1 for a item in package definition and
the item is ordered 2 times.
While checking the condition, both of the item will go under package.
Actually for second record the rule should get executed based on result of
the 1 record's rule execution and so on.
So I require a looping rule execution.
How can i achive this using Drools.
Rule "Package Rate_21"
salience 65515
when
$objOrderedComponents:AccumulatedComponent()
$packageDefinition:PackageDefinition($packageId:packageId)
$accumulatedQty:Number()
from accumulate(
$accQtyComponent:OrderedComponent(packageChargeRecordId==$packageId, $AccQty
: componentQty) from
$objOrderedComponents.getOrderedComponentList(),sum($AccQty ) )
$orderedComponent:OrderedComponent($id1:componentKey,$qty:componentQty)
from $objOrderedComponents.getOrderedComponentList() and
$pkgComps:PackageComponent(componentKey==$id1,(quantityLmt
>=($qty+$accumulatedQty.intValue()))) from
$packageDefinition.getPackageComponentList()
then
$orderedComponent.setIsComponentApplicable(true);
$orderedComponent.setPackageChargeRecordId($packageId);
end
Regards
Sanal.P
--
View this message in context: http://drools.46999.n3.nabble.com/Using-accumulate-function-tp3896078p389...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months