+49 (30) 467086-20 service@microtool.de
Products » objectiF RPM » Administrative Tasks » Patterns » Using placeholder in a pattern

Using placeholder in a pattern

You can define placeholders in your pattern to include properties (project properties, custom properties) such as name, date, or notes, which are then automatically inserted into the name or description when you apply the pattern.

See Useable placeholders for a list of placeholders that can be used.

Create pattern with placeholder
  1. Open the Settings window via Show/ Show Settings.
  1. In package Pattern catalog, select a package or create a new package.
  1. In the package, use the context menu Create other/ Pattern… to create a new pattern. Enter a name for the pattern and select a stereotype.
Tip
The stereotype always depends on the artifact to which the pattern is to be applied later. For example, if you want to apply the pattern to an activity, choose the Activity stereotype in the Create Pattern dialog. The pattern is then made available in the context menu of an activity.
  1. Select the pattern and create another package via the context menu. Enter a “placeholder” as the name, which is to be generated later via the pattern.
  1. Click OK and switch to your project.
  2. Create a package there and select Apply Pattern/ [Created Pattern] from the context menu.
  3. Replace the placeholder under Replacing Names and confirm with OK.
Hint
If you have defined child elements in the pattern, these elements are not displayed in the Pattern Configuration dialog.

A new package is created in the project with the name defined in the pattern.

Usable placeholders

You can also use placeholders in patterns, which you will later replace with concrete names when you apply the pattern.

Hint
If you format placeholders, make sure that the entire placeholder receives the formatting, otherwise it will not work.
Correct:{$shortDate}
Wrong: {$shortDate} , {$name}
Automatically generated placeholders  Note
Name of organization = {$organizationName}
Id of organization = {$organizationId}
Name of project = {$projectName}
Id of project = {$projectId}
current date with time = {$timestamp}
current date = {$shortDate}
ID of element = {$identifier}
Name of element = {$name}
current user = {$userName}
Name of the element to which the pattern is applied
(version 7.6 and higher) = {$contextName}
Name of the parent element (package, requirement, etc.) to which the pattern is applied
(version 7.6 and higher) = {$contextParentName}
Name of the element that is selected as the target package
(version 7.6 and higher) = {$targetName}

Placeholders with their own replacements

Name of artefact = {Title}

Using a placeholder when creating new elements

objectiF RM offers you three placeholders that are generated and replaced by the system: ID of the element, name of the element and the date when the element was created.

This gives you the opportunity to

  • the generated ID of an element in the name
  • the name and generated ID of the new element in the description text, and
  • the time (date and time) of creation

take over.

  1. Create a new pattern from the context menu of a package with Create other/Pattern.
  2. Name the pattern and specify the stereotype to which the pattern is to be applied later under Stereotype of Context Element.
  1. Use the context menu of the pattern to create elements that the design is to create later.
Hint
If you create elements in the pattern that are to have relationships with each other, make sure that you only assign the pattern elements from the pattern when assigning them.
  1. Open the editing dialog of the element and enter dynamic placeholders in the name field or in the description field.
  1. If you now apply the pattern, all you need to do is overwrite the requirement name and select a package where to place the new requirement. By default, the package to which you applied the pattern is selected.
  2. Click OK.

The pattern creates the elements and overwrites the defined placeholders with the values.