Using variables for a resource definition in a bundle

To simplify the deployment of a bundle's resource definition into different environments, you can use variables to alter its attribute values quickly during deployment by associating the variables with properties files that are specific to different environments. To create variables with CICS Explorer®, use the Insert variable or Extract value to variable wizard.

About this task

Use this procedure to create variables when you edit a resource definition in CICS Explorer. For other types of bundle part, you must update both the bundle part and the variables.properties file manually.

Use the Insert variable wizard to create a completely new variable. Use the Extract value to variable wizard to create a variable from an existing attribute value.

For an overview about using variables in resource definitions in bundles, see Variables in a CICS project.

Procedure

  1. Open the appropriate wizard, depending on the initial state of your attribute value:
    • If you select an attribute without a value, or if the editor for an attribute is active but there is no current selection, right-click, then click Insert variable on the menu.
    • If you select all or part of an existing attribute value, right-click, then click Extract value to variable on the menu.
    Extract value to variable dialog
  2. Enter a name for the variable in the Variable name field. The default name is resourcename.attributename.
    For rules about defining and referencing variables, see Variables and properties files definition.
  3. Select the check box next to each project or binding that you want to provide a variable value for. If a check box is not selected, no value will be added to the properties file for that project or binding.
    Note: If you generate a variable value for an application binding, it will override any values that are contained in associated bundles.
  4. In the Value column, enter the value that the variable will resolve to for the associated project or binding.
  5. Click Next.
  6. The next pane provides a preview of the files that the wizard will change or create. If the changes are as you require, click Finish.

Results

The resource definition in the editor is updated and properties files are updated or created as required.

When you edit resource definitions, you can use your created variables as values. In the Value field of the Attributes page, press Ctrl+Space to view a list of available variables and their values.

From the Attributes page, you can see what a variable will resolve to. When you hover over a variable in the Value field, a preview of the resolved value is provided as a tooltip. If the variable is set by more than one valid variables.properties file (for example, in the CICS® bundle project and an application binding), the tooltip displays all possible resolved values.
A screen capture of a tooltip in the attributes editor, showing possible resolved values and where the variable is set

What to do next

Build the projects and then resolve them by using the CICS build toolkit. For more information, see Resolving variables in a CICS bundle in the CICS TS 6.1.0 product documentation.