Provides classes and interfaces for controlling Sheeps (HttpServletRequest objects) wandering on Pasture (Application object) - Internal Framework Package.

Some Workflow Examples

Using Shepherds package extends use of Triggers defined in workflow.xml.

Triggers have right now two required attributes: name and page-ref, which defines checked property name and reference to {@link pl.aislib.fm.Page} where {@link javax.servlet.http.HttpServletRequest} should be redirected by {@link pl.aislib.fm.Application} on cases defined by other two Trigger attributes: type and predicate (which are not required and defaults to: request-param and isNotNull).

In following examples we assume that: sourcePage is the Page for which the Triggers belongs and destinationPage is page identified by page-ref attribute. All XML citations should be written into workflow.xml file defining Workflow for application.

Checking if some request parameter exists

This is default Application behaviour when Trigger is used with only two required attributes: name and page-ref, following XML code:

<trigger name='continue' page-ref='next-page' />
will dispatch user request from sourcePage to destinationPage if and only if user request has parameter named 'continue'.

Checking if some request parameter does not exist

Following XML code:
<trigger name='continue' page-ref='next-page' predicate='isNull' />
will dispatch user request from sourcePage to destinationPage if and only if user request does not contain parameter named 'continue'. Following XML code maybe be used as replacement for above one:
<trigger name='continue' page-ref='next-page' predicate='isNull' type='request-param' />

Checking if some request attribute exists

Following XML code:
<trigger name='continue' page-ref='next-page' predicate='isNotNull' type='request-attr' />
will dispatch user request from sourcePage to destinationPage if and only if user request has attribute named 'continue'.

Checking if some request attribute does not exist

Following XML code:
<trigger name='continue' page-ref='next-page' predicate='isNull' type='request-attr' />
will dispatch user request from sourcePage to destinationPage if and only if user request does not have attribute named 'continue'.

Checking if some session attribute exists

Following XML code:
<trigger name='continue' page-ref='next-page' predicate='isNotNull' type='session-attr' />
will dispatch user request from sourcePage to destinationPage if and only if {@link javax.servlet.http.HttpSession} related to user request has attribute named 'continue'.

Checking if some session attribute does not exist

Following XML code:
<trigger name='continue' page-ref='next-page' predicate='isNull' type='session-attr' />
will dispatch user request from sourcePage to destinationPage if and only if {@link javax.servlet.http.HttpSession} related to user request does not have attribute named 'continue'.

Checking your own {@link org.apache.commons.collections.Predicate}

Following XML code:
<trigger name='continue' page-ref='next-page' predicate='myPackage.myPredicate' type='session-attr' />
will dispatch user request from sourcePage to destinationPage if and only if attribute named 'continue', taken from {@link javax.servlet.http.HttpSession} related to user request, matches Predicate written by YOU. @since AISLIB 0.4