JBoss Community

How to integrate .drl file in JBPM 5 using Rule Task

created by Ram Biradar in jBPM Development - View the full discussion

Hi,

               I am new to JBPM. Now i am working on Rule Task in jbpm 5 and i want to integrate .drl file in jbpm 5. Here im using process variable's name and percentage and i have written one .drl file based on the percentage i want to set the percentage what i have written in .drl.

This is my work flow:

message/636780#636780

In student task i will get one form here i will enter name and percentage and its hits simpleDrools Rule task and after that its not moving. I will sending my code what i have written in script task before the Rule task i,e input and one script task i,e output

script1 code:-

 

map=new java.util.HashMap();

map.put("percentage",percentage);

kcontext.setVariable("percentage",percentage);

kcontext.getKnowledgeRuntime().insert(hpm.getPercentage());

 

script2 code:-

 

map.put("name",name);

map.put("percentage",percentage);

 

simpleDrools.drl:--

 

package com.sample

import com.sample.hello.HelloProcessModel

 

rule "NYuser_Rule"

   

    no-loop true

    ruleflow-group "EvalLoopcondition"

    when

        m:HelloProcessModel(percentage>75)

    then

        m.setPercentage(90);update(m);

       

end

 

rule "ChileUser_Rule"

   

    no-loop true

    ruleflow-group "EvalLoopcondition"

    when

        m:HelloProcessModel(percentage < 75)

    then

        m.setPercentage(60);update(m);

end

Reply to this message by going to Community

Start a new discussion in jBPM Development at Community