Java Extension
TIBCO Offer and Price Engine can be customized to support the functionality that can be integrated by using the Java extension.
The following phases and hooks are provided for every phase:
GetOffer| Custom Validation
| customOfferValidationRule |
| Custom Filter Processing
| customOfferFilterRules |
| Custom Eligibility
| customEvaluateEligibilityRule |
| Custom Publishing
| customOfferResponseRule |
Validate Offer| Custom Validation
| customOfferValidationRule |
| Custom Publishing
| customOfferResponseRule |
GetProductInformation| Custom Filter Processing
| customOfferFilterRules (If the request contains query elements)
|
| Custom Publishing
| customProdInfoResponseRule |
GetPrices| Custom Processing
| customPriceProcessingRule |
| Custom Publishing
| customPriceResponseRule |
GetPriceInformation| Custom Processing
| priceCustomInfoProcessingRule |
| Custom Publishing
| customPriceResponseRule |
Before you beginFor more information about the files used for the implementation of this Java extension, see the
Java API References documentation.
To extend the execution of
TIBCO Offer and Price Engine web service requests during different phases, add the java-based custom classes as described in the following steps:
Procedure
- To implement the custom logic by extending the interfaces, create a java project such as
opeExtensions.zip, and complete the following steps:
- To add the rule actions, extend abstract class
"com.tibco.fos.opes.server.ope.extension.AbstractExtensionRuleAction".
- To add the rule conditions, extend abstract class
"com.tibco.fos.opes.server.ope.extension.AbstractExtensionRuleCondition".
- Create a JAR file of the project and copy it in the
$OPE_HOME/roles/ope/standalone/lib directory.
- In ConfigValues_OPES.xml file, provide the following property:
Copy
<Category description="OPE extension Class Configuration" name="Custom class names for the ope extension" visibility="Advanced">
<ConfValue description="Fully qualified class names for OPE extension classes" name="OPE Extension Class names" propname="com.tibco.af.ope.ope.ext.classes" sinceVersion="5.0" visibility="Basic">
<ConfString default="" value="c1::com.tibco.fom.ope.ext.GetPricesResponseCondition,a1::com.tibco.fom.ope.ext.GetPricesResponseAction"/>
</ConfValue>
</Category>
- Navigate to the
$OPE_HOME/roles/configurator/standalone/config directory, and configure the custom class in the
ope_config.xml rule sequence configuration file.
For example, to configure custom classes for validation, add them under the following events:
- Add the action class under the "action" element.
- Add the condition class under the "condition" element.
Note: The
<sequencedRule> indicates an element where all the actions are executed sequentially. One condition can have multiple actions inside a
<sequencedRule> element. Multiple
<sequenceRule> elements are used to separate conditions and their corresponding actions.
Example for
"customOfferValidation":
<!-- Custom Validation Class goes here -->
<sequencedECARuleSet ruleSetName="customOfferValidationRule" runOnFailure="false" runOnError="false">
<event eventName="customOfferValidation" type="event">
<eventSource>
<endpointType>
<uri>sape://localhost</uri>
</endpointType>
<inMessageType>
<javabean/>
</inMessageType>
</eventSource>
<lifetime/>
</event>
<sequencedRule>
<action actionType="bean">
<actionBean beanId="a1" methodName="execute" interface="com.tibco.aff.eca.base.Action"/>
</action>
<condition conditionType="bean">
<conditionBean beanId="c1" methodName="evaluate" interface="com.tibco.aff.eca.base.Condition"/>
</condition>
</sequencedRule>
</sequencedECARuleSet>
Example for
"customEvaluateEligibility":
<!-- Custom Validation Class goes here -->
<sequencedECARuleSet ruleSetName="customEvaluateEligibilityRule" runOnFailure="false" runOnError="false">
<event eventName="customEvaluateEligibility" type="event">
<eventSource>
<endpointType>
<uri>sape://localhost</uri>
</endpointType>
<inMessageType>
<javabean/>
</inMessageType>
</eventSource>
<lifetime/>
</event>
<sequencedRule>
<condition conditionType="bean">
<conditionBean beanId="c1" methodName="evaluate" interface="com.tibco.aff.eca.base.Condition"/>
</condition>
<action actionType="bean">
<actionBean beanId="a1" methodName="execute" interface="com.tibco.aff.eca.base.Action"/>
</action>
</sequencedRule>
</sequencedECARuleSet>
Note: All the web services are supported for Java customization.