Getting Started with eQ!™

Creating a Script

The next step shows how to create optional XML-based scripts. Our script will be used to invoke the persistence layer to retrieve our BusinessObjectSet of Suppliers.

The script itself is very easy to understand:

<script name="retrieve_business_object_set">
    <bean name="bo_set" class="com.browsersoft.bc.BusinessObjectSet">
        <arg value="supplierSet" type="string" />
    </bean>
    <method name="retrieve" target="$bo_set">
        <arg value="$request.persisterId" type="string" />
        <arg value="$request.params" type="java.util.Hashtable" />
    </method>
</script>

Here it is in pseudo code:

  1. Create a new BusinessObjectSet instance with the variable name 'bo_set'
    1. The name of the BusinessObjectSet is supplied in the constructor
  2. Invoke the 'retrieve' method on the set
    1. The first argument is the persisterId to use, and is supplied in the ScriptRequest
    2. The second argument is a Hashtable of parameters, which will be substituted in our SQL. In this case, we would have supplied the 'value' parameter (as defined in the set-persister configuration on the previous page)

     

 

Next: Create a Client