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.

No comments:

Post a Comment