This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

When does value template get triggered?

Hi,

We are working with Value Templates and would like to know under what all conditions does a template get triggered and where can we change that, if possible?

For example, the template for Person.CentralAccount makes use of Person.FirstName and Person.LastName. If the value of LastName for an employee is changed, the value for CentralAccount changes. Which means that the template for Person.CentralAccount is executed if LastName or FirstName is changed. Can we prevent the CentralAccount template from executing on change of FirstName and LastName? How can we do this?

Thanks for your help in advance.

  • Hi,

    All templates are triggered based on changes to referenced attributes.  This includes attributes that are explicitly referenced (using the $ notation) and even attributes referenced in VB.Net comment lines (prefixed by a ' [single quote]).

    If you want the template to only fire once and never again, then uncheck the 'overwrites' checkbox.

    But be aware ... you may get some undesired side effects .... for example if the template builds centralaccount from firstname and lastname ..... it may only trigger when one of the attributes is populated and it may not trigger again when the other attribute is populated.  You'll have to figure this out in testing.


    HTH, Barry.

  • Thank you for your response.

    Is there any way by which the CentralAccount can be created using the FirstName and the LastName and further changes to CentralAccount be not allowed, irrespective of the changes in FirstName or LastName?

  • Hi Antra


    You'd need to remove the overwrite flag on the template of Person.CentralAccount. To do this, you'd need to enable the custom configuration on Person.CentralAccount (which will then grab the default template configuration into the custom template) and remove the flag on the custom tab. Commit to database, compile and you should be done.

    Best Regards
    Carsten

  • Hi Cartsen,

    Thanks for your response. 

    As mentioned by you, on removing the Overwrite flag, the template is getting triggered only when the FirstName is getting populated and not when LastName gets populated. This results in a value of CentralAccount that only takes into account the FirstName and not the LastName.

    Looking for a solution for this problem.

    Thanks.

  • You can use the local object meta values to achieve what you want.

    Please check the following online documentation section http://documents.software.dell.com/identity-manager/7.0.1/configuration-guide/scripts-in-one-identity-manager/using-dollar-$-notation/accessing-local-object-meta-values

    Four your case:

    1. Activate the IsOverwriting flag again for the template.
    2. Add a condition to your template that checks if the object was loaded from the database and if so do not execute the template. Condition would be

    If NOT $[IsLoaded]:Bool$ Then

     ... ' Do Something

    End If

  • Hi,

    I am facing similar problem in firing templates. I have extended the schema of a table and then wrote a custom template in the extended column. I am not referring to a attribute/column that is a immediate foreign table of the extended table. Instead i wrote a VB.Net script which create Connection.CreateCol of another table and have a business logic to pick the value from the result.

    In short, my template is not dependent on a foreign table's column directly. In this scenario, how can get my template triggered if there is a change in the value of referring Table's particular column.
  • In short, you can't.

    The notifications to trigger the value template generation require that your tables are connected in a way that a $FK(...).$FK(...)... look-up would be able to find the value.

    In your case, when I am understanding it correctly, you need to change the value in your custom column for many objects when the value in the referring table has changed.

    For that use-case you have two options:

    • Asynchronous: Create a process chain that will be triggered by the UPDATE event of your referring table. In the process create a process step that uses the task ExecuteTemplates to re-executes the templates for the objects that are related to the changed value of your referring table. You can limit the template execution to your custom column by specifying the process step parameter Columns.
    • Synchronous: Re-execute the templates for the objects that are related to the changed value of your referring table in the OnSaved script of your referring table. Be aware that the save operation for your referring table could run for a long time if you have many object to execute the templates for.

    To prevent any long-running save operations for your referring table I would opt for the asynchronous method.