package com.asksunny.batch.graph.transform;

import org.kie.api.KieServices;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.StatelessKieSession;

import com.asksunny.batch.graph.BatchFlowContext;

public class JBossDroolsStatelessTransformer implements RecordTransformer {
	private KieContainer kc;
	private StatelessKieSession ksession;
	private String ruleName;
	private BatchFlowContext flowContext;

	@Override
	public void init(BatchFlowContext flowContext) {
		this.flowContext = flowContext;
		kc = KieServices.Factory.get().getKieClasspathContainer();
		ksession = kc.newStatelessKieSession("DecisionTableKS");
	}

	@Override
	public Object transform(Object transformee) throws Exception {
		ksession.execute(transformee);
		return transformee;
	}

	@Override
	public void shutdown() throws Exception 
	{
	}

}

@@ -635,25 +635,21 @@
 ion(
-%22DecisionTableKS%22
+getRuleName()
 );%0D%0A
@@ -849,16 +849,16 @@
 ption %0D%0A
-
 %09%7B%0D%0A%09%7D%0D%0A
@@ -859,11 +859,489 @@
 %0D%0A%09%7D%0D%0A%0D%0A
+%09public StatelessKieSession getKsession() %7B%0D%0A%09%09return ksession;%0D%0A%09%7D%0D%0A%0D%0A%09public void setKsession(StatelessKieSession ksession) %7B%0D%0A%09%09this.ksession = ksession;%0D%0A%09%7D%0D%0A%0D%0A%09public String getRuleName() %7B%0D%0A%09%09return ruleName;%0D%0A%09%7D%0D%0A%0D%0A%09public void setRuleName(String ruleName) %7B%0D%0A%09%09this.ruleName = ruleName;%0D%0A%09%7D%0D%0A%0D%0A%09public BatchFlowContext getFlowContext() %7B%0D%0A%09%09return flowContext;%0D%0A%09%7D%0D%0A%0D%0A%09public void setFlowContext(BatchFlowContext flowContext) %7B%0D%0A%09%09this.flowContext = flowContext;%0D%0A%09%7D%0D%0A%0D%0A
 %7D%0D%0A

Add getter setter