Monday, October 24, 2011

Order Fallout Management for Custom process

Oracle communication Order2Bill PIP provides Order Fallout Management. AIA Error handler is extended to create trouble ticket notification for failed orders.



Order2Bill PIP provides the extension to handle fallout and create trouble ticket as shown in above diagram, for more information please refer Order2Bill PIP guide. This topic helps you in configuring the custom build BPEL processes to create trouble ticket

In the required catch block(Catch block where TT need to be generated), create assign activity to enrich the faulted message to EBMFault message, as shown in below code snippet.

<assign name="AssignRemoteFault">
<copy>
<from expression="ora:processXSLT('EBM_to_Fault.xsl',bpws:getVariableData('inputOrderEBM','payload'))"/>
<to variable="EnterpriseFaultMsg" part="Fault"/>
</copy>
<copy>
<from variable="SystemFaultMsg" part="code"/>
<to variable="EnterpriseFaultMsg" part="Fault"
query="/corecom:Fault/corecom:FaultNotification/corecom:FaultMessage/corecom:Code"/>
</copy>
<copy>
<from variable="SystemFaultMsg" part="summary"/>
<to variable="EnterpriseFaultMsg" part="Fault"
query="/corecom:Fault/corecom:FaultNotification/corecom:FaultMessage/corecom:Text"/>
</copy>
<copy>
<from expression="xp20:current-dateTime()"/>
<to variable="EnterpriseFaultMsg" part="Fault"
query="/corecom:Fault/corecom:FaultNotification/corecom:ReportingDateTime"/>
</copy>
<copy>
<from expression="ora:getProcessId()"/>
<to variable="EnterpriseFaultMsg" part="Fault"
query="/corecom:Fault/corecom:FaultNotification/corecom:FaultingService/corecom:ID"/>
</copy>
<copy>
<from expression="'BPEL'"/>
<to variable="EnterpriseFaultMsg" part="Fault"
query="/corecom:Fault/corecom:FaultNotification/corecom:FaultingService/corecom:ImplementationCode"/>
</copy>
<copy>
<from expression="ora:getInstanceId()"/>
<to variable="EnterpriseFaultMsg" part="Fault"
query="/corecom:Fault/corecom:FaultNotification/corecom:FaultingService/corecom:InstanceID"/>
</copy>
</assign>

After constructing EnterpriseFaultMsg insert a throw activity to throw a fault to make the process as faulted.


<throw name="ReThrowRemoteFault" faultName="bpelx:RemoteFault" faultVariable="EnterpriseFaultMsg"/>

Copy the process fault policy file to $ORACLE_HOME/ bpel/domains/default/config/fault-policies. Fault policy file should invoke oracle.apps.aia.core.eh.BPELJavaAction java class to process the message in AIA error handler.


Log in to AIA Console and navigate to Setup->Error Notification link

Click on Create button and add below entry

