before/after behavior for negative pattern
by Rob21
Hi all,
I try to detect the beginning of a scenario which is characterized by an
event happening after no other event of the same type has happened in the
last 90sec.
I can't understand why only the first of those two rules is working.
rule "Detect Scenario beginning"
when
$start : RawEvent()
not RawEvent(id == $start.id, $start after[0ms, 90s] this)
then
System.out.println($start);
end
rule "Detect Scenario beginning alt"
when
$start : RawEvent()
not RawEvent(id == $start.id, this before[0ms, 90s] $start)
then
System.out.println($start);
end
Moreover if the first sent event is a rawEvent none of them will detect it.
Where am i wrong ? (still a beginner with drools)
PS : I already posted it on the forum, but i forgot to complete all the
subscription steps so it was rejected. Sorry for the double post.
--
View this message in context: http://drools.46999.n3.nabble.com/before-after-behavior-for-negative-patt...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
ClassNotFoundException
by devan.vanreenen@gmail.com
Hi there,
Please confirm if anyone is able to assist.
I have uploaded several pojo model jars to Guvnor, and resolved all issues
when saving and validating the package configuration in Guvnor and no issue
when building packages.
I get a ClassNotFoundException for classes in a specific jar that I have
uploaded but when I download this jar from Guvnor and inspect jar those
classes are present.
As soon as i remove the rules that use objects from this problematic jar
then the rest of the rules work as expected
Do you have any suggestions on where I can start investigating this?
Please let me know if you require any further information.
Thanks and Regards
Devan
--
View this message in context: http://drools.46999.n3.nabble.com/ClassNotFoundException-tp4019536.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Best model for planning?
by mvermand
Hi,
I'd like some advice on how to make my model.
I need to plan maintenance-schedules for - let's say - airplanes.
Constraints are:
- planes are only at given moments available for maintenance (when not in
the air ;-)
- maintenance of a planes requires a number of techniciens (with specific
skills).
- techniciens have skills and also shifts and vacation.
Now, first I tought to make the maintenance of a plane the planningEntity.
But I did not know how to populate and match the techniciens.
So, second I tought to make a new Task-class the planningEntity.
A Task is a job that needs to be done by a technicien with specific skills.
Maintaining a plane requires then a number of tasks.
If I choose this model, I think I'll have to pass two Plannings variables to
the Task planningEntity:
1) a Maintenance-fact (Plane + Period + list of required tasks) and
2) a Technicien-fact (?)
Then I'll need to check if availabity of plane and availability of
technicien match and also skill-requirement of task and skills of
technicien.
Do you think this second model is the right one?
Will it perform well?
=> ? matching all combinations of plane availabilty and
techniciens-availability and -skills.
Thanks in advance
--
View this message in context: http://drools.46999.n3.nabble.com/Best-model-for-planning-tp4019464.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
(no subject)
by Post Office
����,��������euW��7���Q�<��0�������S��iV��V~S��K�q�/q�>t�|�����O0��jZ�u����<�����7'���Pf�p7^�`����A~ZGY�����,D��[� �gW���'C���#P��S7���
B�#l�%]�w��B�L����'�j0�>YU�������� �yw�T��~�L��6�F����;[�^o��y8�*/��(Jc�6�W���Ytm��������!4S*����A�E
���Vc��*��,<�~��2���f��A������V����0��:��%�&��d�
u��Cr������`m����4Rc���\�Y��e�mA�J�C%�'�1>������xN���&���JAM�X���P�V�D[F�{��-&C(�B�{�CD���3�E`�����8GJ�^pz(��4���v�
cZ�5.�F#C�W�Ia��[/�0�u?U��T�n��B44���Q
��:���/�-_�-(�?�*>��u��'�D6(�(��qw�`Q��y���Y�
������b��4 ��I�{��^��\?���[�u��5���:NW�h�22����bo��c� ��qy3R��d�2^�i��K�l��r������P�X�]?�rk��n8$L,�nGW`|��4�������Oj��J�yl���xgD���#W��nq�;�{2�Y��Z���t�Q���X�y�0����h$����k�i�;��"sw�,�r�Xn5�����KT��1��;U'5��S�hY���PT4W* %8G���f���H���'�
��R����M���l��uv C[��]2���J�.W�^�������n6�b��w�Y?�YqQs'q�U����X��4SC��wDO}��A�����}�V<�WOH�wK
MM���.��R�n��|�4��}C����|�HF�������} �r|J��;���
������c��^����M�SuE���$�ijz{;���OH?8 5��>�B�
��}M�:���F�#��Y�^�`;�&���b.��LM���(���jU
)E������H���g�u&v���u��a�Q���%7�ACV�^�H"��wpMg����/RgD���(�V�;�������}���u��)��aU���kt��P*��W��2��5e�7T�$��������d^���*��S����W^RR�Hu������n
��AX�a��u��h���.��G�;�m0)7�b���h6N$#q�U���yVb���J�U������Q�v�
�(~nMZ,�q����q�e���k����>T�Z:�`�3�]���
�fM������
--����V���j|N
���b{G6<�������Q��#�7���2�
r:���Fib\�Q�
|�"��D�����M`fS��7�A
13 years, 6 months
wkjltpkfnom m
by Post Office
The original message was received at Mon, 3 Sep 2012 16:00:20 +0530
from 138.182.126.120
----- The following addresses had permanent fatal errors -----
<rules-users(a)lists.jboss.org>
13 years, 6 months
Drools rules not getting fired
by arunodhaya80
(Sorry about the repost. Was rejected earlier from the mailing list for lack
of subscription)
I am pretty new to Drools and am probably doing something really silly. The
problem is that for some reason my Drools rules are not getting fired.
If it helps, the rules fire when I shift back to a StatelessKnowledgeSession
and use the execute method to fire the rules. However, I need to use
AgendaFilter to filter rules and I understand that agenda filters aren't
supported on StatelessKnowledgeSession yet. As a first step, I just flipped
the session to a StatefulKnowledgeSession, inserted the facts and fired all
the rules.
Had to humbly say that I was breaking my head for the past couple of days on
this. Too bad, the documentation isn't that friendly for drools (I refer to
the official documentation and the user guide.
The Rule Validator code and the Spring factory bean with which I load the
Knowledge from the rule file is quoted below. I, personally, don't see any
issues with the FactoryBean. Any pointers would be of great help.
RuleValidator.java
StatefulKnowledgeSession ksession =
knowledgeBase.newStatefulKnowledgeSession();
ksession.setGlobal("validationReport", validationReport);
ksession.setGlobal("simpleCache", simpleCache);
ksession.setGlobal("ruleValidator", this);
ksession.insert(allClientDetails); //this is a list of ClientDetails objects
(facts)
ksession.fireAllRules();
ksession.dispose();
return validationReport;
KnowledgeBaseFactory.java
import java.io.IOException;
import java.util.Map;
import org.apache.log4j.Logger;
import org.drools.KnowledgeBase;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.io.Resource;
import org.drools.io.ResourceFactory;
import org.springframework.beans.factory.FactoryBean;
public class KnowledgeBaseFactory implements FactoryBean<KnowledgeBase> {
private static Logger
logger=Logger.getLogger(KnowledgeBaseFactory.class);
private KnowledgeBase knowledgeBase;
public KnowledgeBaseFactory(Map<String,ResourceType> resourceMap) throws
IOException {
logger.debug("Resource Map : "+resourceMap);
final KnowledgeBuilder knowledgeBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
for (Map.Entry<String, ResourceType>
eachRuleResource:resourceMap.entrySet()){
knowledgeBuilder.add(ResourceFactory.newClassPathResource(eachRuleResource.getKey()),eachRuleResource.getValue());
}
if (knowledgeBuilder.hasErrors()){
logger.error(knowledgeBuilder.getErrors().toString());
throw new
RuntimeException(knowledgeBuilder.getErrors().toString());
}
knowledgeBase = knowledgeBuilder.newKnowledgeBase();
knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());
}
@Override
public KnowledgeBase getObject() throws Exception {
return knowledgeBase;
}
@Override
public Class<?> getObjectType() {
return knowledgeBase.getClass();
}
@Override
public boolean isSingleton() {
return true;
}
}
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-rules-not-getting-fired-tp401952...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months