ResultsToRulesInputTransform Class

com.bea.p13n.rules.advislets
ResultsToRulesInputTransform Class

public class ResultsToRulesInputTransform

    extends AbstractAdviceTransform

An AdviceTransform that converts the results in one Advice instance into rule inputs in the AdviceRequest.


Hierarchy
Object
  AbstractAdviceTransform
    ResultsToRulesInputTransform
All Implemented Interfaces

AdviceConstants, AdviceRequestConstants, AdviceTransform, AdvisletChainElement

Field Summary

public static final String
REQUEST_SPECIFIC_KEY
A string key for identifying a request-specific key.
public static final String
REQUEST_SPECIFIC_VALUE
A string key for identifying a request-specific value.
 

Constructor Summary

ResultsToRulesInputTransform(Advisor advisor, Metadata metadata)

Construct an instance of this object and bind it to its Advisor and Metadata instances.
 

Method Summary

public boolean
initialize(Map parameters, Object parameterDocument)
Initialize this AdviceTransform from its configuration environment in the AdvisletRegistry XML file.
public void
transform(Advice input, AdviceRequest output)
Maps objects in the Advice objects into objects in a subsequent AdviceRequest.
 
Methods from  com.bea.p13n.advisor.AbstractAdviceTransform
getMetadata, toString,
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface com.bea.p13n.advisor.AdviceTransform
transform
 
Methods from interface com.bea.p13n.advisor.AdvisletChainElement
getMetadata, initialize
 

Field Detail

REQUEST_SPECIFIC_KEY

public static final String REQUEST_SPECIFIC_KEY
A string key for identifying a request-specific key.


REQUEST_SPECIFIC_VALUE

public static final String REQUEST_SPECIFIC_VALUE
A string key for identifying a request-specific value.

 

Constructor Detail

ResultsToRulesInputTransform

public ResultsToRulesInputTransform(Advisor advisor, 
                                    Metadata metadata)
Construct an instance of this object and bind it to its Advisor and Metadata instances.
 

Method Detail

initialize(Map, Object) Method

public boolean initialize(Map parameters, 
                          Object parameterDocument)
throws AdvisorException
Initialize this AdviceTransform from its configuration environment in the AdvisletRegistry XML file.

Overrides
AbstractAdviceTransform.initialize(Map, Object)

Parameters

parameters
the Map containing the initialization parameters.
parameterDocument
the XML Document Object containing the configuration environment for this AdviceTransform instance.

Returns

returns true if this operation is successful, otherwise returns false.

Exceptions

AdvisorException

transform(Advice, AdviceRequest) Method

public void transform(Advice input, 
                      AdviceRequest output)
throws AdvisorException
Maps objects in the Advice objects into objects in a subsequent AdviceRequest.

If the Advice.getResult() call returns a List, each item in the List is appended to a List in the AdviceRequest keyed to the value RULES_INPUT_OBJECTS.

In addition a single value from the configuration environment is added to to the AdviceRequest, using the key of "request-specific-key" (loaded from the XML configuration) and the value "request-specific-value"" (loaded from the XML configuration).

Overrides
AbstractAdviceTransform.transform(Advice, AdviceRequest)

Parameters

input
the Advice that was previously executed.
output
the AdviceRequest to be populated.

Exceptions

AdvisorException