The droplet element provides meta-data for ATG servlet beans. The DropletActor executes ATG servlet beans and adds object values to the ModelMap based on the meta-data.

The droplet element contains the following:




This is the Nucleus path of the ATG servlet bean.


Exposes the current frame of the Dynamo param stack as an attribute.


This attribute defines the actor ID, and is used for actor ordering.


Droplets may have one-to-many oparams.


This element defines actors that must be executed prior to the execution of the current actor. There can be multiple depends elements associated with an actor.


This element defines actors that, if present, must be executed prior to the execution of the current actor. There can be multiple depends-if-present elements associated with an actor


This element defines each actor’s input. Actors can have multiple input elements.


This element defines each actor’s output. output elements create a map entry in a ModelMap. Actors can have multiple output elements.

DropletActors can be nested with all types of actors using the oparam element.

The Oparam Element

The oparam element can be used within the droplet element to identify names of droplet oparams. This element contains the following:




The name of the oparam.


The oparam element can have one or more actors that include output or set-var elements.

The following is an example of how to access droplet properties:

<component id="orderLookupBean" name="/atg/commerce/order/OrderLookup"
    component-var="orderLookupBean" />
  <droplet id="switch" name="/atg/dynamo/droplet/Switch">
    <input name="value" value="${orderLookupBean.enableSecurity}" />
    <oparam name="true">
      <droplet id="orderLookup" name="/atg/commerce/order/OrderLookup"

The following is an example of a droplet and oparam element:

<! will process this tag.->
<droplet id="productLookupDroplet" name="/atg/commerce/catalog/ProductLookup"
  <input name="productId" value="${param.productId}"/>
  <oparam name="output">
    <output name="product" value="${productLookupDropletParamStack.element}"
  <oparam name="empty">
    <!-handle case where product is not found -->
Example: Nesting Droplet Elements

It is possible to nest droplet elements. For example:

  <droplet path="/atg/store/droplet/StoreLookupDroplet" var="storeLookup">
    <oparam name="output">
      <droplet path="/atg/store/droplet/StoreSiteFilterDroplet"
        <!-read 'items' from StoreLookupDroplet -->
        <input name="collection" value="${storeLookup.items}"/>
        <!-output array of stores for the current site -->
        <oparam name="output">
          <output name="stores" value="${storeSiteFilter.filteredCollections}"/>

Because each actor-chain has its own ActorContext and ModelMap, you can use the input and output of nested actors to pass inputs into nested ActorContext and return outputs from nested ModelMaps. In the following example, the add-map-children attribute copies the properties in the nested ModelMap to the outer ModelMap:

  </actor-chain><actor-chain id="addItemToOrder-success">
  <actor id="order" name="/atg/commerce/ShoppingCartActor"
      chain=id="detailed" return-model-var="model">
    <output id="model" add-map-children="true" value="${model}"/>

Note that you should make your actors accessible from the client, using the request parameter, or the nested actor, using the variable. Clients pass actors as param, for example param.orderId. Nested actors pass their variables as ActorContext variables. You must configure your input to look for both param and ActorContex variables. For example:

<input name="orderId" value="${orderId == null ? param.orderId : orderId}"/>
Example: Evaluating Servlet Beans

When working in a JSP page, you can identify a bean parameter. For example:

    scope="request" />
<dsp:droplet name="/atg/droplet/Switch">
  <param name="value" bean="CustomerSearchTreeQueryFormHandler.pagesAvailable"/>
  <oparam name="0">
    <!-perform an action -->

There is no bean attribute available for DropletActors. Instead, you can retrieve servlet beans using the $nucleus syntax. For example:

<droplet name="/atg/droplet/Switch">
  <input name="value" value="${nucleus[/atg/svc/agent/ui/formhandlers/
  <oparam name="0">
    <!-perform an action -->
Example: Setting a Variable Within an oparam

The set-var element sets a variable as an attribute. For additional information on this element, refer to The Set Variable Element section. This example shows how to set a set a variable named sites within an oparam element:

<droplet id="sharingSites"
  <oparam name="output">
    <set-var name="sites" value="${sharingSitesParamStack.sites}"/>

You could then use the variable:

<droplet id="productLookup" name="/atg/commerce/catalog/ProductLookup"
  <input name="sites" value="${sites}"/>
  <oparam name="output">

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices