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:
Phase | Hook in
ope_config file
|
---|---|
Custom Validation | customOfferValidationRule |
Custom Filter Processing | customOfferFilterRules |
Custom Eligibility | customEvaluateEligibilityRule |
Custom Publishing | customOfferResponseRule |
Phase | Hook in ope_config file |
---|---|
Custom Validation | customOfferValidationRule |
Custom Publishing | customOfferResponseRule |
Phase | Hook in ope_config file |
---|---|
Custom Filter Processing | customOfferFilterRules (If the request contains query elements)
|
Custom Publishing | customProdInfoResponseRule |
Phase | Hook in ope_config file |
---|---|
Custom Processing | customPriceProcessingRule |
Custom Publishing | customPriceResponseRule |
Phase | Hook in ope_config file |
---|---|
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"
.
- To add the rule actions, extend abstract class
- Create a JAR file of the project and copy it in the $OPE_HOME/roles/ope/standalone/lib directory.
- In ConfigValues_OPES.json file, provide the following property:
Copy
{ "propName": "com.tibco.af.ope.ope.ext.classes",
"propDescription": "Fully qualified class names for OPE extension classes",
"propValue":"c1::com.tibco.fom.ope.ext.GetPricesResponseCondition,
a1::com.tibco.fom.ope.ext.GetPricesResponseAction",
"valueType": "string",
"isTenantProperty": "false"
} - Navigate to the
$OPE_HOME/roles/ope/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.