Dear SCN Friends,
I would like to share my knowledge on calling BRM Rules from BPM in different ways.I would like to take a simple example/use case to explain this .
SYSA sends EmployeeID and OrgName to SYSB .SYSB responds back with Region and Grade of the employee .Now by passing Grade and Region will get Hike% from BRM rules service and sends this infomation to SYSC.
Here my main focus is on calling BRM rules from SAP PO mapping(Using SOAP Lookup) and calling Directly from BPM by taking above use case to explain.
Step1:Create an External Definition in PO and select the wsdl which was downloaded in our previous blog BRMRulesCreation.
CASE1:Calling BRM Rules from Message Mapping.
Step2:I have developed a BPM (Async-Sync scenario) to call SYSB and get the Region and Grade values of an employee and pass those values out from BPM.
In the below flow diagram highlighted send step represents the step which holds the structure with values for (EMPID,OrgName,Region and Grade).
Step3:Create a mapping between Source Msg (BPM’s Output Msg) and Target Msg (Will send this Msg to SYSC).In this Mapping will get the value for Hike% from BRM rulesset by using SOAP look up.
Give SOAP communication channel as an Input to Function Library(UDF)
Below is the code for BRMLookup.
Step4:Create an Operation Mapping for the above Message Mapping
Step5:Now Create an IFlow between BPM and SYSC.
Select your Operation mapping by clicking on browse .Now click on Lookup Channels.
Click on Assign Channel and select your SOAP channel for BRM Lookup.
We get the above url from NWA–>SOA–>Application and Scenario Communication–>Single Service Administration
GIve your project relevant filter say “*empHike*”–>Click on Go–>Select your WSDL port type Name–>Click on WSDLs–>
Double Click on above url,then below window opens.Copy the highlighted url and put the same in SOAP channel in PO to invoke BRM Rulesset.
CASE2:Calling BRM Rules from BPM.
Step6:Create Service Interface for the above Imported BRM WSDL.
Import the above wsdl into BPM .
SyncCall_Region_Grade :Sync send step to get Region and Grade values for the given EmpID and OrgName
BRMLookup:Sync send step to fetch Hike% for the given Region and Grade
SendToRecSystem:Async send step to send employee details to SYSC.
In two different ways we can invoke BRM Rules service .
1)Using an IFlow between BPM and BRM Rules service.
2)Direct calling from BPM to BRM Rules service.
I’m sure most of you are well aware on 1st option ,so I will take 2nd option to explain.
Go to NWA–>SOA–> Application and Scenario Communication–> Application Communication
Select your Software Component and service group of type WS and change to Edit mode.
Switch to tab Configuration, and click on Configure Manually
Give the url and credentials to connect BRM rules service.
Click on Next to confirm the service endpoint.The Web Service endpoint URL is automatically set based on the binding information within the WSDL. Navigate to couple of screens by clicking on Next and at end click on Finish.
Save the service group.
Steps8:Testing the Scenario
Input File placed in SYSA
Output File placed in SYSC
Documentation really tested my patience .Any how ,Happy Learning .Enjoy