Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1266126

Summary: [GSS](6.1.z)@Timestamp and @Expires Java annotations don't work
Product: [Retired] JBoss BRMS Platform 6 Reporter: William Antônio <wsiqueir>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED EOL QA Contact: Lukáš Petrovický <lpetrovi>
Severity: unspecified Docs Contact:
Priority: high    
Version: 6.1.0CC: alazarot, kverlaen, mfusco, mwinkler, tzimanyi
Target Milestone: CR1   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1265773 Environment:
Last Closed: 2020-03-27 19:01:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1265773    
Bug Blocks: 1259378, 1259382    

Description William Antônio 2015-09-24 14:28:51 UTC
+++ This bug was initially created as a clone of Bug #1265773 +++

Description of problem:

urrently to allow the engine to calculate the sliding window, we must make an explicit declaration in the DRL file, for example:

declare StockTick

    @expires( 30m )

end

Source:
https://docs.jboss.org/drools/release/6.2.0.Final/drools-docs/html/ch08.html#d0e10784

However, it should be possible using Java annotations, for example:

@Role(Role.Type.EVENT)

	@Timestamp("theTimestamp")

	@Expires("1s")

	public class MyEvent implements java.io.Serializable {

		…

	}

However, it is not working in BRMS 6.1.

Version-Release number of selected component (if applicable):

N/A

How reproducible:
Always.

Steps to Reproduce:
1. Create a Java object as an event and use the annotations Timestamp and expire to declare the sliding window for this event
2. Use Stream mode for event processing
3. Put a few events in the working memory, which should be retracted according to the rules you set using the expire annotation

Actual results:
The events will not be retracted after it reaches the expiration time.

Expected results:
The events should be retracted.

Additional info:
The same concern can be found in this community thread:

http://stackoverflow.com/questions/30257724/memory-decline-when-use-drools-stream-mode

And other community users have discussed the use of these annotations in Java files in this other community thread:

https://groups.google.com/forum/#!searchin/drools-usage/@Timestamp/drools-usage/YmZE_wlZUnw/twmS0KGYzD4J


Attached to this case you can find a test case provided by customer that shows the issue when only using annotations.

--- Additional comment from JBoss Product and Program Management on 2015-09-23 13:50:19 EDT ---

Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 2 Mario Fusco 2015-09-25 15:16:42 UTC
Cherry-picked to 6.2.x branch with https://github.com/droolsjbpm/drools/commit/7579a4215

Comment 3 Tibor Zimanyi 2015-10-09 14:21:17 UTC
Verified in 6.1.4.CR1.