1 Reply Latest reply on Jul 24, 2014 1:34 PM by Jose Miguel Loor

    execute rules using the RemoteRestRuntimeFactory

    Jose Miguel Loor Apprentice



      i am trying to execute rules deployed in a remote server using the RemoteRestRuntimeFactory of the kie services client. As a detail, i should say that the server where the bpms is running and the server where the application is running are different machines.


      This is what i am doing right now (in a @Stateless EJB ) in the client application:


      URL baseUrl = new URL("http://server:8080/business-central/");

      RemoteRestRuntimeFactory factory = new RemoteRestRuntimeFactory(DEPLOYMENT_ID, baseUrl, USER, PASSWORD);

      RuntimeEngine kieRuntimeEngine = factory.newRuntimeEngine();

      KieSession kieSession = kieRuntimeEngine.getKieSession();


      CondicionesCta condiciones = new CondicionesCta();




      int rulesApplied = kieSession.fireAllRules();


      In the bpms server, i have a project with a rule that looks like this:


      package com.ec.mutualista.aperturacta;

      import java.lang.Number;

      rule "CondContrInternac"

      dialect "mvel"


        condiciones : CondicionesCta( agenciaInternacional == true , idGrupoCta == 4 )


        condiciones.setFirmante( true );

        condiciones.setSeguro( true );

        condiciones.setTarjeta( true );

        condiciones.setNumserie( false );

        condiciones.setTipoTarjeta( "DEBCHIP" );



      When i execute the ejb i am getting no errors, but the value of the rulesApplied variable is always 0, so, no rules are applied

      Is this even possible ? is there any other way this can be achieved ?