Load fragments dynamically in xCP 2.2

Options
dnvhariprasad
edited May 16, 2017 in Documentum #1

We need to load the fragments dynamically. These fragments have multiple inputs.  Each fragment has different set of inputs. We can do this using the expression for fragment ID.  However when we load using expressions, only ID input is available and all other inputs are not visible.  How can we achieve this functionality.

Best Answer

  • Vinojass
    edited March 7, 2015 #2 Answer ✓
    Options

    To achieve your condition simply use dummy variables, For example I have two fragment with 3 common variable  like var0_string, var1_bool and var2_integer but in fragment_aaa I am using  var0_string and var1_bool same as fragment1_aaa I will use var0_string and var_integer. So Here point is If you want to use fragments in dynamic then you should have common set of attribute and proper system name (to get fragment in run-time using expression) of fragments.

Answers

  • Swati.Bhatia
    edited March 3, 2015 #3
    Options

    Use Fragment Data Hint and map the inputs.

    Choose a fragment as a data hint which has all the inputs required.

    The inputs will be resolved correctly during runtime.

  • dnvhariprasad
    edited March 3, 2015 #4
    Options

    In the Fragment Data Hint, we need to select a particular fragment right?  But in my case, I am loading the fragment content dynamically using expression.  In the fragment Data Hint, I can chose only one fragment.

  • Vinojass
    edited March 4, 2015 #5
    Options

    Consider I have 3 fragment...

    fragment1_aaa have

    var1, var2, var3 as inputs

    fragment2_aaa have

    var1, var2, var3, var4 and var5 as input

    fragment3_aaa have

    var1, var2, var3, var4 , var5, var6 and var7

    note. here input name are same (var1, var2 ...)

    Now if you want to get these fragments dynamically then you should use fragment3_aaa as fragment hint because it only contains the all the inputs of other fragments.. then dynamically the fragment will take the inputs...

  • dnvhariprasad
    edited March 4, 2015 #6
    Options

    How is it possible?  If the inputs are of different types like string, integer and boolean how does it take automatically?

  • Vinojass
    edited March 7, 2015 #7 Answer ✓
    Options

    To achieve your condition simply use dummy variables, For example I have two fragment with 3 common variable  like var0_string, var1_bool and var2_integer but in fragment_aaa I am using  var0_string and var1_bool same as fragment1_aaa I will use var0_string and var_integer. So Here point is If you want to use fragments in dynamic then you should have common set of attribute and proper system name (to get fragment in run-time using expression) of fragments.

  • Jothi-Its
    edited May 1, 2017 #8
    Options

    Hi Hari

      Will you please let me know how you handle this scenario?. I would like to know as I am also have same kind of scenario.  also can you explain how to use getFragment() to pass fragment dynamically.

  • dnvhariprasad
    edited May 16, 2017 #9
    Options

    solution solved the issue