When necessary, an actor-chain can invoke a child actor-chain. The actor element passes information from that parent actor to a child actor, and executes the child actor-chain. Note that you must explicitly define the values that will be passed from the parent to the child actor-chain.

Actor elements contain the following:

Attribute/Element

Description

id

Required. The actor ID. This attribute is used for actor ordering.

name

Required. The Nucleus path of the actor component to invoke.

return-model-var

Provides the variable name of the child actor-chain returned by the ModelMap. The ModelMap that is returned from the child actor-chain can be accessed using this variable name.

chain-id

The chain ID of the actor component to be executed. If the chain-id is not specified, the default chain will be executed.

depends

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.

depends-if-present

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.

input

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

output

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

The ActorContext and ModelMap of the parent actor are not passed to the child actor. The following example shows how information can be passed from a child actor-chain to a parent actor-chain. Note that request parameters do not need to be passed in explicitly as inputs; you can pass in their variables:

<! – Call another actor-chain to get quantity ->
<actor id="addItem" name="/atg/commerce/gifts/NewListActor"
    return-model-var="addItemVar">
  <input name="quantity" value="${quantity}"/>
  <output name="quantity" value="${addItemVar}"/ >
</actor>

In the above example, the parent actor-chain contains a quantity ModelMap entry. Map entries are based upon the child actor-chain. For information on working with implicit objects, which can be used in any chain, refer to the Working with Implicit Objects section.

To pass the entire child ModelMap back to the parent and not have it nested under another variable name, use the add-map-children="true" in the output element to copy the child ModelMap keys to the parent ModelMap.

<! – Call another actor-chain to get quantity ->
<actor id="addItem" name="/atg/commerce/gifts/NewListActor"
    return-model-var="addItemVar">
  <input name="quantity" value="${quantity}"/>
  <output id="quantity" add-map-children="true" value="${addItemVar}"/ >
</actor>

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