Built-in actions

When you use built-in actions, mapping rules ignore objects, set properties on objects, or create relationships to or from objects.
Not all of these actions are used in all operations where mapping rules are evaluated.
Here are the following built-in actions:

IGNORE action

The IGNORE action means that the object must be ignored. When used with a migrate operation, it means that the behavior is equivalent to the object not existing in its migrate source location. When used with work area conflict detection, it means that any uncontrolled file with this action is ignored and not reported as a work area conflict. The reserved word IGNORE is not case-sensitive.

Example: WHEN %name ~ '*.tmp' IGNORE

In this example, objects with a .tmp suffix are ignored.

SET action

The SET action sets a named property on the migrate object that represents a potential or actual Rational Synergy object. The three usage cases for this action are as follows:
  • When this action is performed during work area conflict detection, it determines the default type that is used if and when a Rational Synergy object is created to resolve an uncontrolled object conflict.
  • When this action is performed for a create operation where the user has not explicitly specified a Rational Synergy type, it determines the default type that is used.
  • When this action is performed as part of a migrate operation, it results in a corresponding attribute being expressed in the import package generated by migrate.

Here is the syntax of this built-in action:

SET nameExpression TO valueExpression

SET TYPE TO valueExpression

The first form specifies the name of the property using a nameExpression that is converted to a string. The string must be a valid Rational Synergy attribute name. The second form is provided as a convenient shortform that is equivalent to specifying a nameExpression of ’type’. The SET, TO, and TYPE reserved words are not case-sensitive.

The valueExpression specifies the value that is to be set for the property.

Example:

WHEN %name ~ '*.java' SET TYPE TO 'java'

WHEN %name ~ '*.perl' SET 'type' TO 'perl'

In this example, objects with a .java suffix are created with a Rational Synergy type of java, and objects with a .perl suffix are created with a Rational Synergy type of perl.

For migrate usage, the type of Rational Synergy attribute that is expressed in the generated import package depends on the type of the result of the valueExpression as shown in the following table:

Table 1. Type of the result of the valueExpression
Type of value Type of Synergy attribute
Integer integer
Float float
Boolean boolean
String A value containing any newline characters becomes text. If the value does not contain any newline characters, it becomes string.
any other type The value is converted to a String using the Java™ toString() method, and the rules for String as described above are applied.
Migrate usage has the following restrictions:
  • Rational Synergy built-in attributes name, version, type, and owner must be of type string.
  • Setting the subsystem attribute has no effect. This Rational Synergy attribute holds instance values, and instances are determined automatically by Rational Synergy when the import package created by migrate is imported.
  • Rational Synergy built-in attributes create_time and modify_time must be of type time.
  • You cannot change the name of a root directory of a project. It must always have the same name as the project in which it is used as a root directory.
  • For non-project objects that are not a history-leaf, the status cannot be set to a non-static state such as "working".

BECOME and MAKE actions

The BECOME and MAKE actions are used in migrate operations to express a relationship to or from the object being migrated and another object.

The BECOME action creates a named relationship from the specified the object to the object being evaluated. The MAKE action creates a named relationship from the object being evaluated to the specified object. The syntax of these actions is as follows:

BECOME relationExpression OF objectExpression

MAKE objectExpression MY relationshipExpression

The BECOME, OF, MAKE,, and MY reserved words are not case-sensitive.

The relationExpression is converted to a string and specifies the name of the relationship that is expressed in the import package generated by migrate. This name must be a valid Rational Synergy relationship name.

The objectExpression is converted to a string and must be the four-part objectname form of an existing Rational Synergy object.

Example:

WHEN %name='Utils.java'

BECOME 'associated_cv' OF 'task12:1:task:probtrac'

In this example, a file named Utils.java has an associated_cv relationship from the object task12:1:task:probtrac to it.

STOP action

The STOP action is used in migrate operations to stop further processing of mapping rules for the current object. This action might be used to prevent the actions of previously evaluated rules from being overridden by later rules.


Feedback