Class RuleEngine
java.lang.Object
fr.paris.lutece.plugins.document.service.rules.RuleEngine
Rule engine. Executes rules on every document event.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RuleEngineDeprecated, for removal: This API element is subject to removal in a future version.voidinit()InitializevoidinitializedService(jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext.voidonDocumentEvent(DocumentEvent event) Observe document events via CDIvoidProcess a document event
-
Constructor Details
-
RuleEngine
public RuleEngine()Creates a new instance of RuleEngine
-
-
Method Details
-
getInstance
Deprecated, for removal: This API element is subject to removal in a future version.Use@Injectto obtain theRuleEngineinstance. This method will be removed in future versions.Returns the unique instance of theRuleEngineservice.This method is deprecated and is provided for backward compatibility only. For new code, use dependency injection with
@Injectto obtain theRuleEngineinstance instead.- Returns:
- The unique instance of
RuleEngine.
-
init
public void init()Initialize -
onDocumentEvent
Observe document events via CDI- Parameters:
event- The document event- Throws:
DocumentException- if error occurs
-
processDocumentEvent
Process a document event- Parameters:
event- The event to process- Throws:
DocumentException- raise when error occurs in event or rule
-
initializedService
public void initializedService(@Observes @Initialized(jakarta.enterprise.context.ApplicationScoped.class) jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext. It ensures that this CDI beans are instantiated at the application startup.This method is triggered automatically by CDI when the
ApplicationScopedcontext is initialized, which typically occurs during the startup of the application server.- Parameters:
context- theServletContextthat is initialized. This parameter is observed and injected automatically by CDI when theApplicationScopedcontext is initialized.
-
@Injectto obtain theRuleEngineinstance.