* @param entrySocket Socket used to enter the visual
* @return The dynamic visual to be executed or the original visual
*/
protected VisualItem determineDynamicVisual(VisualItem visual, TokenContext context, NodeSocket entrySocket)
{
VisualItem result;
// Lookup the special parameter's value.
Object dynamicVisualName = TokenContextUtil.getParamValue(context, entrySocket, CoreConstants.DYNAMIC_VISUAL_PARAM_NAME);
if ((dynamicVisualName != null) && (dynamicVisualName instanceof String))
{
// Try to find dynamic visual.
try
{
result = (VisualItem) context.getExecutingModel().resolveItemRef((String) dynamicVisualName,
ItemTypes.VISUAL);
LogUtil.debug(getClass(), "Invoking dynamically determined visual $0.", result.getQualifier());
}
catch (ModelException re)
{
// Just fall back to the original item.
result = visual;