Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1220

Integration with jBPM does not work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Rejected
    • Affects Version/s: 4.0.1
    • Fix Version/s: 4.0.2
    • Component/s: None
    • Labels:
      None

      Description

      We had a code that intgrates JBoss Rules Global Resolver with jBPM variable pool

      workingMemory.setGlobalResolver(new GlobalResolver() {
      private static final long serialVersionUID = 1L;
      public Object resolveGlobal(String identifier)

      { System.out.println("!!!!!!!!!! resolve " + identifier); return ci.getVariable(identifier); }

      public void setGlobal(String identifier, Object value)

      { System.out.println("!!!!!!!!!! set " + identifier); ci.setVariable(identifier, value); }

      });

      And a rule file that serves as test
      package org.jbpm.action

      import org.jbpm.resolveraction.Customer;
      import org.jbpm.resolveraction.Order;
      import org.jbpm.context.exe.ContextInstance;

      global java.lang.String shipper

      rule "Determine Shipper"
      when
      Customer( region >= 1 )
      Order( totalAmount >= 0 )
      then
      System.out.println(shipper);
      drools.getWorkingMemory().setGlobal( "shipper", "FEDX" );
      System.out.println("ship via FEDX " );
      end

      The output of the test is as expected
      11:50:51,226 INFO [STDOUT] !!!!!!!!!! resolve shipper
      11:50:51,227 INFO [STDOUT] None
      11:50:51,227 INFO [STDOUT] !!!!!!!!!! set shipper
      11:50:51,227 INFO [STDOUT] ship via FEDX

      But if we modify the rule file to
      package org.jbpm.action

      import org.jbpm.resolveraction.Customer;
      import org.jbpm.resolveraction.Order;
      import org.jbpm.context.exe.ContextInstance;

      global java.lang.String shipper

      rule "Determine Shipper"
      when
      eval ("None".equals(shipper))
      Customer( region >= 1 )
      Order( totalAmount >= 0 )
      then
      System.out.println(shipper);
      drools.getWorkingMemory().setGlobal( "shipper", "FEDX" );
      System.out.println("ship via FEDX " );
      end

      then nothing is printed - no attempt to resolve shipper global variable

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mark.proctor Mark Proctor
                Reporter:
                jpechanec Jiri Pechanec
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: