Class PetStoreExample.CheckoutCallback

  • Enclosing class:
    PetStoreExample

    public static class PetStoreExample.CheckoutCallback
    extends java.lang.Object
    This callback is called when the user pressed the checkout button. It is responsible for adding the items to the shopping cart, asserting the shopping cart and then firing all rules. A reference to the JFrame is also passed so the rules can launch dialog boxes for user interaction. It uses the ApplicationData feature for this.
    • Constructor Summary

      Constructors 
      Constructor Description
      CheckoutCallback​(org.kie.api.runtime.KieContainer kcontainer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String checkout​(javax.swing.JFrame frame, java.util.List<PetStoreExample.Product> items)
      Populate the cart and assert into working memory Pass Jframe reference for user interaction
      void setOutput​(javax.swing.JTextArea output)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CheckoutCallback

        public CheckoutCallback​(org.kie.api.runtime.KieContainer kcontainer)
    • Method Detail

      • setOutput

        public void setOutput​(javax.swing.JTextArea output)
      • checkout

        public java.lang.String checkout​(javax.swing.JFrame frame,
                                         java.util.List<PetStoreExample.Product> items)
        Populate the cart and assert into working memory Pass Jframe reference for user interaction
        Parameters:
        frame -
        items -
        Returns:
        cart.toString();