Forum Discussion

FICO's avatar
FICO
Community Manager
15 years ago

Is it possible to provide a list of allowed templates depending on a given key value ?

Is it possible to provide a list of allowed templates depending on a given key value ?

Hi, All:

I'd like to design one generic ruleset template for 3 projects in one repository.

In these 3 projects, there are some differences such as actions. What I need is I can only choose action templates for the project selected but not all templates.

I've tried association provider, but when association provider links to template list, it shows GUID, not the template.

I've tried to use filter. It still doesn't work.

Is there any solution for such kind propose ?

3 Replies

  • FICO's avatar
    FICO
    Community Manager

    Hi,

    Yes, this is possible using template arguments.

    1. Create your generic template, and use a Template List Provider where you need flexibility.
    2. Create a template or provider reference argument on your generic template
    3. Pass the template argument to the Template List Provider value holder inside your template
    4. Create a specific template for your specific case, which only needs to act as a wrapper for your generic template. 
    5. Pass a provider or template configured for your specific situation to the generic template as an argument

    HTH,

    Jostein

  • FICO's avatar
    FICO
    Community Manager

    Hi, Jostein:

    Thank you for your reply.

    I've tried as your 5 steps as bellow.

    1) use a TemplateListProvider

        I create a TemplateListProvider which include 3 Templates. Each Template is for one project.

    2) Create a reference argument (ProjName)

       I create a value holder names ProjName as a argument to pass to the TemplateListProvider in step 1)

    3)Pass the argument to the TemplateListProvider

        In the value holder reference to TemplateListProvider, I set a ListProvider argument as dynamic override and select the value from ProjName

    So far, what I can't understand is even I set the argument(ProjName) as above, there's no place in the TemplateListProvider to catch(or set)  this argument for filter the templates in the TemplateListProvider.

    Is there anything wrong in my steps ?

    Or do I misunderstand what you said ?

    Could you please show me more details ?

    Thanks!

  • FICO's avatar
    FICO
    Community Manager

    I would create the initial template list provider containing only common functionality. The point of the technique is to create the common structure, and modify it for each specific case.

    Each of the three projects would then make the common functionality specific by passing arguments specific for that project.

    So, do not create a single template list provider for all your templates, create one common template list and make it specific through parameters.

    Regards,

    Jostein