*
* @throws Exception if an error occurs.
*/
public void doTag(XMLOutput output) throws Exception
{
State state = null;
try
{
state = getCurrentState();
}
catch (JellyException e)
{
// ignore
}
if ( state != null )
{
if ( state.getActivity() != null
&&
! ( state.getActivity() instanceof NoOpActivity ) )
{
throw new JellyException( "Activity already defined for state \""
+ state.getName()
+ "\"" );
}
}
// - - - - - - - - - - - - - - -
Script script = getBody();
Activity activity = new JellyActivity( script );
if ( getVar() != null )
{
getContext().setVariable( getVar(),
activity );
}
// - - - - - - - - - - - - - - -
if ( state != null )
{
state.setActivity( activity );
}
}