Error Code
{ http://schemas.oracle.com/bpel/extension}remoteFault
Service Name
&lt;CustomBPELProcessName>


Role
AIAIntegrationAdmin
Error Type
AIA_EH_DEFAULT,AIA_ORDERFALLOUT_TTS
Error Ext Handler
AIACOM_OFM_EXT

Common Error Handler will add the correlation id as mentioned in Error Type column of BSR_ERROR_NOTIFICATIONS ‘AIA_EH_DEFAULT,AIA_ORDERFALLOUT_TTS’.
The AIA order fallout listener (AIAOrderFalloutJMSBridgeService) will pick up the fault message from the AIA Error Topic and pushes it to the Fallout Queue (AIA_ORDERFALLOUT_JMSQ ).
The AIACOMOrderFalloutNotificationConsumer process picks up the fault message from the
Fallout Queue and invokes AIA order fallout services to create the order failure notification within AIA.

Restart the server to make effect of all the changes.

Sunday, October 23, 2011

ABCSGenerator service configuration file and deployment merge

AIA ABCSGenerator tool generates configuration file with name <projectname>_Config.xml, In specific to AIA Deployment requirement we need to rename this file as 'AIAServiceConfigurationProperties.xml'. Only if we rename the file this property will be merged in AIAConfigurationProperties.xml during deployment.

In addition to renaming the file, we need to put the content of the AIAServiceConfigurationProperties.xml(ServiceConfiguration) inside AIAServiceConfiguration element as shown below.

<?xml version="1.0" encoding="UTF-8"?>
<AIAServiceConfiguration xmlns="http://xmlns.oracle.com/aia/core/config/V1" version="1.0">
<!-- MyCustomProvABCSImpl -->
<ServiceConfiguration serviceName="{http://xmlns.oracle.com/ABCSImpl/Myindustry/Industry/Comms/MyCustomProvABCSImpl/V1}MyCustomProvABCSImpl">
<Property name="Default.SystemID">Myindustry_01</Property>
<Property name="Routing.CreateCustomer.RouteToCAVS">false</Property>
<Property name="Routing.CreateCustomer.CAVS.EndpointURI">http://<HOSTNAME>:7777/AIAValidationSystemServlet/syncresponsesimulator?simid=1000</Property>
<Property name="Routing.CreateCustomer.Myindustry_01.EndpointURI"><HOSTNAME>:7777/workflow/customer/CreateCustomer.do</Property> <Property name="Routing.CreateCustomer.MessageProcessingInstruction.EnvironmentCode">CAVS</Property> </ServiceConfiguration>
</AIAServiceConfiguration>

Bolded element need to be created and existing ServiceConfiguration and its child element need to be copied inside AIAServiceConfiguration element. Execution of build script after this change, will make the MyCustomProvABCSImpl service configuration entry in 'AIAServiceConfigurationProperties.xml'.

How to increase BPEL and ESB log level

BPEL Log:
1. Login to BPEL Console
2. Navigate to link Configuration->Logging
3. At the bottom of the page select ‘All’ in ChangeAll combo box.
4. Goto $ORACLE_HOME/opmn/logs and view default_group~<DOMAIN_NAME>~default_group~1.log file.

ESB Log:
1. Login to EnterpriseManager(em) console
2. Click on <CONTAINER_NAME>-> Administration -> Logger Configuration(GoTo Task) -> Root Logger(+)
3. Set oracle.tip.esb.server.common and oracle.tip.esb.server.service to INFO or lower level
4. Goto $ORACLE_HOME/j2ee/< DOMAIN_NAME >/log/ <DOMAIN_NAME>_default_group_1/oc4j and view log.xml

AIA Localization of Title and Error message

Localization of Title and Error message according to the different geographical location is one of the key requirements for customer. Here I’m showing one example on how to localize in German language. AIA provides the Error code, Error Message and Title message in a java class file. It also depends on the PIP we are using. In this example I have taken communication PIP for localization. Localization call is made from bpel or xsl using xpath function getAIALocalizedString(). The xpath function in turn refers the class file to get the localized string.

All the communication PIP error codes and messages are stored in ‘AIAListResourceBundle’ class file. Filename of this resource bundle is configurable and its property is available in AIAConfigurationProperties.xml file.

<ModuleConfiguration moduleName="ResourceBundle">
<Property name="Telco/BillingManagement">oracle.apps.aia.core.i18n.AIAListResourceBundle</Property>
<Property name="Telco/ProductLifeCycle">oracle.apps.aia.core.i18n.AIAListResourceBundle</Property>
<Property name="Telco/SalesOrder">oracle.apps.aia.core.i18n.AIAListResourceBundle</Property>
<Property name="Telco/CustomerParty">oracle.apps.aia.core.i18n.AIAListResourceBundle</Property>
</ModuleConfiguration>


To implement localization you need to decompile the java file ‘AIAListResourceBundle.class’at the location $ORACLE_HOME/ bpel/system/classes/oracle/apps/aia/core/i18n. Save the decompiled file as ‘AIAListResourceBundleGerman.java’. Find and replace the word ‘AIAListResourceBundle’ with ‘AIAListResourceBundleGerman’. The java file will have all the error codes and details as shown in below sample.

"AIA_ERR_AIACOMOMPI_0001", "Purchase date on Order {0}, Line {1} for Product {2} needs to be set to the future, for Billing Initiation"

Comment above line and provide equivalent German translated word as shown below.

"AIA_ERR_AIACOMOMPI_0001", " Kaufdatum auf Auftrag {0}, Line {1} für Produkt {2} muss auf die Zukunft eingestellt werden, für Billing Initiation "

Similarly do translation for all the error codes and compile the ‘AIAListResourceBundleGerman.java’ file. Copy the compiled class file ‘AIAListResourceBundleGerman.class’ to $ORACLE_HOME/ bpel/system/classes/oracle/apps/aia/core/i18n folder. Also need to edit the AIAConfigurationProperties.xml to update the new class file as shown in below example.

<property name="Telco/BillingManagement">oracle.apps.aia.core.i18n.AIAListResourceBundleGerman</property>

Restart the server to make effect of all the changes. Now all your title and error messages will be shown in German language.

Similarly error codes for other PIPS are provided in ‘EHResourceBundle.class’ at location $ORACLE_HOME/bpel/system/classes/oracle/apps/aia/core/eh/i18n. Follow similar steps as mentioned above to localize it.