Monday, October 18, 2010

AIA Error Handling : Error Notifications/Emails

In continuation with my earlier posts on AIA Error handling, I will cover the steps required to enable/send error notifications in this post. AIA Error handling framework has out-of-the-box error email functionality. Incase of partner link errors like remote/binding faults the fault-policy.xml file should take care of sending the error notification/email. Incase of non-partner link error the AIAAsyncErrorHandlingBPEL process is called from catch-all block which inturn sends out the error email.

A sample fault-policy.xml file is shown below


















3
2






























In above file, the oracle.apps.aia.core.eh.CompositeJavaAction class file gets invoked when remote/binding fault occurs and takes care of sending the error notification to AIAIntegrationAdmin user.

A sample code for populating EBM Header in catch-all block is shown below

1. First create a variable named EBM_HEADER
<variable name="EBM_HEADER" element="ns3:EBMHeader"/>

ns3 here refers to corecom namespace.

2. Make sure your ABM_to_EBM.xsl or EBM_to_ABM.xsl are populating the EBM header section correctly (eg. EBMID, EBOName etc...)

3. In catch-all block make sure you are populating the EBM_HEADER before invoking the AIAAsyncErrorHandlingBPELProcess
<assign name="Assign_Fault">
           <copy>
            <from expression="ora:processXSLT('xsl/EBM_to_Fault.xsl',bpws:getVariableData('EBM_HEADER'))"/>
            <to variable="Invoke_AIAAsyncErrorHandlingBPELProcess_initiate_InputVariable"
                part="FaultMessage" query="/ns3:Fault"/>
          </copy>
          <copy>
            <from expression="ora:getFaultAsString()"/>
            <to variable="Invoke_AIAAsyncErrorHandlingBPELProcess_initiate_InputVariable"
                part="FaultMessage" query="/ns3:Fault/ns3:FaultNotification/ns3:FaultMessage/ns3:Text"/>
          </copy>
          <copy>
            <from expression="xpath20:current-dateTime()"/>
            <to variable="Invoke_AIAAsyncErrorHandlingBPELProcess_initiate_InputVariable"
                part="FaultMessage" query="/ns3:Fault/ns3:FaultNotification/ns3:ReportingDateTime"/>
          </copy>
          <copy>
            <from expression="ora:getProcessId()"/>
            <to variable="Invoke_AIAAsyncErrorHandlingBPELProcess_initiate_InputVariable"
                part="FaultMessage" query="/ns3:Fault/ns3:FaultNotification/ns3:FaultingService/ns3:ID"/>
          </copy>
          <copy>
            <from expression="'BPEL'"/>
            <to variable="Invoke_AIAAsyncErrorHandlingBPELProcess_initiate_InputVariable"
                part="FaultMessage" query="/ns3:Fault/ns3:FaultNotification/ns3:FaultingService/ns3:ImplementationCode"/>
          </copy>
          <copy>
            <from expression="ora:getInstanceId()"/>
            <to variable="Invoke_AIAAsyncErrorHandlingBPELProcess_initiate_InputVariable"
                part="FaultMessage" query="/ns3:Fault/ns3:FaultNotification/ns3:FaultingService/ns3:InstanceID"/>
          </copy>
          <copy>
            <from expression="ora:getECID()"/>
            <to variable="Invoke_AIAAsyncErrorHandlingBPELProcess_initiate_InputVariable"
                part="FaultMessage" query="/ns3:Fault/ns3:FaultNotification/ns3:FaultingService/ns3:ExecutionContextID"/>
          </copy>
        </assign>
      <invoke name="Invoke_AIAAsyncErrorHandlingBPELProcess" inputVariable="Invoke_AIAAsyncErrorHandlingBPELProcess_initiate_InputVariable"
              partnerLink="AIAAsyncErrorHandlingBPELProcess"
              portType="ns10:AIAAsyncErrorHandlingBPELProcess"
              operation="initiate"/>

Apart from this there are certain configurations which need to be done for successfully sending error emails.

1. Set the email driver properties from EM Console :

OutgoingMailServer :
OutgoingMailServerPort :
OutgoingMailServerSecurity :
OutgoingDefaultFromAddress:

