Thursday, November 26, 2015

Dynamically changing XSLT file name in BPEL

I recently came across a scenario where multiple BPEL process were doing the same work, the only difference was the transform activity. So for re-usability we  create a single Composite which dynamically pick the XSLT file on the basis of requirement from MDS.

So the benefit will be every time there is a need to create a new composite we just have to create a new XSLT file and place it inside MDS and the BPEL process will pick it up.

To achieve this transform activity allow us to pick the file from MDS however we can't change the name of the file dynamically.

However assign activity allows us to execute the XSLT file we have  a function

ora:executeXSLT(location of XSLT file, input xml)

Below source code from Assign will make more sense


 
    dvm:lookupValue("XSLTFileLocations_MDS.dvm","TARGET_SYS",$FileName,"MDS_XSLT_LOC","N/A")
    $XSLTFileName/ns3:XSLTFileLoc
 
 
    ora:processXSLT($XSLTFileName/ns3:XSLTFileLoc,$ReceivePO_Consume_Message_InputVariable.body)
    $InvokePO_send_InputVariable.body
 

 
Below is how the dvm looks like




No comments:

Post a Comment