[rules-users] How to get Parameters in Script Task

V Vignesh vignesh_v at solartis.net
Tue Aug 20 06:38:51 EDT 2013


Hi guys, 

I am new new to Rule Flow. 
I am use eclipse for rule flow. 

In a new Drools-Project 
in ProcessTest.java 
I tried to insert a HashMap in a knowledge base session 
------------------------------------------------------- 
HashMap hMap = new HashMap(); 
            hMap.put("Id", "10"); 
            hMap.put("RollNumber", "456"); 
            FactHandle qMapHandle = ksession.insert(hMap); 
            ksession.startProcess("sample.ruleflow"); 
            ksession.fireAllRules();   
------------------------------------------------------   

but in my ruleflow.rf 
I added a script Task 
when in its Action, i tried accessing this HashMap i am unable to get it 
---------------------------------------------------- 
if(hMap.get("Id"){ 
System.out.println("Student exists"); 
} 
--------------------------------------------------- 

Can you please help me to figure out retrieving the HashMap from my Process
Test.java inside the Script Task of rule-flow.rf?   



--
View this message in context: http://drools.46999.n3.nabble.com/How-to-get-Parameters-in-Script-Task-tp4025622.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list