2. In AIA_HOME/aia_instances/Instance_name/AIAMetaData/config/AIAConfigurationProperties.xml file , below properties should be set
<Property name="EH.INVOKE.NOTIFY">true</Property>
<Property name="FROM.EMAIL.ID">Email:AiaAdmin@oracle.com</Property>
<Property name="EH.DEFAULT.ACTOR.ROLE">AIAIntegrationAdmin</Property>

3. In User Messaging Preferences console (http://:/sdpmessaging/userprefs-ui) add email Id for user AIAIntegrationAdmin. Login to this console with AIAIntegrationAdmin/welcome1.

NOTE: Message channels are meant to be a single email address or phone number etc.But you can refer to an email distribution list if you want to send these emails to multiple persons.

4. Upload the AIAConfigurationProperties.xml file to MDS and Reload the configuration from AIA Console setup page.Make sure when you update UpdateMetaDataDP.xml for loading the AIAConfigurationProperties.xml into MDS it should look something like below:
<fileset dir="${AIA_HOME}/aia_instances/instance_name/AIAMetaData">
<include name="config/AIAConfigurationProperties.xml" />
</fileset>

Also if the Go buttons are not enabled on AIA Console Setup page, make sure the weblogic user has the role AIAApplicationUser associated with it. You can associate roles on the Weblogic Admin Console under Security Realms.

5. Also set Notification mode to 'Email' from 'SOA Administration' -> 'Workflow Notification Properties' in EM Console.

9 comments:

  1. hi subs

    i am new to aia and was working on the email notification thru non partner link and did the steps mentioned by u 1,2,3,4,5

    but could not get the email notification

    can you share some doc which can help me

    i Set the email driver properties from EM Console

    Set the my email id in User Messaging Preferences console (http://:/sdpmessaging/userprefs-ui) add email Id for user AIAIntegrationAdmin.

    did not update the AIAConfigurationProperties.xml as it already had the values mentioned by u

    And also set the notification mode to email in em console

    ReplyDelete
  2. Hi

    Can you check if the AIAAsyncErrorHandlingBPEL process has been kicked off incase of non-partner link error and if it has received the correct fault details. I presume you have set the EBM header correctly in your XSLs and populated fault message in catch-all block.

    ReplyDelete
  3. Hi..I want to use the ErrorHandlingFramework where there is no ABM to EBM conversion. In that case how do I populate the EBM Header variable? Is it not possible to use the AIA Error Handling framework where no EBM are used ? Please clarify this in context of AIA Foundation pack 3.0.

    ReplyDelete
  4. Hi, Subs

    Thanks for sharing !
    I followed up all steps, but no luck,

    My question:
    Did step 3 decide "To" email ID ?

    would u please if you have additional setting ?

    Leon

    ReplyDelete
  5. Hi Leon,

    I didn't exactly get your question. Step 3 basically allows you to set the recipient email id for the AIA Error emails. Since we have set in Step2 AIAIntegrationAdmin, so in step3 we are assigning an email address to this role.

    It is a straight forward step, are you looking for screenshots ?

    Regards
    Subhankar

    ReplyDelete
  6. Subs

    yes. Step 3 specified who will receives error notification.

    another question:
    In our system, MDS AIAConfigurationProperties.xml has those values setup previously. so I skipped step 4, is it ok ?

    would u pls send screen snapshot to my personal email id ?
    lei_zhang_00@yahoo.com

    Thanks

    Leon

    ReplyDelete
  7. Subs,

    yes. step 3 is for person who will receive email notification. that is same as what I think

    Our MDS AIAConfigurationProperties.xml has setup as step 2. so, we can skip step 4. right ?

    would u pls send screen snapshot to ?

    lei_zhang_00@yahoo.com

    Thank

    Leon

    ReplyDelete
  8. If you already have the AIAConfigurationProperties.xml set as mentioned in step2 you can skip it.

    Subs

    ReplyDelete
  9. Subs,
    then I followed all steps.
    would u pls send me screen snapshot to lei_zhang_00@yahoo.com ?
    thx

    ReplyDelete