Author: tsurdilovic
Date: 2009-08-20 12:40:30 -0400 (Thu, 20 Aug 2009)
New Revision: 11410
Modified:
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools-2.2.xsd
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/StatefulKnowledgeSession.java
Log:
Drools5 integration.
Modified:
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/StatefulKnowledgeSession.java
===================================================================
---
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/StatefulKnowledgeSession.java 2009-08-20
14:41:07 UTC (rev 11409)
+++
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/StatefulKnowledgeSession.java 2009-08-20
16:40:30 UTC (rev 11410)
@@ -6,6 +6,8 @@
import java.util.Properties;
import org.drools.KnowledgeBaseFactory;
+import org.drools.logger.KnowledgeRuntimeLogger;
+import org.drools.logger.KnowledgeRuntimeLoggerFactory;
import org.drools.runtime.KnowledgeSessionConfiguration;
import org.drools.spi.GlobalResolver;
import org.drools.event.process.ProcessEventListener;
@@ -38,12 +40,14 @@
private ValueExpression<org.jboss.seam.drools.FactProvider> factProvider;
private String[] eventListeners;
private String knowledgeSessionConfig;
+ private String auditLog;
private org.drools.runtime.StatefulKnowledgeSession ksession;
+ private KnowledgeRuntimeLogger krLogger;
@Unwrap
public org.drools.runtime.StatefulKnowledgeSession getStatefulKnowledgeSession()
throws Exception {
- if(ksession == null) {
+ if(ksession == null) {
KnowledgeSessionConfiguration ksessionconfig;
if(knowledgeSessionConfig != null) {
Properties ksessionProp = new Properties();
@@ -84,6 +88,10 @@
setEventListener(ksession, eventListener);
}
}
+
+ if(auditLog != null) {
+ krLogger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, auditLog);
+ }
}
return ksession;
@@ -121,6 +129,10 @@
@Destroy
public void destroy()
{
+ if(krLogger != null) {
+ krLogger.close();
+ }
+
if(ksession != null) {
ksession.dispose();
}
@@ -165,5 +177,19 @@
{
this.factProvider = factProvider;
}
+
+ public String getAuditLog()
+ {
+ return auditLog;
+ }
+
+ public void setAuditLog(String auditLog)
+ {
+ this.auditLog = auditLog;
+ }
+
+
+
+
}
Modified: branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools-2.2.xsd
===================================================================
--- branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools-2.2.xsd 2009-08-20
14:41:07 UTC (rev 11409)
+++ branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools-2.2.xsd 2009-08-20
16:40:30 UTC (rev 11410)
@@ -103,6 +103,7 @@
<xs:attribute name="event-listeners" type="components:string"
/>
<xs:attribute name="knowledge-session-config"
type="components:string" />
<xs:attribute name="fact-provider"
type="components:expressionType"/>
+ <xs:attribute name="audit-log" type="components:string">
</xs:attributeGroup>
<xs:element name="globals" type="components:multiValuedProperty"
/>
Show replies by date