Interface RuleEngineJobService
- All Known Implementing Classes:
DefaultRuleEngineJobService
public interface RuleEngineJobService
The interface to provide routine operations and checks to support the rule engine related jobs
-
Method Summary
Modifier and TypeMethodDescriptionintcountRunningJobs(String ruleEngineJobCode) Checks how many currently active cron jobs a RuleEngineJob hasgetRuleEngineJob(String jobCode, String springBeanName) Retrieves (or creates one if absent) the RuleEngineJob, identified by given spring Bean namebooleanChecks whether the RuleEngineJob has any active cron jobstriggerCronJob(String ruleEngineJobCode, String jobPerformableBeanName, Supplier<RuleEngineCronJobModel> cronJobSupplier) Given the rule engine Job, create a new instance ofRuleEngineCronJobModeland run it if no other associated cron job is currently in execution
-
Method Details
-
getRuleEngineJob
Retrieves (or creates one if absent) the RuleEngineJob, identified by given spring Bean name- Parameters:
jobCode- job codespringBeanName- spring bean name- Returns:
- an instance of
RuleEngineJobModel
-
isRunning
Checks whether the RuleEngineJob has any active cron jobs- Parameters:
ruleEngineJobCode- code of the Job to check against- Returns:
- boolean indicating whether this job has any active cron jobs
-
countRunningJobs
Checks how many currently active cron jobs a RuleEngineJob has- Parameters:
ruleEngineJobCode- code of the Job to check against- Returns:
- number of active cron jobs currently running
-
triggerCronJob
RuleEngineCronJobModel triggerCronJob(String ruleEngineJobCode, String jobPerformableBeanName, Supplier<RuleEngineCronJobModel> cronJobSupplier) Given the rule engine Job, create a new instance ofRuleEngineCronJobModeland run it if no other associated cron job is currently in execution- Parameters:
ruleEngineJobCode- the code of the Job to create the cron job withjobPerformableBeanName- name of a bean ofJobPerformableto runcronJobSupplier- a supplier for the instance ofRuleEngineCronJobModel- Returns:
- instance of
RuleEngineCronJobModel
-