-
Language:
English
-
Language:
English
24.4. Pet Store Example: Package, Imports, Globals and Dialect from PetStore.drl
package org.drools.examples
import org.drools.WorkingMemory
import org.drools.examples.petstore.PetStoreExample.Order
import org.drools.examples.petstore.PetStoreExample.Purchase
import org.drools.examples.petstore.PetStoreExample.Product
import java.util.ArrayList
import javax.swing.JOptionPane;
import javax.swing.JFrame
global JFrame frame
global javax.swing.JTextArea textArea- The first part of file
PetStore.drlcontains the standard package and import statements to make various Java classes available to the rules. - The two globals
frameandtextAreahold references to the Swing componentsJFrameandJTextAreacomponents that were previously passed on by the Java code calling thesetGlobal()method. These global variables retain their value for the lifetime of the Session.