This discussion is archived
3 Replies Latest reply: Oct 4, 2013 1:45 PM by LFHeckler RSS

How to pass simple parameter to XSLT from BPM 11g Data Association

JoeA Newbie
Currently Being Moderated

Is it possible to pass a simple parameter to an XSLT from a BPM 11g Data Association (11.1.1.6.0)?  Here is why I asked.  I have a transform that I want to reuse across two service activities in the same process.  The only difference is one integer ID value between the two activities.  (Happens to be running an IPM saved search, each with a different ID.)

 

I tried mapping the ID value in the Data Association dialog, in addition to the XSLT mapping, but didn't work.  Or is there another method I could use to reuse this transform (besides just copying it as I've done for now)?  Thanks.

  • 1. Re: How to pass simple parameter to XSLT from BPM 11g Data Association
    LFHeckler Explorer
    Currently Being Moderated

    As far as I know the XSLT mapper do not accept parameters of simple type as source.

    You need to create a complex dataobject, even with one element only, but need to be a complexType to be included as a parameter.

     

    If you add the two sources from the complex dataObjects, one will be considered a parameter and can be used in xpath expressions as  $variableName to refer to it.

     

    Regards

    Luis Fernando Heckler

  • 2. Re: How to pass simple parameter to XSLT from BPM 11g Data Association
    JoeA Newbie
    Currently Being Moderated

    Thanks for the idea Luis, but that didn't exactly work.  Here's why...  I created a business object that contains nothing but an integer id value as you suggested, let's call it SearchParams.  I then created two different instances of the business object as process data objects, let's call them search1 and search2.  I changed the XSLT to accept this business object SearchParams as an input.  In the input Data Associations for the activity, I added the data object search1 to be passed.  But JDeveloper complains it doesn't match the XSLT inputs.

     

    I believe that's because the input param must be named searchParams (the generated param name from the type SearchParams).  Now I suppose I could create another process data object named searchParams of type SearchParams, and then copy search1 to searchParams, and pass that instead.  Just seems a little round-about.  Anyone have a more direct technique?

  • 3. Re: How to pass simple parameter to XSLT from BPM 11g Data Association
    LFHeckler Explorer
    Currently Being Moderated

    If I understood your scenario, the point is: you always have to pass the same dataObjects as parameters to the XSL, but you can change the values of them in an association step before the transformation.

     

    Lets see if the following can fit your needs:

    1) your project has three BusinessObjects: "SearchParam", "CommonData" and "Result"; and five process dataObjects:

    - "search1", "search2" and "search" of type "SearchParam";

    - "commonData" of type "CommonData";

    - "result" of type "Result"

    2) your XSL has "result" as target and two sources: "search" and "commonData"

    3) In some part of the process flow you have a scriptTask with:

    - a data association from "search1" to "search";

    - a transformation with "search" and "commonData" as parameters

    4) In other part of the process flow you can use the same transformation, but using the data from "search2" as parameter, adding a scriptTask with:

    - a data association from "search2" to "search";

    - the same transformation with "search" and "commonData" as parameters

     

    In this scenario you are reusing the same XSL file only changing the values for one parameter.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points