[rules-users] Reg : Drools 5.5 Templates : CompoundValueRestrictions

2013-09-24 Thread Barada (Native5)
Hi,

Am trying to model some rules using drools templates.
Currently the data inputs to rule templates are only strings, I need to be able 
to define a compound value restriction set for the rule i.e if fact attribute 
is present in a list. (see sample below). 

e.g. 
template header
dealers

template "my-template"
rule "my-rule"
when
$order : Order(dealer in (@{dealers}))
then 
System.out.println("Order is present in dealer"
end
end template


I am trying to compile this template by passing it an Object which has a 
dealers attribute which is essentially a List. Short of creating a 
function which sends back a comma separated representation of the list,  does 
the drools compiler provide any option to send a list.

~ Barry







signature.asc
Description: Message signed with OpenPGP using GPGMail
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Fusion 5.5 - Deterministically identifying event insert order?

2013-09-24 Thread Wolfgang Laun
There's no reason why two events shouldn't have identical timestamps.

Having to preserve order in the absence of any other distinction can't be
necessary? Can't you use any other attribute to derive the order?

If you think that you must have different timestamps: why don't you
apply the timestamp yourself and add a tick when the current insert
(of a stream) is still within the same ms.

BTW: You overuse salience. Add logic to  get things done at the proper
time, i.e., according to the proper situation.

-W

On 24/09/2013, dunnlow  wrote:
> I am testing with fusion (5.5) and running into an /intermittent /issue.  I
> am trying to track transitions between two big events (BEvent) using a
> smaller event (SEvents) with the properties I care about.  The idea is that
> I will maintain many SEvents in memory for the different kinds of BEvents.
> My basic steps (partly driven by salience) are:
>
> 1) rule a:  (salience=100): when a new BEvent is inserted, insert a new
> related SEvent
> 2) rule b: (salience=50): If there are two SEvents for this type of BEvent,
> compare them (old vs new) and act accordingly
> 3) rule c: (salience=0) remove the *old* SEvent (keeping the latest one)
> 4) rule d: (salience=-50) retract the BEvent
>
> My rule c (above) is:
> when $se1 : SEvent(name matches "auto")
>  $se2 : SEvent(this after $se1, style matches ($se1.style))
> then
>retract($se1);
> end;
>
> I am of course running in stream mode and this USUALLY works, but sometimes
> rule c does not get activated - based on the audit log.  Also, I have a
> DebugWorkingMemoryEventListener configured and I can see that two SEvents
> DO
> exist in working memory which should activate it.
>
> In my test, I have a loop in which I am inserting events.  When I add a
> brief delay, I have not seen a failure.  My guess is that the timestamps on
> the two events are the same, thus the "after" is causing the issue.
> However, I am unable to test this as the timestamp on the event is not
> accessible (from what I have found on this forum).
>
> I saw a suggestion here about using a variable on my SEvent to tell the
> difference between a new and old version.  I also considered using some
> sort
> of counter bean to order the SEvents (although I believe it would need to
> be
> serialized).
>
> My questions:
> 1) Do you agree with my assessment?  Is it possible in stream mode to have
> two events with the same timestamp?
> 2) what is the BEST way to identify which event was inserted first?
>
> Thanks for any insight!
> -J
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Fusion-5-5-Deterministically-identifying-event-insert-order-tp4026117.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] replace session clock at runtime

2013-09-24 Thread Wolfgang Laun
Setting the clock is a session configuration option, which means that
it has to be set at session instantiation time.

You might try to continue to use the pseudo-clock until you have finished
the replay and mimick the realtime clock with it, although it might need
some experimenting to learn when and how to advance the pseudo-clock:
before and/or after insertions, every n ms,...

-W

On 24/09/2013, amarok  wrote:
> I am still stuck with this. Is there any way to replay events into a
> session
> and then getting into realtime mode?
>
>
> amarok wrote
>> Drools 5.5
>>
>> Hey guys,
>>
>> Is it possible to replace the session clock of an existing stateful
>> knowledge session (STREAM mode) while it is running or at least by
>> pausing
>> and restarting it?
>> I need to feed old events into the session to restore a certain session
>> state before switching the sessions to "realtime" mode and continue with
>> new incoming events...
>>
>> A code snippet would make me very happy ;)
>>
>> - Alex
>> ___
>> rules-users mailing list
>
>> rules-users@.jboss
>
>> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/rules-users-replace-session-clock-at-runtime-tp4026090p4026112.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Fusion 5.5 - Deterministically identifying event insert order?

2013-09-24 Thread dunnlow
I am testing with fusion (5.5) and running into an /intermittent /issue.  I
am trying to track transitions between two big events (BEvent) using a
smaller event (SEvents) with the properties I care about.  The idea is that
I will maintain many SEvents in memory for the different kinds of BEvents. 
My basic steps (partly driven by salience) are:

