[rules-users] Time unit step-size inside rule files.

Wolfgang Laun wolfgang.laun at gmail.com
Fri Aug 20 05:43:52 EDT 2010


Nothing of the proposed mechanisms for specifying alternative time units
or units of the clock will help for dealing with events occurring
faster than 1000Hz
if the granularity of session clocks remains at 1ms.

Edson's reference to ISO 8601 made me look at what can be seen on Wikipedia.
But I could not really match what's in there with the forms for times and
durations implemented by Drools.

-W

On 20 August 2010 10:29, Thorsten <thorsten.schmidt84 at gmx.de> wrote:
> Hello Edson,
>
> I think that the possibility to modify the timestamp would be a great
> benefit especially for users working with Drools in combination with
> technical sensor data. Sensors usally produce data with an much higher
> output (lets say 8000 samples per second). The only ways to handle this
> at the moment inside the rules is using the complete number of samples
> using the timestamp in ms:
> (e.g.  EventA(this after[13200ms] $eventB )
>  // EventB 1.65s after EventA
> or your suggested solution (Mapping method inside drl)
>
>
> My suggestions are (Clean solution)
> a) Make it possible to set the clock mode to a sample based mode.
>   e.g. conf.setOption("TimeMode", "samples");
>
> b) Make it possible to enter a reference timevalue relativ to 1 second.
>   e.g. conf.setOption("BaseTimeReference",8000);
>
> c) Create a time unit for samples ("smp") to adress both: time and
> sample based events inside the rules
>
> alternative (Workaround solution):
> a) Create the possiblity to create your own time unit relativ to "ms".
>
> e.g. drools.createTimeUnit("smp_s",8000)
> //  creates a time unit named "smp_s" which has a duration of 8000ms.
>
>
> That would make the life of developers who are working in a technical
> environment so much easier.
>
> Thanks
> Thorsten
>
>
>>    Thorsten,
>>
>>    I am afraid that as it is today (time units being tied to a partial
>> ISO8601 syntax), the best you will be able to do is to use some helper
>> functions in some parts of the rules for what you need to do.
>>
>>    Although, if you propose a different way of handling that, we may
>> consider it for future releases.
>>
>>    Edson
>>
>> 2010/8/13 Thorsten <thorsten.schmidt84 at gmx.de>
>>
>>> Hello out there,
>>>
>>> is it possible to change or extend the existing time unit step-size like
>>> [h,s,ms] used inside the rules? They all seems to have a fixed (logical)
>>> relationship (e.g. 1 s = 1000ms). Unfortunately we have a different time
>>> representation in our application. We can rebuild the time model using
>>> the smallest units as pseudo time reference but this makes the rules
>>> hard to write / read as every user has to know how much
>>> “smallest-time-units” represents a real world second.
>>>
>>> Thank you very much
>>> Thorsten
>>>
>>> _______________________________________________
>>> rules-users mailing list
>>> rules-users at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>




More information about the rules-users mailing list