0 Replies Latest reply on Nov 17, 2011 2:27 AM by Ram Biradar

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

    Ram Biradar Newbie

      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:

      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