1) rule a:  (salience=100): when a new BEvent is inserted, insert a new
related SEvent
2) rule b: (salience=50): If there are two SEvents for this type of BEvent,
compare them (old vs new) and act accordingly
3) rule c: (salience=0) remove the *old* SEvent (keeping the latest one)
4) rule d: (salience=-50) retract the BEvent

My rule c (above) is:
when $se1 : SEvent(name matches "auto")
 $se2 : SEvent(this after $se1, style matches ($se1.style))
then
   retract($se1);
end;

I am of course running in stream mode and this USUALLY works, but sometimes
rule c does not get activated - based on the audit log.  Also, I have a
DebugWorkingMemoryEventListener configured and I can see that two SEvents DO
exist in working memory which should activate it.  

In my test, I have a loop in which I am inserting events.  When I add a
brief delay, I have not seen a failure.  My guess is that the timestamps on
the two events are the same, thus the "after" is causing the issue. 
However, I am unable to test this as the timestamp on the event is not
accessible (from what I have found on this forum). 

I saw a suggestion here about using a variable on my SEvent to tell the
difference between a new and old version.  I also considered using some sort
of counter bean to order the SEvents (although I believe it would need to be
serialized).

My questions: 
1) Do you agree with my assessment?  Is it possible in stream mode to have
two events with the same timestamp?
2) what is the BEST way to identify which event was inserted first?

Thanks for any insight!
-J





--
View this message in context: 
http://drools.46999.n3.nabble.com/Fusion-5-5-Deterministically-identifying-event-insert-order-tp4026117.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] NullPointer while deleting a rule since 6.0.0 upgrade

2013-09-24 Thread Mark Proctor
Did you read the getting involved page?

If you have a bug, please open a JIRA and submit a unit test as a pull request:
http://docs.jboss.org/drools/release/5.4.0.Final/droolsjbpm-introduction-docs/html/gettingstarted.html

Mark
On 24 Sep 2013, at 14:48, Nicocb  wrote:

> I'm a bit disappointed not to get any feedback as I spent some time producing
> a sample. 
> I don't think my rule is wrong as it used to work with former versions.
> A correction or workaround could really help :) .
> 
> Thank you in advance.
> 
> -- 
> N.
> 
> 
> 
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/rules-users-NullPointer-while-deleting-a-rule-since-6-0-0-upgrade-tp4026029p4026110.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor 5.5 bug - when the advanced enum feature is used, the selected value is not saved in special condition

2013-09-24 Thread Michael Anstis
Can you please raise a JIRA at https://issues.jboss.org/browse/GUVNOR

Thanks


On 24 September 2013 18:29, Sean Su  wrote:

> Also just tested and confirmed that this is happening when I save the rule
> twice in the row - first save seems fine; do nothing and save the rule one
> more time, the selection in the last drop down is gone!
>
>
> On Tue, Sep 24, 2013 at 1:23 PM, Sean Su  wrote:
>
>> When there are 3 drop downs, one determines the values of the other, the
>> selection in the last drop down is not saved when changing the rules twice
>> in the row.
>>
>> For example: I have the following statement:
>>
>> in fact [field1] [field2][field3]
>>
>> each of the field is presented as a drop down by using the advanced ENUM
>> feature - 1 determines the values in 2 and the selection of 2 determines
>> the value of 3.
>>
>> After the value in field3 is selected, I can move on and make the changes
>> in the rule. When the first change occurred, Guvnor remembers the values
>> being selected in all 3 fields. But when another change is make, the
>> selected value in the last field (field3) will be forgotten. Please note
>> this is only happening to the last field. I did not go further and make the
>> statement contain more than 3 drop downs.
>>
>> I have tested this several times and am confident this is a bug in the
>> 5.5 final version.
>>
>> Thanks
>>
>> Sean
>>
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Guvnor 5.5 bug - when the advanced enum feature is used, the selected value is not saved in special condition

2013-09-24 Thread Sean Su
Also just tested and confirmed that this is happening when I save the rule
twice in the row - first save seems fine; do nothing and save the rule one
more time, the selection in the last drop down is gone!


On Tue, Sep 24, 2013 at 1:23 PM, Sean Su  wrote:

> When there are 3 drop downs, one determines the values of the other, the
> selection in the last drop down is not saved when changing the rules twice
> in the row.
>
> For example: I have the following statement:
>
> in fact [field1] [field2][field3]
>
> each of the field is presented as a drop down by using the advanced ENUM
> feature - 1 determines the values in 2 and the selection of 2 determines
> the value of 3.
>
> After the value in field3 is selected, I can move on and make the changes
> in the rule. When the first change occurred, Guvnor remembers the values
> being selected in all 3 fields. But when another change is make, the
> selected value in the last field (field3) will be forgotten. Please note
> this is only happening to the last field. I did not go further and make the
> statement contain more than 3 drop downs.
>
> I have tested this several times and am confident this is a bug in the 5.5
> final version.
>
> Thanks
>
> Sean
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

