Creating Custom Placeholders

Overview

Users can develop custom placeholders to retrieve data that is not represented by an existing placeholder, or to convert an existing placeholder to a different format, such as a different date format. You upload these custom placeholders to Workflow Integrator (WI). When resolving placeholder values, WI will look for custom placeholders first, then for predefined placeholders, and then try to resolve the values from fields in the ticket in SecureChange.

Create Custom Placeholders

You create a Python module called custom_functions.py, which contains all custom placeholder functions, and place it in a location where WI can read it. Each custom placeholder function defined in the Python file uses a ticket object as a parameter and returns a string value. WI uses the function name as the name for the custom placeholder.

Follow these steps to create custom placeholders in WI:

  1. Create a Python file called custom_functions.py.

  2. Add function definitions for each custom placeholder.

    The definition is in the following format:

    def <name_of_function>(ticket, **kwargs):
    	return "text"
    The **kwargs parameter is required, but you do not replace it with anything.

    For details about the structure and contents of the ticket object, see Custom Placeholder Objects.

  3. Use these commands to create the target directory, copy the custom_functions.py file so that WI can find it, and change the file ownership so that SecureChange can access it:

    # mkdir -p /opt/tufin/extensions/workflowintegratorserver/plugins
    # cp custom_functions.py /opt/tufin/extensions/workflowintegratorserver/
    # chown -R tomcat:apache /opt/tufin/extensions/workflowintegratorserver