Products | Versions |
---|---|
TIBCO BusinessEvents Enterprise Edition | - |
Not Applicable | - |
Resolution:
Description:
============
Rescheduling a scheduled event with a workitem key after removing it in TIBCO BusinessEvents.
Environment:
============
All Operating Systems
TIBCO BusinessEvents 4.x,5.x
Symptoms:
============
Scheduled Event not firing after modification of its scheduled execution time .
Root Cause:
============
1). Removing and creating a scheduled event in the same RTC does not reschedule the scheduled event .
2). Trying to execute Cluster.removeSchedule into a rule with priority 5 and then have the Cluster.scheduleEvent() in another rule which has priority 6. (Execution of both rules is part of same RTC).
Resolution:
============
While removing and creating a scheduled event in the same RTC note that the newly created scheduled event cannot be rescheduled . Wait for the RTC in which remove scheduler work is done to finish completely. Then, invoke create scheduler again in a different RTC to reschedule it . So two events are required in two different RTC , one to remove the scheduler and the other to create it for the newly created scheduled event to be rescheduled.
Steps to run the attached example TestScheduler.7z (Compiled with TIBCO BusinessEvents 5.0.1):
The attached sample project shows how to reschedule a scheduled event with a workitem key after removing it . The project has 3 events A , B and C .
1). Start the cache in a command line and default engine in studio .
2). Use the rule input to invoke events. (See attached RuleInput.png for locating it in studio).
3). On sending event A through rule input -- > it executes AExec rule and then creates another scheduled event A ( with time of occurrence after 20 seconds ) with some workitem key inside it which gets fired again after 20 seconds (note this is one RTC)
4). Event B fires rule BExec which removes the scheduled event A with the same workitem key as used during the creation of scheduled event A (note this is one RTC)
So if event B is fired within 20 seconds of event A being fired then the scheduled event A does not occur as event B removed it , but if event B is not fired then event A occurs normally .
5). Now if event C is fired after event B then the rule CExec gets fired which creates another scheduled event A with the same workitem key but with a different scheduled time and then this scheduled event A event takes place at the rescheduled time (in our example its 50 seconds). Note that this is one complete RTC.
So after removing a scheduled event with some workitem key we can reschedule the scheduled event with the same workitem key but different time of occurrence. Refer to the complete log file (FullLog.txt). For further details understanding the log output refer to LogDescription.txt .
Attachments :
=============
LogDescription.txt
FullLog.txt
TestScheduler.7z
RuleInput.png