[rules-users] Guvnor 5.5 bug - when the advanced enum feature is used, the selected value is not saved in special condition

2013-09-24 Thread Sean Su
When there are 3 drop downs, one determines the values of the other, the
selection in the last drop down is not saved when changing the rules twice
in the row.

For example: I have the following statement:

in fact [field1] [field2][field3]

each of the field is presented as a drop down by using the advanced ENUM
feature - 1 determines the values in 2 and the selection of 2 determines
the value of 3.

After the value in field3 is selected, I can move on and make the changes
in the rule. When the first change occurred, Guvnor remembers the values
being selected in all 3 fields. But when another change is make, the
selected value in the last field (field3) will be forgotten. Please note
this is only happening to the last field. I did not go further and make the
statement contain more than 3 drop downs.

I have tested this several times and am confident this is a bug in the 5.5
final version.

Thanks

Sean
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] replace session clock at runtime

2013-09-24 Thread amarok
I am still stuck with this. Is there any way to replay events into a session
and then getting into realtime mode?


amarok wrote
> Drools 5.5 
> 
> Hey guys, 
> 
> Is it possible to replace the session clock of an existing stateful
> knowledge session (STREAM mode) while it is running or at least by pausing
> and restarting it?
> I need to feed old events into the session to restore a certain session
> state before switching the sessions to "realtime" mode and continue with
> new incoming events...
> 
> A code snippet would make me very happy ;) 
> 
> - Alex
> ___
> rules-users mailing list

> rules-users@.jboss

> https://lists.jboss.org/mailman/listinfo/rules-users





--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-replace-session-clock-at-runtime-tp4026090p4026112.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] NullPointer while deleting a rule since 6.0.0 upgrade

2013-09-24 Thread Nicocb
I'm a bit disappointed not to get any feedback as I spent some time producing
a sample. 
I don't think my rule is wrong as it used to work with former versions.
A correction or workaround could really help :) .

Thank you in advance.

-- 
N.



--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-NullPointer-while-deleting-a-rule-since-6-0-0-upgrade-tp4026029p4026110.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Does Guvnor limits the number of unsuccessful Login Attempts ?

2013-09-24 Thread Michael Anstis
Guvnor does nothing itself.

You'd need to implement something externally using a custom authenticator,
or something.


On 24 September 2013 10:44, Zahid Ahmed  wrote:

>  Hi,
>
> ** **
>
> I want to know that is there any configuration in Guvnor to limit the
> number of unsuccessful login attempts. This is required as I want to
> prevent Brute Force attack on my production Guvnor server.
>
> ** **
>
> *Environment:*
>
> **1.   **Drools-Guvnor 5.5.0-Final
>
> **2.   **Jboss EAP 6.1.0
>
> ** **
>
> ** **
>
> *Thanks and Best Regards,*
>
> *Zahid Ahmed*
>
> 
>
> ** **
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] JBPM 6 Loop back.

2013-09-24 Thread Naman Shah
Issue solved,
Had some issues with the version.
Updated to the latest and now its fine :)


On Sun, Sep 8, 2013 at 4:01 PM, Mauricio Salatino  wrote:

> Can you please elaborate a little bit more? I coudn't understand what the
> problem is.
>
> Cheers
>
>
> On Sun, Sep 8, 2013 at 6:59 AM, Naman Shah  wrote:
>
>> I got a work flow, which has a loop back.
>> ?node : yes--> do x /?node:no -->repeat previous
>>  yes works and n o dont
>> and also i cant find entires into process instance data ,using which i
>> can see the  process status.
>>
>> I am using jbpm beta 6.05
>>
>> Please find the attached BPMN for the same.
>> Node name where loop back dont work : inclusiveGateway id="_49"
>> and others too.
>>
>> -
>>
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
>  - MyJourney @ http://salaboy.com 
>  - Co-Founder @ http://www.jugargentina.org
>  - Co-Founder @ http://www.jbug.com.ar
>
>  - Salatino "Salaboy" Mauricio -
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] How To Implement Rule Flow

2013-09-24 Thread neerajs20
Thank you all for the suggestions. It really helped me. I am able to achieve
my target. 



--
View this message in context: 
http://drools.46999.n3.nabble.com/How-To-Implement-Rule-Flow-tp4025932p4026106.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Does Guvnor limits the number of unsuccessful Login Attempts ?

2013-09-24 Thread Zahid Ahmed
Hi,

I want to know that is there any configuration in Guvnor to limit the number of 
unsuccessful login attempts. This is required as I want to prevent Brute Force 
attack on my production Guvnor server.

Environment:

1.   Drools-Guvnor 5.5.0-Final

2.   Jboss EAP 6.1.0


Thanks and Best Regards,
Zahid Ahmed



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Optaplanner rules error

2013-09-24 Thread ns
It was indeed a wrongly named import. Thanks for the help.

Kind regards,

Nick



--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Optaplanner-rules-error-tp4026047p4026104.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users